Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default what is the php code to return the url of the current page?

    I'm trying to edit the products page so that there is a link under the product image to "See Additional Images" that links to an anchor down where the additional images are. I've tried making the link to #moreimages but instead of just moving down the page it loads the url of my site followed by the anchor and I don't know why... so I need to code it so that it fills in the url of the current page, then the anchor. But I am not a php programmer and I don't know the code. I know it will be
    PHP Code:
    <?php echo [something here],'#moreimages'?>
    or similar, but nothing I've tried has worked. Help?

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: what is the php code to return the url of the current page?

    Zencart has an automated, simple-to-use, and very sophisticated function to handle additional product images.

    LOTS of posts on this, and even a tutorial, I believe...
    20 years a Zencart User

  3. #3
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: what is the php code to return the url of the current page?

    I understand how Zen Cart handles additional product images. It's just that they're so far down the page that I'm worried some people might not know they are there, so I want to put a link under the main product image that draws the browser down the page to where the other images are.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: what is the php code to return the url of the current page?

    Or you could move the additional images up to just below the main image, for instance...

  5. #5
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: what is the php code to return the url of the current page?

    I don't' want to do that. It would get in the way of the product description.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: what is the php code to return the url of the current page?

    DrByte has given good explanations of how to use anchor links, including here and here (especially post 11).

  7. #7
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: what is the php code to return the url of the current page?

    What is the php code to return the url of the current page?

    PHP Code:
    <?php echo '<a href="'.zen_href_link($current_page."#moreimages").'">More Images</a>'?>
    Skip
    • 446F63746F722057686F •

  8. #8
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: what is the php code to return the url of the current page?

    Quote Originally Posted by gjh42 View Post
    DrByte has given good explanations of how to use anchor links, including here and here (especially post 11).
    Thanks, that second link had the answer I needed. This is the code that worked:


    Code:
    <a href="<?php echo zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('number_of_uploads')) ) . '#additional'; ?>">additional images</a>
    I guess for anchor links in my EZ pages I'm just going to have to suck it up and put in the relative url along with the anchor. Fortunately there are a much more limited number of EZ pages than there are products!

 

 

Similar Threads

  1. Replies: 3
    Last Post: 24 Oct 2012, 02:56 PM
  2. Replies: 1
    Last Post: 31 Aug 2012, 10:36 AM
  3. Calling the current product page url with php
    By pricediscrimination in forum Templates, Stylesheets, Page Layout
    Replies: 24
    Last Post: 16 Dec 2011, 03:52 PM
  4. how to get the value of current category with PHP code?
    By mybiz9999 in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 16 Feb 2011, 05:27 PM
  5. Replies: 2
    Last Post: 20 Jun 2008, 10:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR