Post by ahtisham454 » Wed Feb 08, 2012 7:00 pm

You were trying to use a relative anchor.
Last edited by ahtisham454 on Sat Jan 26, 2013 2:37 pm, edited 2 times in total.

Newbie

Posts

Joined
Wed Feb 08, 2012 6:30 pm

Post by storm-cloud » Wed Mar 14, 2012 10:29 pm

Has anyone been able to get anchors working on the pop up fancybox for the Terms and Conditions during checkout?

I tried adding the code below to the header and it corrected normal anchor usage but it made the links in the fancybox direct to the home page where previously at least they were linking to the correct anchor on the Terms and Conditions page.

Code: Select all

<!--START Anchor Redirect-->
<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>
<!--END Anchor Redirect-->
The problem I have with this is that if a customer clicks on a link within the pop up fancybox there is the chance that you may lose them and they abandon the cart.

If possible I would like to either somehow enable anchors in the fancybox or another method would be disable links completely within the Terms and Conditions fancybox. Any suggestions?

Edit: I actually found a solution that works to remove links on the fancybox (no more diverted and potentially lost customers). A little off track for the original thread but thought I would place it here in case it helps anyone.

In the file: catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css

Add this to the stylesheet...

Code: Select all

#fancybox-content a {
	display: none;
}
This also did not disable the next arrows for product images as they appear to be within a different class. Haven't found any negatives to doing this, unless anyone can suggest any?

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by MikeSCC » Thu Feb 21, 2013 6:15 pm

keclap wrote:I believe I've managed to solve this problem. Posting it here in case someone will need it someday :)

Link should be created this way:

Code: Select all

<a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#anchor">link</a>
Of course do not forget to set anchor somewhere in document:

Code: Select all

<a name="anchor">Jump here</a>
Thank you, this solved the issue for me.

Active Member

Posts

Joined
Tue Nov 20, 2012 5:55 pm
Who is online

Users browsing this forum: No registered users and 190 guests