Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Calling the current product page url with php

Calling the current product page url with php

Views: 4,101

Results 21 to 25 of 25
16 Dec 2011, 3:02 AM
#21
skidude avatar

skidude

New Zenner

Join Date:
Dec 2011
Posts:
7
Plugin Contributions:
0

Calling the current product page url with php

I figured I messed up something so I created a fresh install and tested it. The screen captures were from a site that was 5 minutes old. It had one post.

Can I PM you the link to the site?

16 Dec 2011, 3:36 AM
#22
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Calling the current product page url with php

Yes, you can

16 Dec 2011, 3:59 AM
#23
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Calling the current product page url with php

OK, although this code works in the product description in admin under Preview it does not work on the live page. It defaults to the index and not up the page.

I will have to think about why and get back to you.

16 Dec 2011, 4:57 AM
#24
drbyte avatar

drbyte

Sensei

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

Re: Calling the current product page url with php

You'll see, as is discussed in the many other threads on setting up anchors, that you do indeed need to specify the complete URL.

So, if this is something that you expect to do often and the actual anchor point is in the same spot on every page (ie: top of description is the most common place people think they need to put it) and your clickable link to take you back to that anchor is also always in the same spot (ie: bottom of description, usually for the same reason), then you can easily put that into your TEMPLATE instead of trying to be inserting custom HTML and PHP into your product descriptions needlessly.

It would really help if you were to explain the business reason behind why you're even trying to do all this, instead of just bashing at a pre-determined end solution that's not working for you.

16 Dec 2011, 2:52 PM
#25
skidude avatar

skidude

New Zenner

Join Date:
Dec 2011
Posts:
7
Plugin Contributions:
0

Re: Calling the current product page url with php

DrByte:

You'll see, as is discussed in the many other threads on setting up anchors, that you do indeed need to specify the complete URL.

....
It would really help if you were to explain the business reason behind why you're even trying to do all this, instead of just bashing at a pre-determined end solution that's not working for you.

I'm trying to create product pages with lots of information on them. If you printed them they would be 3 to 5 pages long. I'd like to put a bullet list at the top with links to important sections of the document.

I saw those other pages mentioning the problem with anchors. I kept seeing posts saying to use standard anchors and other people suggesting PHP code. I couldn't get either method to work. I was hoping there was a more elegant way than entering the entire URL.