Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storefront): BCTHEME-1481 fix sales badges #2352

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Draft
- If the gift is a variant, the button "Change" shows in cart, and other variant are visible [#2349](https://github.com/bigcommerce/cornerstone/pull/2349)
- Fixed sales badge appearance and modified logic for sold-out badges [#2352](https://github.com/bigcommerce/cornerstone/pull/2352)
- Removes the URL encoding from the 'description' in the product rich snippet schema [#2350](https://github.com/bigcommerce/cornerstone/pull/2350)
- Running Lighthouse npm script fails in terminal [#2345](https://github.com/bigcommerce/cornerstone/pull/2345)
- Removed accelerated checkout integration [#2341](https://github.com/bigcommerce/cornerstone/pull/2341)
Expand Down
58 changes: 31 additions & 27 deletions templates/components/products/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,44 @@
}}
{{/if}}
{{/if}}
{{else if has_options '===' false}}
{{#and (if stock_level '===' null) show_cart_action}}
{{#and (unless add_to_cart_url) (unless pre_order)}}
{{#if theme_settings.pdp_sold_out_label '===' ''}}
{{else}}
{{#and (unless price.sale_price_with_tax.value) (unless price.sale_price_without_tax.value)}}
{{#and (if stock_level '===' null) show_cart_action}}
{{#and (unless add_to_cart_url) (unless pre_order)}}
{{#if has_options '===' false}}
{{#if theme_settings.pdp_sold_out_label '===' ''}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=(lang "page_builder.pdp_sold_out_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=theme_settings.pdp_sold_out_label
}}
{{/if}}
{{/if}}
{{/and}}
{{/and}}
{{else}}
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}}
{{#if theme_settings.pdp_sale_badge_label '===' ''}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=(lang "page_builder.pdp_sold_out_label")
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=(lang "page_builder.pdp_sale_badge_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=theme_settings.pdp_sold_out_label
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=theme_settings.pdp_sale_badge_label
}}
{{/if}}
{{/and}}
{{/or}}
{{/and}}
{{else}}
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}}
{{#if theme_settings.pdp_sale_badge_label '===' ''}}
{{> components/products/product-badge
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=(lang "page_builder.pdp_sale_badge_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=theme_settings.pdp_sale_badge_label
}}
{{/if}}
{{/or}}
{{/if}}

<a href="{{url}}"
Expand Down
58 changes: 31 additions & 27 deletions templates/components/products/list-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,44 @@
}}
{{/if}}
{{/if}}
{{else if has_options '===' false}}
{{#and (if stock_level '===' null) show_cart_action}}
{{#and (unless add_to_cart_url) (unless pre_order)}}
{{#if theme_settings.pdp_sold_out_label '===' ''}}
{{else}}
{{#and (unless price.sale_price_with_tax.value) (unless price.sale_price_without_tax.value)}}
{{#and (if stock_level '===' null) show_cart_action}}
{{#and (unless add_to_cart_url) (unless pre_order)}}
{{#if has_options '===' false}}
{{#if theme_settings.pdp_sold_out_label '===' ''}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=(lang "page_builder.pdp_sold_out_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=theme_settings.pdp_sold_out_label
}}
{{/if}}
{{/if}}
{{/and}}
{{/and}}
{{else}}
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}}
{{#if theme_settings.pdp_sale_badge_label '===' ''}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=(lang "page_builder.pdp_sold_out_label")
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=(lang "page_builder.pdp_sale_badge_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sold-out'
badge_view=theme_settings.product_sold_out_badges
badge_label=theme_settings.pdp_sold_out_label
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=theme_settings.pdp_sale_badge_label
}}
{{/if}}
{{/and}}
{{/or}}
{{/and}}
{{else}}
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}}
{{#if theme_settings.pdp_sale_badge_label '===' ''}}
{{> components/products/product-badge
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=(lang "page_builder.pdp_sale_badge_label")
}}
{{else}}
{{> components/products/product-badge
badge-type='sale'
badge_view=theme_settings.product_sale_badges
badge_label=theme_settings.pdp_sale_badge_label
}}
{{/if}}
{{/or}}
{{/if}}
{{> components/common/responsive-img
image=image
Expand Down