From c7627b5267459b7c52330071dfb3f2e83217abc2 Mon Sep 17 00:00:00 2001 From: jordanarldt Date: Wed, 11 Jan 2023 12:42:08 -0600 Subject: [PATCH] feat(storefront): STRF-10309 Refactor Cornerstone for show_cart_action behavior --- CHANGELOG.md | 1 + templates/components/products/card.html | 30 ++++++++-------- templates/components/products/list-item.html | 28 +++++++-------- templates/pages/compare.html | 36 +++++++++----------- 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b56c2534..92a31685d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed en-CA translation warning in terminal. [#2278][https://github.com/bigcommerce/cornerstone/pull/2278] - Added manual captcha to Contact Us form for additional spam protection. [#2290](https://github.com/bigcommerce/cornerstone/pull/2290) - Fixed PDP not respecting "quantity box" display settings. [#2291](https://github.com/bigcommerce/cornerstone/pull/2291) +- Refactored `hide_price_from_guests` logic around `show_cart_action` use [#2304](https://github.com/bigcommerce/cornerstone/pull/2304) ## 6.7.0 (11-03-2022) - Fixed escaping on created store account confirm message. [#2265]https://github.com/bigcommerce/cornerstone/pull/2265 diff --git a/templates/components/products/card.html b/templates/components/products/card.html index ad86e2d1c6..59f49a277f 100644 --- a/templates/components/products/card.html +++ b/templates/components/products/card.html @@ -92,23 +92,21 @@ {{lang 'products.compare'}} {{/if}} - {{#or customer (unless settings.hide_price_from_guests)}} - {{#if show_cart_action}} - {{#if has_options}} - {{lang 'products.choose_options'}} - {{/if}} - {{#if pre_order}} - {{lang 'products.pre_order'}} - {{/if}} - {{#if add_to_cart_url }} - {{lang 'products.add_to_cart'}} - {{lang 'category.add_cart_announcement'}} - {{/if}} - {{#if out_of_stock_message }} - {{out_of_stock_message}} - {{/if}} + {{#if show_cart_action}} + {{#if has_options}} + {{lang 'products.choose_options'}} {{/if}} - {{/or}} + {{#if pre_order}} + {{lang 'products.pre_order'}} + {{/if}} + {{#if add_to_cart_url }} + {{lang 'products.add_to_cart'}} + {{lang 'category.add_cart_announcement'}} + {{/if}} + {{#if out_of_stock_message }} + {{out_of_stock_message}} + {{/if}} + {{/if}} diff --git a/templates/components/products/list-item.html b/templates/components/products/list-item.html index e08b71cd99..6c04eb6b5d 100644 --- a/templates/components/products/list-item.html +++ b/templates/components/products/list-item.html @@ -95,23 +95,23 @@

{{#if price}}
{{> components/products/price price=price}}
{{/if}} - {{#if show_cart_action}} - {{#if has_options}} - {{lang 'products.choose_options'}} - {{/if}} - {{#if pre_order}} - {{lang 'products.pre_order'}} - {{/if}} - {{#if add_to_cart_url }} - {{lang 'products.add_to_cart'}} - {{/if}} - {{#if out_of_stock_message }} - {{out_of_stock_message}} - {{/if}} - {{/if}} {{else}} {{> components/common/login-for-pricing}} {{/or}} + {{#if show_cart_action}} + {{#if has_options}} + {{lang 'products.choose_options'}} + {{/if}} + {{#if pre_order}} + {{lang 'products.pre_order'}} + {{/if}} + {{#if add_to_cart_url }} + {{lang 'products.add_to_cart'}} + {{/if}} + {{#if out_of_stock_message }} + {{out_of_stock_message}} + {{/if}} + {{/if}} {{#if show_compare}}