Skip to main content
The script is the same everywhere. What differs is where the container goes and how you read the amount. On every platform, the checkout card goes under your MyFatoorah option and shows when it is selected.
  1. Online Store, Themes, Edit code. In theme.liquid, before </head>, paste the script tag.
  2. In main-product.liquid, under the price, add the krti-promo container and pass amount: '{{ product.selected_or_first_available_variant.price | money_without_currency }}'. Call update({ amount }) on variant:change.
  3. In main-cart-footer.liquid, the same container with {{ cart.total_price | money_without_currency }} and source: 'cart'.
  4. Checkout page: the KrtiCard goes under your MyFatoorah option.
A Shopify app that does this without touching the theme is coming next.
Theme custom code (header) for the script; the product and cart twig partials for the containers, with {{ product.price }} and {{ cart.total }}.
Theme settings, Custom JS, for the script; the product and cart templates for the containers with Zid’s product price variable.
A snippets plugin or functions.php: wp_enqueue_script for the script, the woocommerce_single_product_summary hook for the product container with $product->get_price(), and woocommerce_cart_totals_after_order_total for the cart with WC()->cart->get_total('edit').
Paste the snippets from the quickstart where your page renders the price and the payment options.
Amounts must have the currency’s decimals: KWD has three. Format the platform’s price as a string ("45.000"), never pass a number with floating point rounding.