Values in Custom Filed Dose not Reflects in Cart Page

Values in Custom Filed Dose not Reflects in Cart Page

amazezones
Explorer
82 0 13

Hello 

 

Below code will add two filed to a product page. once shopper enter value in these two filled these two values must reflect in cart page which is not happening. could anyone help. im using shells theme.

 
           <div class="wrapline">
          <p class="line-item-property__field ">
        <!--<label for="monogram1" class="label-required">Enter Plate Number (Max 5 Digits)</label>-->
            <div class="row{% if section.settings.layout == '1' %} justify-content-center justify-content-md-start{% endif %}">
            <input class="ep_inline_block plate_number_az" type="text" placeholder="Enter Plate Number (Max 5 Digits)" id="monogram1" style="width:285px; max-width:100%;" name="properties[Plate Number]" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" pattern="\d{1}" maxlength="5" required></div>
<!--<label for="monogram">Enter Code</label>-->
            <div class="row{% if section.settings.layout == '1' %} justify-content-center justify-content-md-start{% endif %} mb-20">
            <input class="ep_inline_block code_number_az" type="text" placeholder="Enter Code" id="monogram" style="width:130px; max-width:100%;" name="properties[Code]" oninput="this.value = this.value.replace(/[^0-9,A-Z,a-z.]/g, '').replace(/(\..*?)\..*/g, '$1');" pattern="\d{1}" maxlength="2" required></div>                
           </div>
Replies 4 (4)

Sweet_Savior_3
Shopify Partner
1337 102 138

Hello @amazezones 

 

Please add below code within the {%- for item in cart.items -%} loop in cart.liquid or main-cart.liquid or cart-template.liquid or main-cart-items.liquid file.

{%- for property in item.properties -%}
                            {%- assign property_first_char = property.first | slice: 0 -%}
                            {%- if property.last != blank and property_first_char != '_' -%}
                              <div class="product-option">
                                <dt>{{ property.first }}:</dt>
                                <dd>
                                  {%- if property.last contains '/uploads/' -%}
                                    <a href="{{ property.last }}" class="link" target="_blank">
                                      {{ property.last | split: '/' | last }}
                                    </a>
                                  {%- else -%}
                                    {{ property.last }}
                                  {%- endif -%}
                                </dd>
                              </div>
                            {%- endif -%}
                          {%- endfor -%}

 

If you have any issue with adding code raise an email.

 

Thanks

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!
amazezones
Explorer
82 0 13

hey, thx sweet_savior_3 for reply, but the code is not working

Sweet_Savior_3
Shopify Partner
1337 102 138

Hello @amazezones 

 

Is it possible to check the code from my end? Can you provide me the access for code editor? If yes do let me know in personal or via mail. So i can help you adding the code.

 

Thanks

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!

EasifyApps
Shopify Partner
635 19 47

Hi @amazezones,

You should check out the free Easify Product Options app to easily add custom text fields to your product pages – no coding required 🤗Below is an example:

  • Storefront:

EasifyApps_0-1706156467514.png

or:

EasifyApps_7-1706156615125.png

 

  • Simple settings:

EasifyApps_6-1706156543983.png

EasifyApps_2-1706156495621.png

EasifyApps_4-1706156514921.png

EasifyApps_5-1706156527515.png

EASIFY - MAKING SHOPIFY SIMPLE & SWEET!
Easify Product Options: Create custom product options 10X faster & easier!
Easify Product Attachments: Effortlessly add downloadable PDF files (or any other format) to Shopify pages!
Try for Free | 24/7 Live Chat Support