Forums / Basic Configuration / Deriving (outputting, echoing) the current product URL? to create anchors

Deriving (outputting, echoing) the current product URL? to create anchors

Locked

Views: 1,657

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
22 Mar 2007, 3:38 PM
#1
creativearc avatar

creativearc

New Zenner

Join Date:
Feb 2007
Posts:
65
Plugin Contributions:
0

Deriving (outputting, echoing) the current product URL? to create anchors

Simply put, if I'm looking at this url:

index.php?main_page=product_info&cPath=74&products_id=319

Is there a built-in PHP variable (e.g. $product_url) or something similar that I can simply output?

The reason:

I have tabs that reference #blah.

If I simply code the link as < a href="#blah">, it directs the browser to the HOME PAGE rather than staying on the current item.

If I were to reference the current url, e.g. < a href="current_url#blah" > it works beautifully.

Any ideas?

Creative Arc - Minneapolis Web Design

22 Mar 2007, 4:37 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Deriving (outputting, echoing) the current product URL? to create anchors

Try something like this:```
<a href="<?php echo zen_href_link(FILENAME_PRODUCT_INFO, zen_get_all_get_params()); ?>#blah">

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.