Add 'Authority to Leave' option in a Shopify shopping cart

Overview

Enable 'Authority To Leave' in Shopify by displaying a checkbox on the shopping cart page and importing your customer's custom selection.

Modify the shopping cart page in Shopify

To add a checkbox to select 'Authority To Leave' in your Shopify shopping cart, you first need to create a checkbox that your customer can select. To display a checkbox in your shopping cart, you need to edit the Theme Code of Shopify and copy the custom code from Starshipit. 

To learn how to edit the Theme Code, refer to the section "Add a form field to your theme code" of this article or you can follow the following steps.

  1. On the Shopify admin page, go to Online Store > Themes.
  2. Locate the theme you want to edit, and then click Actions > Edit code.
  3. In the Sections area, click on cart-template.liquid. If your theme doesn't have a cart-template.liquid, then, in the Templates directory, click on cart.liquid.
  4. Search for the last subtotal reference in the file, and then locate the closing tag.
  5. On a new line right below the closing tag, paste the code below. You may need to experiment with putting the code in different places to ensure the field appears correctly on your cart page.
<p class="cart-attribute__field">
       <input type="hidden" name="attributes[Authority To Leave]" value="No">
       <input type="checkbox" name="attributes[Authority To Leave]" value="Yes"{% if cart.attributes["Authority To Leave"] == "Yes" %} checked{% endif %}>
       <label>Authority To Leave</label>
</p>

This is what it should look like when the code has been pasted:

inline-1633606309.png

You can modify the style of the checkbox, however, the name must be Authority To Leave. Otherwise, the information won't be imported into Starshipit.

How this appears in Shopify

After you have added the Authority To Leave checkbox, you should see it on your shopping cart page and the order details page.

inline-915512049.png

 

inline14607892.png

How this appears in Starshipit

After you have added the Authority To Leave checkbox to your Shopify shopping cart, your customer can select it during the checkout process. When orders are imported from Shopify to Starshipit, the Authority to Leave option will be automatically selected in Starshipit.

Want to deliver great shipping experiences?

Start a 30-day free trial or book a demo with one of our shipping experts

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.