Friday, January 1, 2016

Shopify – Auto fill discount code on checkout page

Locate this line of code in your cart.liquid template

<form action="/cart" method="post" id="cart">

Directly below that line of code you need to place something like this

<input type="hidden" name="discount" value="RESELLERDISCOUNTCODE" >

Where “RESELLERDISCOUNTCODE” is your discount code.

If you want apply this to only a specific group of customers. you can use tags to create a customer group and then only apply the code to customers who are in that group.

{% if customer.tags contains 'RESELLER' %}   <input type="hidden" name="discount" value="RESELLERDISCOUNTCODE" >   {% endif %}

3 comments:

  1. Thank for sharing information. this will really help me to develop shopify websites

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. A personal course includes the establishment of a professional store accompanied by personal training and professional consultation. shopify

    ReplyDelete