From 8a36861dfda77c6608f1cbc7baa4e8a3a85119be Mon Sep 17 00:00:00 2001 From: Paul Morales Date: Mon, 22 Apr 2019 13:24:00 -0700 Subject: [PATCH] Fix to open Bulk Pricing modal from Quick View. --- CHANGELOG.md | 1 + assets/js/theme/product.js | 8 ++++++++ templates/components/products/bulk-discount-rates.html | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb9ea970e5..5af6cb24c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Draft +- Fix to open Bulk Pricing modal from Quick View. [#1483](https://github.com/bigcommerce/cornerstone/pull/1483) ## 3.4.2 (2019-04-30) - Remove deprecated "snippet" locations [#1479](https://github.com/bigcommerce/cornerstone/pull/1479) diff --git a/assets/js/theme/product.js b/assets/js/theme/product.js index 7c5162f450..054a70be8f 100644 --- a/assets/js/theme/product.js +++ b/assets/js/theme/product.js @@ -13,6 +13,7 @@ export default class Product extends PageManager { super(context); this.url = window.location.href; this.$reviewLink = $('[data-reveal-id="modal-review-form"]'); + this.$bulkPricingLink = $('[data-reveal-id="modal-bulk-pricing"]'); } onReady() { @@ -50,6 +51,7 @@ export default class Product extends PageManager { }); this.productReviewHandler(); + this.bulkPricingHandler(); } productReviewHandler() { @@ -57,4 +59,10 @@ export default class Product extends PageManager { this.$reviewLink.trigger('click'); } } + + bulkPricingHandler() { + if (this.url.indexOf('#bulk_pricing') !== -1) { + this.$bulkPricingLink.trigger('click'); + } + } } diff --git a/templates/components/products/bulk-discount-rates.html b/templates/components/products/bulk-discount-rates.html index 9c902cdf28..c22e03fcd1 100644 --- a/templates/components/products/bulk-discount-rates.html +++ b/templates/components/products/bulk-discount-rates.html @@ -1,12 +1,12 @@ {{#if bulk_discount_rates.length}} {{#if product}}
{{lang 'products.bulk_pricing.title'}}
{{/if}}
- + {{lang 'products.bulk_pricing.view'}}
-