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

Quantity discounts link doesn't open tab #1457

Closed
jasehead opened this issue Jan 17, 2017 · 5 comments

Comments

@jasehead
Copy link

commented Jan 17, 2017

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):
https://forums.cubecart.com/topic/50167-quantity-discounts-available-link-goes-nowhere/

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.

@abrookbanks

This comment has been minimized.

Copy link
Member

commented Jan 17, 2017

Thanks

@abrookbanks abrookbanks self-assigned this Jan 17, 2017
@abrookbanks abrookbanks added the bug label Jan 17, 2017
@abrookbanks abrookbanks added this to the 6.1.4 milestone Jan 17, 2017
@jasehead

This comment has been minimized.

Copy link
Author

commented Jan 17, 2017

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:

<p>(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p>
to
<p>({$LANG.catalogue.bulk_discount})</p>

and then change the catalogue.bulk_discount text from
Quantity discounts available
to
Quantity discounts - see below

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.

@abrookbanks

This comment has been minimized.

Copy link
Member

commented Jan 17, 2017

I was just coming to the same conclusion. Premature close.. I'll have a deeper look thanks.

@jasehead

This comment has been minimized.

Copy link
Author

commented Jan 24, 2017

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 <p id= or <section id= rather than <a href= so perhaps if the Quantity Discounts link in Cubecart targeted the content rather than the tab then deep linking would work better (one click, not two).

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:

<p>(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p>
to
<p>(<a href="#quantity_discounts_content">{$LANG.catalogue.bulk_discount}</a>)</p>

<dl class="tabs" data-tab data-options="scroll_to_content:false">
to
<dl class="tabs" data-tab data-options="deep_linking:true;scroll_to_content:false">

<p>{$LANG.catalogue.quantity_discounts_explained}</p>
to
<p id="quantity_discounts_content">{$LANG.catalogue.quantity_discounts_explained}</p>

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.

@jasehead

This comment has been minimized.

Copy link
Author

commented Jan 24, 2017

For reference, other workarounds for deep linking in Foundation. Something like this may work to bypass the stop on scroll_to_content:
https://www.adrikodde.nl/blog/2014/deeplinking-foundation-5-tabs
https://www.chaensel.de/foundation-6-tabs-by-url-anchor-link/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.