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 to open Bulk Pricing modal from Quick View. #1483

Merged
merged 1 commit into from
May 6, 2019
Merged

Fix to open Bulk Pricing modal from Quick View. #1483

merged 1 commit into from
May 6, 2019

Conversation

Ubersmake
Copy link
Contributor

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:
before

After:
after

@bigbot
Copy link

bigbot commented Apr 22, 2019

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"
Copy link
Contributor Author

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}}>
Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@Ubersmake Ubersmake merged commit 4719dad into bigcommerce:master May 6, 2019
@Ubersmake Ubersmake deleted the STRF-6484 branch May 6, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants