Only show selected line items in cart page

Highlighted
Pathfinder
89 3 26

Hey,

 

I need to only show selected LIP's in the cart page as opposed to a readout of all the available options as is happening now. 

https://theworldreflected.com/cart

Need to add this item to the cart 1st

https://theworldreflected.com/products/river-etive-falls-framed-print?variant=31561922773064

 

Screenshot 2020-05-08 at 16.28.26.png

I would like to show the LIP's just as the variant options with the value label then the selected value.

 

I think it involves this from cart-template in sections

 

              {% if item.properties %}
                <p>
                  {% for p in item.properties %}
                    {% unless p.last == blank %}
                      {% if p.last contains '/uploads/' %}
                        {{ p.first }}: <a class="lightbox" href="{{ p.last }}">{{ 'cart.general.uploaded_file' | t }}</a><br />
                      {% else %}
                        {{ p.first }}: {{ p.last }}<br />
                      {% endif %}
                    {% endunless %}
                  {% endfor %}
                </p>
              {% endif %}

Thank you in advance for any advice

 

All the best

0 Likes
Highlighted
Trailblazer
193 25 47

Hi,

I have noticed that you have added the lot of line items on the product page. You need to remove line item from product page.

 

paypal.png

 

It is always set the first value in the line items.

 

Thanks

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: silencewebsolutions@gmail.com
0 Likes
Highlighted
Pathfinder
89 3 26

Hi 

 

Thank you for your message,

 

I only see this on that page as it should appear

3E4F8974-DC60-4622-A3DA-F40BD94569A3.png

 

The screenshot you sent seems to be an error?

Thank you

0 Likes
Highlighted
Trailblazer
193 25 47

Not the error, but all the line item are loading on product page, you can check through browser "Inspect Element". Need to remove all unnecessary data from product page.

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: silencewebsolutions@gmail.com
0 Likes
Highlighted
Shopify Partner
2471 128 405

@Outer_net Check DH email sent you a message to address a previous mistake

 

The excess LIP's are from product template submitting all the different variants that are enabled|checked so they get passed when the product is added to the cart

 

<input checked="checked" required="" class="hc-input required" type="radio" id="frame-colour-black-oak-31561922773064" name="properties[_Frame Colour-31561922773064]" value="Black Oak" data-img="//cdn.shopify.com/s/files/1/....">

 

If you view the page source you will see this multiple times for all the different variants.

 

You'll need to set it so that only the current selected variant is enabled|checked in the products variant loop.; typically using product.selected_variant, or product.selected_or_first_available_variant 

Using a logic check similar to the following:

{% if variant.id = product.selected_variant.id %}checked="checked"{%endif%}

 

You'll also need to find the variant update logic in javascript and update that to properly disable/enable the unselected/selected options.

 

After that if you want to hide all LIP's in the cart you will need to check if they have an underscore to skip them in the properties loop

{% assign first_character_in_key = p.first | truncate: 1, "" %}

{% unless p.last == blank or first_character_in_key == '_' %}

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes