Cart Attribute Field Undefined

I need this kind of box to my check out on Shopify store. I just can’t get it coded right. Could you fix it for me?

1 Like

helpful feature

Hi @homiehomie for theme customization services you can contact me.

Contact info in forum signature.

Otherwise try to DIY using tools like https://ui-elements-generator.myshopify.com/pages/cart-attribute

And if the theme has it a custom-liquid section or block in the relevant template

Good Luck.

Hi @homiehomie ,

Please go to ‘…’ > Edit code > sections > main-cart-footer.liquid file and add code follow the instructions below

There are two parts to this @homiehomie

  1. Setup a input field on your main-cart.liquid (to get the relevant values from the customer)
  2. Block the customer from heading to checkout without these values filled in.

For (1) - you can utilise the code below to setup a basic embed that goes on your cart page and collects the user’s gmaps email. Feel free to take this base code and customise it further as per your need.


  ### Your Google Maps Account
  

    Important: Fill in your Google Maps email address you are using on Google Maps! 
    (Usually a @gmail.com).
  

  

  

Here’s how that would look like in action, I’ve added a few console logs to show the same.

  • here’s where this would go on the theme code for reference, your theme may differ and you’d need to find the right place to add this in.

For (2) - customers can easily bypass checkout without clicking any buttons on your store by simply putting “/checkout” at the end of the URL. Savvy customers would probably do this + this is also common with bots.

To prevent such behaviors, I’d suggest to setup a cart validation function using an app like Dollarlabs: Ultimate Discounts to ensure that only if the cart has the appropriate attributes - it would allow the user to head to checkout.

If you found my answer helpful - can you mark it as a solution so that it may help others who stumble on this post.

@homiehomie Since quite some time has passed since you raised this thread, I’m assuming you’ve already reached at a solution :slightly_smiling_face:

If so - can you please share the same and close this thread out so that others who stumble here might also find value.

Best,