Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #529 from Nosto/hotfix/add-to-cart-js-function
Browse files Browse the repository at this point in the history
Hotfix 3.11.1 - Fix Add Multiple Products To Cart Javascript Function
  • Loading branch information
supercid authored Jul 12, 2019
2 parents 9adef5a + 58d8717 commit 049f3b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 3.11.1
* Fix add multiple products to cart javascript function where some products added could have no image or link

### 3.11.0
* Use mock products in category personalisation when preview mode is enabled
* Ignore non-numeric product ids in Graphql responses
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Nosto/Tagging/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<config>
<modules>
<Nosto_Tagging>
<version>3.11.0</version>
<version>3.11.1</version>
</Nosto_Tagging>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,9 @@ $formKey = $session->getFormKey();

// Products must be and array of objects [{productId: "123", skuId: "321"}]
Nosto.addMultipleProductsToCart = function (products, element) {
var skus = [];
products.forEach(function(product) {
Nosto.trackAddToCartClick(product.productId, element);
skus.push(product.skuId);
Nosto.addSkuToCart(product, element, 1);
});
var fields = {};
fields["product"] = skus.pop();
fields["related_product"] = skus;
fields["form_key"]= "<?php echo $formKey; ?>";
Nosto.postAddToCartForm(fields, "<?php echo $formAction; ?>");
};

// Product object must have fields productId and skuId {productId: 123, skuId: 321}
Expand Down

0 comments on commit 049f3b0

Please sign in to comment.