We Build Shopify Apps

Montreal-based Shopify experts cooking some Shopify apps.

Shopify Post Image

Carter app custom theme integration - Coupon Field templating for Shopify

Requires Carter for Shopify

Most of the themes available on the Themes Marketplace have premade configurations ready to be activated in one click with the Carter app. But some don't have, or sometimes you, merchants, want more than our basic integration. That's why we created custom templating, allowing you to add your own code to our carter snippet, directly in your theme.

1. At the bottom of the admin app screen, click on Advanced Usage.

Carter Coupon Field in Cart for Shopify

2. Custom Integration in your theme files

This section provides some useful information if you want to extend Carter beyond the normal configurations functionality.

Below are examples, don't try them at home if you don't have some coding skills.

You can define a global function named tbnaftercode_applied(data). Carter will call this function after each applies. Example below:

<script>  
    function tbn_carter_after_code_applied( data ) {
      console.log("Applied data from carter is",data);
    }

    /*
    Applied data from carter is 
      {
        code: "TEST_CODE"
        code_applied: true
        code_applying: false
        has_tooltip: true
        nice_amount: "$12.40 off total order price"
        normal_amount: "- $12.40"
      }
    */
</script>  

Carter also exposes a global function to apply a discount code programatically tbncarterapply_code("mycode"). The app will apply the code and update the tooltip. Make sure you call the function after our script tag was loaded. You can check if the script was loaded like this:

<script>  
    if (window.TABARNAPP_CD_LOADED === true || (typeof tbn_carter_apply_code === "function")){
      tbn_carter_apply_code("mycode").then((data)=>{
        console.log("Applied data from carter is",data);
      });
    } else {
      console.log('carter app was not loaded yet.');
    }
  </script> 

Use Case - Example

Some merchants are already using this feature to create some pretty amazing user-experience.

Carter Coupon Field in Cart for Shopify


Try Carter for Shopify

Get In Touch

Tabarnapp's mission is to help you get the most of each visit on your Shopify store.

E: support@tabarnapp.com