ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE & CartThrob: How to pass custom field variables from Cart to Checkout pages

December 13, 2013 7:33pm

Subscribe [2]
  • #1 / Dec 13, 2013 7:33pm

    Victor Paredes

    7 posts

    Hey all. I know this isn’t a CartThrob community, but I was hoping to catch someone who may know about this.

    In my CartThrob {update_cart_form}, I have a Matrix-populated zip code drop-down field. When a user clicks “Checkout” I want the value of the drop-down menu to pass as a variable to the checkout page and populate the billing zip code field. Is this possible?

    I need this custom value as we only make deliveries to certain zip codes in our locale.

    EDIT: You can actually view the precursor to this by going here: http://dandelionflowershop.com/index.php/website/cart

    Keep in mind that you need $40 in your cart before delivery options become available.

  • #2 / Dec 20, 2013 12:41am

    Rob Allen

    3108 posts

    You could try adding the save_customer_info tag inside the cart form tag (or inside the update_cart_form tag) to capture the zip code value, eg

    {exp:cartthrob:save_customer_info_form return="cart/checkout"}
    <label for="zip">Zip</label> 
    <select id="zip" name="shipping_zip">
    /* your matrix data*/
    </select>
    {/exp:cartthrob:save_customer_info_form}

    When submitted carthrob will save the shipping_zip value and pass it to the checkout.

    It’s worth adding CT’s debug tag to see what data the cart is holding, useful for debugging…

    {exp:cartthrob:debug_info}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases