Skip to content

Commit

Permalink
Merge pull request #591 from alma/fix/infinite-reload
Browse files Browse the repository at this point in the history
Improve insurance integration stability & prevent unnecessary reloading of widget
  • Loading branch information
olance authored Oct 30, 2024
2 parents 1de63d1 + 50fb334 commit ad0cf10
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public function run($params)
? $productParams['id_product_attribute']
: null;

$quantityWanted = isset($productParams['quantity_wanted']) ? $productParams['quantity_wanted'] : 1;

$cmsReference = $this->insuranceHelper->createCmsReference($productId, $productAttributeId);

$staticPrice = $this->productHelper->getPriceStatic($productId, $productAttributeId);
Expand All @@ -132,11 +134,12 @@ public function run($params)
'productDetails' => $this->handleProductDetails($params),
'settingsInsurance' => $this->handleSettings($merchantId),
'iframeUrl' => sprintf(
'%s%s?cms_reference=%s&product_price=%s&product_name=%s&merchant_id=%s&customer_session_id=%s&cart_id=%s',
'%s%s?cms_reference=%s&product_price=%s&product_quantity=%s&product_name=%s&merchant_id=%s&customer_session_id=%s&cart_id=%s',
$this->adminInsuranceHelper->envUrl(),
ConstantsHelper::FO_IFRAME_WIDGET_INSURANCE_PATH,
$cmsReference,
$staticPriceInCents,
$quantityWanted,
$productName,
$merchantId,
$this->context->cookie->checksum,
Expand Down
Loading

0 comments on commit ad0cf10

Please sign in to comment.