Join GitHub today
Quantity discounts link doesn't open tab #1457
If a product has a discount for 2 or more set up then a (Quantity discounts available) link appears on the product page between the price and the Add to Basket button. Clicking on the link only scrolls to the Quantity Discounts tab if the tab has already been clicked by the user - so the action is redundant.
When the (Quantity discounts available) link is clicked, make the Quantity Discounts tab active and scroll to anchor.
Partial fix from bsmither suggested here (deep linking):
However, testing deep linking (in Safari) produced poor results - it takes two clicks to open and scroll to tab, and then content from the top of the page (up to the link) is cut off until you click another tab eg. Product Description.
Deep linking wasn't a good fix for this - tested but with bad results. What I did was delete the link in content.product.php around line 115 from:
and then change the catalogue.bulk_discount text from
If the link is there but doesn't work or it works in a bad way (current deep linking without further work is a bad user experience), then better to drop the link altogether.
I did some further digging on deep linking.
On the Foundation site http://foundation.zurb.com/sites/docs/v/5.5.3/components/tabs.html#deep-linking-to-tabs-or-tab-contents it says that linking to the tab will open the tab, but linking to the content will open the tab AND scroll to the content.
If you check the source code, you will see that those content links are done using
I tried the following changes to content.product.php BUT THERE WAS NO CHANGE - the Quantity Discount link still activated the tab on the first click, and scrolled to content on the second click:
Stumped. A workaround would be to script the Quantity Discount link to fire twice when it is clicked, but there remain other issues from deep linking (like no scroll access to top of page).
I suggest disabling the link to Quantity Discounts and putting a shortened version of the quantity discount (explanation + table) under the Add to Basket button to make it a more visible incentive - remove the tab altogether.
For reference, other workarounds for deep linking in Foundation. Something like this may work to bypass the stop on scroll_to_content: