Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Moving from live server to localhost issues part 2

    So I have my site backed up to gitlab.com

    I ssh into my server and pull

    I git bash into my local and pull/push

    ...issue I'm having... w/ hardcoded links to admin from catalog side.... a href"=http://www.mysite.com/etc" to "http://localhost"

    Is there an easy way change the paths w/ a DIR_ constant or something like that?

    Thanks for your help in advance,
    b

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Moving from live server to localhost issues part 2

    Well, don't use hard-coded links to reference material on your own site is the first thing. All links should either be entered as relative to the current location or via the Zen Cart php function zen_href_link found in includes/functions/html_output.php.

    The base link is provided in the typical <head></head> area of the page. Whatever needs to be reached from that point is the hard-coded link necessary. So to reach the etc folder: <a href="etc"
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Moving from live server to localhost issues part 2

    Quote Originally Posted by wolfderby View Post
    ...issue I'm having... w/ hardcoded links to admin from catalog side.... a href"=http://www.mysite.com/etc" to "http://localhost"

    Is there an easy way change the paths w/ a DIR_ constant or something like that?
    No. The non-admin side has zero visibility into where the actual admin directory is.

    You can use your browser bookmarks/favorites for that.
    .

    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.

  4. #4
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Moving from live server to localhost issues part 2

    Quote Originally Posted by DrByte View Post
    No. The non-admin side has zero visibility into where the actual admin directory is.

    You can use your browser bookmarks/favorites for that.

    Is there a secure way to link to the admin from the front end? I'm trying to add some custom admin functionality to the front-end catalog side. I have it hidden both within a ip address and browser COOKIE.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Moving from live server to localhost issues part 2

    Again, the front-end knows nothing of the admin.

    If you want to add an Admin link onto your front-end somewhere, and since YOU do already know the URL of your Admin, just code it directly into your template wherever you want it to be displayed.
    .

    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.

  6. #6
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Moving from live server to localhost issues part 2

    Quote Originally Posted by DrByte View Post
    Again, the front-end knows nothing of the admin.

    If you want to add an Admin link onto your front-end somewhere, and since YOU do already know the URL of your Admin, just code it directly into your template wherever you want it to be displayed.
    Ok thanks, maybe one day I can do something fancier to make it more secure. I'm creating an if no image file, upload file/camera button on the front end. Goal is to swipe through products w/ hammerjs, jquery toggle stock status (if I don't actually have the product), if I do, upload photos w/ auto deletion of background/masking from front end (maybe imagemagick lib?) (w/ automatic naming of the picture from the product model sku (adding .jpg).

    Should make for a super user friendly app like website.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Moving from live server to localhost issues part 2

    What though is the need for the catalog to reach the admin? Meaning, what is in the admin side that can't be performed/done from the catalog side to achieve whatever it is that is desired? From this latest description, I don't see anything that requires the admin side...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Moving from live server to localhost issues part 2

    Quote Originally Posted by wolfderby View Post
    I'm creating an if no image file, upload file/camera button on the front end. Goal is to swipe through products w/ hammerjs, jquery toggle stock status (if I don't actually have the product), if I do, upload photos w/ auto deletion of background/masking from front end (maybe imagemagick lib?) (w/ automatic naming of the picture from the product model sku (adding .jpg).

    Should make for a super user friendly app like website.
    You could build all that with an admin-side page too. No need for doing it on the non-admin front-end at all.
    .

    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.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,683
    Plugin Contributions
    123

    Default Re: Moving from live server to localhost issues part 2

    MC's earlier point
    > Well, don't use hard-coded links to reference material on your own site is the first thing.

    deserves emphasis. But using only relative URLs, you will allow yourself to easily move the cart, set up test sites, change the domain name, etc.

    This is discussed in the doc here:
    https://docs.zen-cart.com/user/first...relative_urls/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Moving from live server to localhost issues
    By wolfderby in forum Code Collaboration
    Replies: 5
    Last Post: 19 Jul 2020, 04:57 PM
  2. Replies: 9
    Last Post: 6 Jul 2016, 07:45 PM
  3. moving from localhost to live
    By yamadan in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2010, 07:37 AM
  4. Moving from test folder to live folder on web server?
    By Gewehr 43 in forum General Questions
    Replies: 13
    Last Post: 4 Jun 2009, 10:12 PM
  5. Moving from testing server to "live" need help w/database
    By webwiz in forum General Questions
    Replies: 2
    Last Post: 16 May 2006, 02:34 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