I am using the update_cart_form nested inside the cart_items_info tag, to allow customers to edit the size or quantity of their item (as well as delete it from cart). I cannot find a way to have the item option they selected as the selected option in the (for example, if Medium is selected under the product_size, display that as the selected option)

I would also like to replicate this for displaying their currently chosen shipping method. Here is the code I currently am using:

    {if no_results}
        <p>You have nothing in your cart. <a class="blue" href="/shop">GO SHOP &raquo;</a></p>
    {if total_items > 0}
        {if first_row}
             {exp:cartthrob:update_cart_form  return="checkout" class="cart_form"}
                <ul class="cart-table">
                    {if product_detail_image}
                        <img src="{product_detail_image:feed}"/>
                        <img src="{site_url}content/img/ride.png"/>
                    <li><p>{title} <span>Quantity: <input type="text" name="quantity[{row_id}]" size="1" maxlength="2" value="{quantity}" /></span></p>
                        <p>{exp:cartthrob:item_options entry_id="{entry_id}" }
                        {if dynamic}
                            {if options_exist}
                                    <option {selected} value="{option_value}">
                                    {option_name}{if option_price_numeric > 0} +{option_price}{/if}
                        <span><input type="checkbox" name="delete[{row_id}]"> Delete this item</span></p>
            {if last_row}
                <select name="shipping_option">
                                <option value="{rate_short_name}" {selected}>{rate_title} - {rate_price}</option>
                <input type="submit" value="Update Cart" />

1 Answer 1


Instead of using:

<option {selected} value="{option_value}">


<option {if selected}selected{/if} value="{option_value}">

Also, add the row_id parameter to your {exp:cartthrob:item_options} tag.

{exp:cartthrob:item_options row_id="{row_id}"}
  • Unfortunately that didn't work. I added an XL shirt to the cart and viewed the checkout page, but the select dropdown still shows Medium (the default first option) as the selected option, and none of the options have a selected attribute for some reason. It works on my shipping dropdown, but not my item_options dropdown. Is there something maybe in the way I'm rendering it that isn't working? I can output the selected option by my product title if I use {title}, {item_options:product_size} - {item_options:product_size:price}
    – Alexa L
    May 14, 2013 at 18:03
  • I updated my answer for you. Give that a shot. May 14, 2013 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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