Cart attribute

Solved
Highlighted
New Member
11 0 0

Hi,

I need some help with cart attribute option on cart page.

In my store here - https://flowershopnz.myshopify.com/admin

I want to have these fields mandatory – Delivery Date. And Delivery Instruction as below. It is showing ok on the website but when I tested it the text customers put in the boxes don't come through to the order form.

imageimage

This is how and where I added the codes.

Screen Shot 2020-06-19 at 5.55.55 PM.png

It did show once here in the order form but it disappears.

Screen Shot 2020-06-19 at 5.57.18 PM.png

 

 

on my second test it came up like this

Cart_exist

true

Screen Shot 2020-06-19 at 5.58.30 PM.png

 

This is my coding

 <div class="cart__footer">
        <div class="grid">
          {%- if section.settings.cart_notes_enable -%}
            <div class="grid__item medium-up--one-half cart-note">
           <p class="cart-attribute__field">
  <label for="delivery-date">Delivery Date</label>
  <input id="delivery-date" type="text" name="attributes[Delivery Date]" value="{{ cart.attributes["Delivery Date"] }}">
</p> <p class="cart-attribute__field">
  <label for="delivery-instruction">Delivery Instruction</label>
  <input id="delivery-instruction" type="text" name="attributes[Delivery Instruction]" value="{{ cart.attributes["Delivery Instruction"] }}">
</p>
              <label for="CartSpecialInstructions" class="cart-note__label small--text-center">Complimentary Gift Card Message</label>
<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes="">{{ cart.note }}</textarea>
          </div>
          {%- endif -%}
          <div class="grid__item text-right small--text-center{% if section.settings.cart_notes_enable %} medium-up--one-half{% endif %}">
 
            {%- assign cartDiscounts = 'template ' | split: ' ' -%}
            {%- if cart.cart_level_discount_applications.size > 0 -%}
              {%- assign cartDiscounts = cart.cart_level_discount_applications -%}
            {%- endif -%}
            <div{% if cart.cart_level_discount_applications.size == 0 %} class="hide"{% endif %} data-cart-discount-wrapper>
              <div class="order-discount-card-wrapper" data-cart-discount>
                {%- for discount_application in cartDiscounts -%}
                  <span class="order-discount order-discount--title order-discount--cart">
                    {% include 'icon-saletag' %}<span class="visually-hidden">{{ 'customer.order.discount' | t }}:</span><span data-cart-discount-title>{{- discount_application.title -}}</span>
                  </span>
                  <span class="order-discount order-discount--cart order-discount--cart-total">
                    -<span data-cart-discount-amount>{{ discount_application.total_allocated_amount | money }}</span>
                  </span>
                {%- endfor -%}
              </div>
            </div>
 
 
Please let me know if you guys can help.
 
Thank you
 
0 Likes
Highlighted
Shopify Partner
2227 483 626

HI

please email me your theme zip file or staff account details because this a code customization work.

I will try to solve your problem.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
Shopify Partner
2227 483 626

Hey there,

As you shown in screenshots Order:1021  have delivery information and for the Order: 1024 , it's not showing.

These are different orders and maybe customer has entered delivery information in 1021 not with 1024.

As you said you need that both field required fields so you have to do code like following.

This is just an example:

<p class="cart-attribute__field">
  <label for="delivery-instructions">Delivery Instructions</label>
  <input required class="required" id="delivery-instructions" type="text" name="attributes[Delivery Instructions]" value="{{ cart.attributes["Delivery Instructions"] }}">
</p>

see above requried class and required rest seems fine. Please correct and let me know if it works.

If you need me to do that using your staff access then let me know. I have access.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
11 0 0

Hi,

Thanks for your reply.

both of the orders in the above post are my test orders and I did put in the details on both orders but it didn't come through on the second one.

It seems like it works for the first time but somehow it doesn't work anymore.

Can you help updating the code to make it required field?

 

I also want to add (No Sunday order) next to Delivery Date.

I really appreciate your help!

 

0 Likes
Highlighted
Shopify Partner
2227 483 626

Okay, I think it must be required fields. How can I test ?

Also Do you want me to work on shop directly via shop access that you have given ?

"No Sunday order" This just a text or a new field ?

 

Let me know.

 

Thanks!

 

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
11 0 0

Hi,

 
Thank you so much for your help.
 
Yes if you can work with the access I gave you that would be great.
 
I can enable test mode now until you are done.
 
You know you can put in test using 4242 4242 4242 4242 as a Visa card?
 
And yes No Sunday Order is a text I would like to include besides the Delivery Date. Actually I want to include 'No Sunday order except for Mother's day and Valentine's day' if possible.
 
Thank you so much!
0 Likes
Highlighted
Shopify Partner
56 9 11

Hi ecoWeb, 
Its pretty simple, 

Please make both fields required and make sure those are inside form tag.

Moreover make value as empty value="" | nothing between commas, 

And please test it. 

If helpful then please Like & Accept Solution. | Buy me a coffee
Customizing Store or upgrading with custom functionality - Hire Me

Feel free to contact me on rrrobin@yahoo.com regarding any help regarding
Shopify Customization | Automation of Tasks | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Functions into Shopify.
0 Likes
Highlighted
New Member
11 0 0

Thanks Robin but I'm not that skilled with this so I hope 

 

0 Likes
Highlighted
Shopify Partner
2227 483 626

Hey @ecoWeb ,

Sorry for delay. Sure I will check and fix this and put that text message and get back to you as soon as possible.

I will get back to you with update soon. I will access your shop and correct it.

 

Thanks again!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
11 0 0

Thank you so much.

 

I put the website in test mode so please let me know when it is done so I can put it back to normal mode.

 

Many thanks!

0 Likes