Documentation You are here: start » v » 2.0 » javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:javascript [2019/04/04 00:18] – [File Structure] adamv:2.0:javascript [2023/04/04 14:07] (current) – [Available Events] adam
Line 23: Line 23:
 <script> <script>
 var FC = FC || {}; var FC = FC || {};
-FC.onLoad = function () {+FC.onLoad = function() {
     FC.client.on('cart-submit', function(params, next) {     FC.client.on('cart-submit', function(params, next) {
         $element = $(params.element);         $element = $(params.element);
Line 56: Line 56:
   * ''%%data-fc-id="minicart-order-total"%%'': The inner HTML will be replaced by the value in ''FC.json.total_price'', formatted using the ''_currency_format'' function (which adds decimals but doesn't add currency symbols).   * ''%%data-fc-id="minicart-order-total"%%'': The inner HTML will be replaced by the value in ''FC.json.total_price'', formatted using the ''_currency_format'' function (which adds decimals but doesn't add currency symbols).
   * ''%%data-fc-id="minicart-singular"%%'': The inner HTML will be shown if value in ''FC.json.item_count'' is equal to 1, and is hidden otherwise. It can be useful if you want to show "Item/Product" instead of "Items/Products" for ''FC.json.item_count'' = 1.   * ''%%data-fc-id="minicart-singular"%%'': The inner HTML will be shown if value in ''FC.json.item_count'' is equal to 1, and is hidden otherwise. It can be useful if you want to show "Item/Product" instead of "Items/Products" for ''FC.json.item_count'' = 1.
-  * ''%%data-fc-id="minicart-singular"%%'': The inner HTML will be shown if value in ''FC.json.item_count'' is greater than 1 or less than 1 (zero), and is hidden otherwise.+  * ''%%data-fc-id="minicart-plural"%%'': The inner HTML will be shown if value in ''FC.json.item_count'' is greater than 1 or less than 1 (zero), and is hidden otherwise.
  
  
Line 86: Line 86:
     * ''cart-item-quantity-update'': When a quantity is changed in the cart     * ''cart-item-quantity-update'': When a quantity is changed in the cart
     * ''cart-item-remove'': When a quantity is removed from the cart     * ''cart-item-remove'': When a quantity is removed from the cart
-    * ''cart-coupon-add'': When a coupon is added+    * ''cart-coupon-add'': When a coupon or gift card is added
     * ''cart-coupon-remove'': When a coupon is removed     * ''cart-coupon-remove'': When a coupon is removed
 +    * ''cart-gift-card-remove'': When a gift card is removed
     * ''cart-update'': Called when the cart is updated. Things like rendering Twig templates or setting the FC.json.     * ''cart-update'': Called when the cart is updated. Things like rendering Twig templates or setting the FC.json.
     * ''cart-shipping-options-update'': Called when the shipping options are updated     * ''cart-shipping-options-update'': Called when the shipping options are updated

Site Tools