-
Notifications
You must be signed in to change notification settings - Fork 613
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 to open Bulk Pricing modal from Quick View. #1483
Conversation
Autotagging @bigcommerce/storefront-team @davidchin |
@@ -1,12 +1,12 @@ | |||
{{#if bulk_discount_rates.length}} | |||
{{#if product}}<dt class="productView-info-name">{{lang 'products.bulk_pricing.title'}}</dt>{{/if}} | |||
<dd class="productView-info-value"> | |||
<a href="{{url}}" | |||
{{#unless is_ajax }}data-reveal-id="bulkPricingModal{{#if id}}-{{id}}-{{$index}}{{/if}}"{{/unless}}> | |||
<a href="{{product.url}}#bulk_pricing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure that the product URL is in the link, though it hasn't caused issues before. Follows the same convention as #write_review
<a href="{{url}}" | ||
{{#unless is_ajax }}data-reveal-id="bulkPricingModal{{#if id}}-{{id}}-{{$index}}{{/if}}"{{/unless}}> | ||
<a href="{{product.url}}#bulk_pricing" | ||
{{#unless is_ajax }}data-reveal-id="modal-bulk-pricing"{{/unless}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the id
identifier because this modal is only used here. Presumably this id is here in the case of collisions. Uses the modal-some-name
pattern used in modal-review-form
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 from a "minimum viable change" perspective, is this needed? Or did this just feel like good cleanup? I believe bulk discount rates can be rendered on PLPs with certain configurations of theme config in which case this might serve a purpose (collisions, as you mentioned)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It felt like cleanup. Reverting that change until I'm absolutely 100% sure it wouldn't affect anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong. product.url
is necessary. It makes no difference on the product details page, but it's necessary where multiple products are shown, like a category page. If it's just url
, the link won't actually go anywhere. It'll go to a nonexistent anchor on the same page.
What?
Currently, the Bulk Pricing link doesn't work from a Quick View modal. Clicking on the "Buy in bulk and save" link effectively closes the Quick View modal.
This PR replicates the behavior for Write a Review from Quick View. Now, clicking on the "Buy in bulk and save" link from Quick View will open the Product page and immediately open the Bulk Pricing modal.
Screenshots (if appropriate)
Before:
After: