Post by awarren71 » Thu Jul 10, 2014 8:09 am

Hi, I have a client who sells a product in 5, 8 and 12 packs, and the shopper can actually select a different color for each of the items in the pack. I would prefer to use just one select drop down for the color option because there are over 75 colors.

My question is, once I've updated the product.tpl file so that the select drop down will actually allow me to select more than one value, how do I then pass these values to the cart? It will only take one value of those I've highlighted in my select drop down so I need to make further revisions to the code.

I'm assuming I have to further update this code from my product.tpl file:

Code: Select all

        <?php if ($option['type'] == 'select') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <select name="option[<?php echo $option['product_option_id']; ?>]" multiple="multiple">
            <option value=""><?php echo $text_select; ?></option>
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
            </option>
            <?php } ?>
          </select>
Thank you for any assistance with this - I am really only 25% a php coder and 75% a designer so this is a challenge for me. :ponder:

Amanda

User avatar
Newbie

Posts

Joined
Thu Jul 10, 2014 8:00 am
Location - Newfoundland, Canada

Post by sachin6609 » Thu Apr 06, 2017 5:51 pm

awarren71 wrote:
Thu Jul 10, 2014 8:09 am
Hi, I have a client who sells a product in 5, 8 and 12 packs, and the shopper can actually select a different color for each of the items in the pack. I would prefer to use just one select drop down for the color option because there are over 75 colors.

My question is, once I've updated the product.tpl file so that the select drop down will actually allow me to select more than one value, how do I then pass these values to the cart? It will only take one value of those I've highlighted in my select drop down so I need to make further revisions to the code.

I'm assuming I have to further update this code from my product.tpl file:

Code: Select all

        <?php if ($option['type'] == 'select') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <select name="option[<?php echo $option['product_option_id']; ?>]" multiple="multiple">
            <option value=""><?php echo $text_select; ?></option>
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
            </option>
            <?php } ?>
          </select>
Thank you for any assistance with this - I am really only 25% a php coder and 75% a designer so this is a challenge for me. :ponder:

Amanda
Hiii

In The Cart only one value can be display which is selected from the select dropdown

so if you need more then one color values in cart you need to add the checkbox

So when customer select more then one checkbox and add to cart the product so it will display all the checked item in the cart

Thanks

sachin

Active Member

Posts

Joined
Thu Jul 23, 2015 2:57 pm
Who is online

Users browsing this forum: Semrush [Bot] and 59 guests