Turning items in cart into a dropdown list to add to my gift box option

Highlighted
New Member
6 0 0

Hiya,

I'm adding a gift boxing option on my store and need some help with a dropdown menu id like to implement. When a product.tag handle of 'Gift Boxed' is added to cart a gift boxing section appears. This section will allow the user to select if they would like their items gift boxed and if they would like to add a card. The data that im capturing is Gift Box Name, Items in box, To, From, Card Category and message.

 

For the gift box section, id like the items that are added to cart with a product.tag handle 'Gift Boxed' to appear in a dropdown menu and for the user to be able to select up to 3 items. I am also looking to allow customers to create multiple gift boxes, there will be an option to create another gift box and if they do I would like it to repeat the same fields as above. Also making sure that if a product has been selected in one box it is no longer available in the others. Is anyone able to advise me on how to get the items in the cart with a tag into a drop-down list and/or how to set it up that its a template sturcture thats repeated and in the repeat prevent items that have already been selected?

0 Likes
Shopify Partner
1773 289 376

Hi @alfie24 

So you want to allow user to add more gift item from cart page from drop down menu and if one already added user cant added same product?

If so then you have to manage it by Js code. you have to check in cart item in order to check if product already added or not or you can check by Js to by getting current cart html.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
New Member
6 0 0

Yes, essentially I want to offer multiple gift boxes and for customers to choose which item they place into each. I'm using the Shopify ui elements generator which is collecting the information I need as additional information in the order which is great, I just need assistance in allowing customers to choose products to add to the gift box, and to click a button which creates a gift box 2 and asks the same information as gift box 1.

 

https://ui-elements-generator.myshopify.com/pages/cart-attribute

0 Likes
New Member
6 0 0

@Jasoliya please see above reply 

0 Likes
Shopify Partner
1773 289 376

Can you send me any reference so i  get exact idea.  

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
New Member
6 0 0

@Jasoliya  

<p class="cart-attribute__field">
  <label>Which items would you like inside?</label><br>
  <select required class="required" id="which-items-would-you-like-inside" name="attributes[Which items would you like inside?]">
    <option value="Product Name One"{% if cart.attributes["Which items would you like inside?"] == "Product Name One" %} selected{% endif %}>Product Name One</option>
    <option value="Product Name Two"{% if cart.attributes["Which items would you like inside?"] == "Product Name Two" %} selected{% endif %}>Product Name Two</option>
  </select>
</p>

This is an example of the dropdown I want to use. The values need to be the products that are in the cart, specifically the items that have the product.tag 'Gift Boxed'.

0 Likes