1

I am sorry to ask again here, but facing a deadline and I am at the beginning of panic. And this is my first site with Cartthrob. I cannot get my head behind how to add additional info at an order before checkout.

What I want: The customers might choose another delivery address. When so, they pay no shipping costs.

Solution: Let them add the information to a field in the order channel, on submit return segment_3 = delevery or = pick-up. Set in the checkout form this conditional:

{if segment_3 == "pickup"}
    {set_shipping_plugin value="single_flat_rate"}
{if:else}
    {set_shipping_plugin value="by_quantity_threshold"}
{/if}

I made in the order channel a new field, called nieuw_bezorgadres. I pull information from a Profile:edit channel, showing the addresses as options, code like this:

<select name="nieuw_bezorgadres">
{exp:channel:entries channel="member_profiles" category="8"}
<option value="{member_company} {member_address} {member_city} {member_country}">{member_company} {member_address} {member_city} {member_country}</option>
{/exp:channel:entries}
</select>

Problem: But how can I save the information in the order channel for the current transaction?

Thanks a lot for looking at this, it must be simple, that is why I run in circles.....

3
  • I don't understand what you mean in the what I want part "The customers might choose another delivery address. When so, they pay no shipping costs." Do you mean any other address? Or a certain address? This doesn't make sense to me. You are NOT talking about something like a pick-up option, right?
    – Marc
    Oct 27 '13 at 19:00
  • This is the wish of the client. He sells to consumers as well as shop-owners. A consumer may wish to have the purchase delivered at a shop. And pick it up there. So, yes, a pick-up address, wih no shipping costs. I must present a list of pick-up addresses, the customer chooses one, these data must be stored in the order channel as additional info in the chart.
    – Hansl
    Oct 27 '13 at 22:52
  • 1
    What is happening when you put an order through? I take it nothing is being saved? Have you tested with a plain text input to see if the select is the issue? Finally, I take it the select is in a checkout_form and not an update_cart_form? There are different methods for both. cartthrob.com/docs/tutorials/…
    – T2theC
    Oct 28 '13 at 21:28
1

Make sure your Select is inside the checkout_form tag like this:

{exp:cartthrob:checkout_form}
    <select name="nieuw_bezorgadres">
        {exp:channel:entries channel="member_profiles" category="8"}
            <option value="{member_company} {member_address} {member_city} {member_country}">{member_company} {member_address} {member_city} {member_country}</option>
        {/exp:channel:entries}
    </select>
{/exp:cartthrob:checkout_form}

Then, try renaming the select field to name="custom_data[nieuw_bezorgadres]". I used that for custom order data on a much earlier CartThrob site... not sure if it will work with your version. To print out the variable in the template or the email use {custom_data:nieuw_bezorgadres}.

1
  • Thank you. Your answer gave me more insight in how Cartthrob works, that helped me later also.
    – Hansl
    Jan 7 '14 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.