News:

AbanteCart v1.4.2 is released.

Main Menu
support

How to insert anchor link?

Started by iron, May 10, 2016, 10:46:51 AM

Previous topic - Next topic

iron

Hello guys! I didn't find nothing about my problem here on this forum.

I'm trying to put anchor link on a Product page. Doing it as usual (Pic.1, Pic. 2). Saving the file.
In HTML/Text mode all tags are on their places. In Visual mode everything seems OK, but in Link menu the anchor not saved (Pic. 3). And on storefront page, if move mouse on link in list, link seems workable (Pic. 4), but click on any link opens the main page.
Absolutely have no idea how to fix it.

Basara

Hi.

To fix anchors your need to put full url in your href or add this code to the product pages
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery("a[ href ^= '#' ]").each(function() {
        var href = window.location + jQuery(this).attr('href').replace('/#.*/i','');
        jQuery(this).attr('href',href);
    });
});
</script>


It is very easy to add code via HTML block http://docs.abantecart.com/pages/design/blocks/html_block.html
Create HTML block with this code and add it to the Product page layout

iron

Thank you Basara! Block work great!

Forum Rules Code of conduct
AbanteCart.com 2010 -