Echo current page path on opencart template page

Discussion in 'PHP' started by bellcom, Nov 22, 2014.

  1. #1
    I have an opencart page on the .tpl product template I have crated an anchor on the page and need to link to it.

    Would someone be able to give me some code that would echo the url of the current page so this would work on all my pages generated by this template?
    Something like this?
    <a href="PATH-TO-CURRENT-PAGE-HERE#tabs">View detailed descriptions of available options</a>

    Thanks!!
     
    bellcom, Nov 22, 2014 IP
  2. kutchbhi

    kutchbhi Active Member

    Messages:
    130
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    70
    #2
    <a href="<?php echo 'http://'. $_SERVER['HTTP_HOST']. $_SERVER['REQUEST_URI'];?>#tabs">View detailed descriptions of available options</a>
    Code (markup):
     
    kutchbhi, Nov 25, 2014 IP