Shopify themes, liquid, logos, and UX
Hey there!
I would like to use the cart drawer instead of the cart page, but in the Focal theme, it is currently not possible to display the featured collection in the cart drawer (only available on the cart page).
Currently, the cart drawer can only have recommended products section. Code for the recommended product section:
{%- if section.settings.show_recommendations -%}
<cart-drawer-recommendations section-id="{{ section.id }}" product-id="{{ cart.items.first.product_id }}" class="mini-cart__recommendations">
{%- assign acceptable_recommendations_count = 0 -%}
{%- for product in recommendations.products -%}
{%- assign matching_product = cart.items | where: 'product_id', product.id | first -%}
{%- if matching_product == blank -%}
{%- assign acceptable_recommendations_count = acceptable_recommendations_count | plus: 1 -%}
{%- endif -%}
{%- endfor -%}
{%- if recommendations.performed -%}
{%- if acceptable_recommendations_count > 0 -%}
<div class="mini-cart__recommendations-inner">
{%- if section.settings.recommendations_title != blank -%}
<p class="mini-cart__recommendations-heading heading heading--small hidden-pocket">{{ section.settings.recommendations_title | escape }}</p>
<p class="mini-cart__recommendations-heading heading heading--xsmall text--subdued hidden-lap-and-up">{{ section.settings.recommendations_title | escape }}</p>
{%- endif -%}
<div class="scroller">
<div class="scroller__inner">
<div class="mini-cart__recommendations-list">
{%- assign shown_products_count = 0 -%}
{%- for product in recommendations.products -%}
{%- if shown_products_count >= 6 -%}
{%- break -%}
{%- endif -%}
{%- assign matching_product = cart.items | where: 'product_id', product.id -%}
{%- if matching_product.size == 0 -%}
{%- assign shown_products_count = shown_products_count | plus: 1 -%}
{%- render 'product-item', product: product, reduced_content: true, reduced_font_size: true, hide_secondary_image: true, sizes_attribute: '(max-width: 740px) 65px, 92px' -%}
{%- endif -%}
{%- endfor -%}
</div>
</div>
</div>
</div>
{%- endif -%}
{%- else -%}
<div class="mini-cart__recommendations-inner">
<div class="spinner">
{%- render 'icon' with 'spinner', stroke_width: 3, width: 40, height: 40 -%}
</div>
</div>
{%- endif -%}
</cart-drawer-recommendations>
{%- endif -%}
Would it be somehow possible to replace these recommended products with just a featured collection?
Any help on this is highly appreciated!
can you please share store url
Sent store link as dm
Hi there - looking to do the same - did you find a solution to this?
User | RANK |
---|---|
201 | |
169 | |
62 | |
51 | |
47 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023