Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2013
    Location
    Birmingham, UK
    Posts
    9
    Plugin Contributions
    0

    help question Runing Zen cart site in a folder

    Please can someone help me check the setup of our working site. We have a working site that is breaking when I try to install Square webpay.
    After asking on the threads for webpay I have been advised my problem is a more general setup issue and I should post it in the main area, so here goes, can anyone help please?

    Site originally setup in 2013, upgraded a few times now, working fine, SSL and site is in a subfolder.
    Minimal customisations, only a few addons (cookie control, google re-captcha, inventory report, minimum order, sales report, square webpay)
    No issues till I attempted to add Square webpay, apparently it is rather sensitive about how you configure things if you are running your site in a sub folder, now this hasn't caused any issues before, running in a folder is how I did it from the start but apparently I have not properly defined this in my configure files. I do not think I have made any significant changes to these files, so they are pretty much as installed other than turning on SSL a few years back.

    I retried with the update to the config files but it goes wrong. In the help files for Square Webpay it mentions properly defining in the config file the "DIR_WS_HTTPS_CATALOG constant", now apparently we haven't, so I made the change in both files (configure.php in both admin and store) - but only those two lines and it broke the site!
    the edits were:
    define('DIR_WS_CATALOG', '/JPV3/');
    define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
    (the store is in a folder called JPV3)

    I have now changed it back and its working fine. I was wondering if these are added to the https info and so maybe I just needed to reissue/renew the SSL cert?

    Site info:
    URL is https://www.j e r w o o d p h i l a t e l i c s .co.uk/
    ZC version 1.5.8a, working fine since, previously upgraded from 1.5.6 and before that 1.5.3 I think
    PHP 8.1
    Mysql 5.7
    hosted by Ionos (previously known as 1and1)

    I have tried to attach the edited config files but the attachment keeps being rejected for invalid file type, i have tried .php and .txt - what should it be so i can show the forum?

    It broke the storefront not the admin side. The storefront wound up looking like the attached image:
    Click image for larger version. 

Name:	Screenshot 2023-06-19 194050.jpg 
Views:	135 
Size:	47.6 KB 
ID:	20387

    Thank you in advance, George

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,314
    Plugin Contributions
    11

    Default Re: Runing Zen cart site in a folder

    Your configure.php can look one of two ways.

    My reccomendation is to have your host create a 301 redirect pointing YOUR_DOMAIN to YOUR_DOMAIN/CART_FOLDER. That's the best practice and will match the SSL That way, you will NOT need to make any changes to your two configure.php files and folks won't see the name of your cart folder.

    Right now, going to YOUR_DOMAIN/CART_FOLDER, the browser claims that the URL has just been registered and tells you that you need to go online to manage the site.

    BUT, if I go to YOUR_DOMAIN, I get the shopping cart.

    This is your chance to see if your host can do their stuff.

    vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Non-recommended Solution vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

    If your host cannot create a 301 redirect for you, you can change your configure.php files to accomplish the redirect in the slowest manner possible
    Code:
    /**
     * Enter the domain for your store
     * If you have SSL, enter the correct https address in BOTH the HTTP_SERVER and HTTPS_SERVER settings, instead of just an http address.
     */define('HTTP_SERVER', 'https://YOUR_DOMAIN);define('HTTPS_SERVER', 'https://YOUR_DOMAIN);/**
     * If you have https enabled on your website, set this to 'true'
     */define('ENABLE_SSL', 'true');/**
     * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
     * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
     * They should always start and end with a slash ... ie: '/' or '/foldername/'
     */define('DIR_WS_CATALOG', '/CART_FOLDER/');
     define('DIR_WS_HTTPS_CATALOG', '/CART_FOLDER/');
    Farther on in the config you would need to have:
    Code:
    /**
     * This is the complete physical path to your store's files.  eg: /var/www/vhost/accountname/public_html/store/
     * Should have a closing / on it.
     */
     define('DIR_FS_CATALOG', '/home/YOUR_USERNAME@HOST/public_html/CART_FOLDER/');

  3. #3
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,093
    Plugin Contributions
    58

    Default Re: Runing Zen cart site in a folder

    Morning,

    I do not find your store in a directory. It's displaying in the public root, no folder.
    IF your store is actually in a folder, the redirect is a good idea, but redirecting with .co.uk is tricky because it's technically a sub-domain. Make sure you test the redirect extensively. However, I do not see it in a folder.

    I also think you should check the setup your configure files is correct.

    Like so
    admin/includes/
    define('HTTP_SERVER', 'https://www.domain.co.uk');
    define('HTTP_SERVER', 'https://www.domain.co.uk');
    define('HTTPS_SERVER', 'https://www.domain.co.uk');
    Make sure to use the www based on your site's Google indexing.

    includes/
    define('HTTP_SERVER', 'https://www.domain.co.uk');
    define('HTTPS_SERVER', 'https://www.domain.co.uk');
    Make sure to use the www based on your site's Google indexing.

    admin/includes/
    define('ENABLE_SSL_CATALOG', 'true');

    includes/
    define('ENABLE_SSL', 'true');

    admin/includes/
    define('DIR_FS_CATALOG', '/home/full/path/to/store/with/trailing/');

    includes/
    define('DIR_FS_CATALOG', '/home/full/path/to/store/with/trailing/');

    admin/includes/
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    includes/
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  4. #4
    Join Date
    Jul 2013
    Location
    Birmingham, UK
    Posts
    9
    Plugin Contributions
    0

    Default Re: Runing Zen cart site in a folder

    Hi, huge thank you to dbltoe and mprough, I do appreciate your time/help. I am still puzzled though, sorry. I have told Ionos (formerly 1and1) to point to the folder where ZC is via the settings/options they have, please see the attached image, the Destination is my webspace (which i believe is referenced in the FS in the config) and the Target is the correct folder, is this the same as a 301 redirect or do i still need to do that? Please see image, hopefully it will make sense.

    I have also attached images of the two config files, editing out the specifics as per previous instructions (hopefully), i am hoping this makes it a little easier to see what is going on. I believe the FS values are set correctly, the WS part is the bit that breaks if i update it to reference the folder.

    The store definitely is in a folder, the folder does not ever show when a product is accessed, or added to the cart.

    Further advice based on my config files would be greatly appreciated, thank you in advance, George
    Click image for larger version. 

Name:	1and1 webspace.jpg 
Views:	29 
Size:	45.9 KB 
ID:	20390
    Click image for larger version. 

Name:	admin-includes-configure-section1.jpg 
Views:	37 
Size:	52.9 KB 
ID:	20391
    Click image for larger version. 

Name:	admin-includes-configure-section2.jpg 
Views:	30 
Size:	45.0 KB 
ID:	20392
    Click image for larger version. 

Name:	includes-configure.jpg 
Views:	29 
Size:	58.6 KB 
ID:	20393

  5. #5
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,093
    Plugin Contributions
    58

    Default Re: Runing Zen cart site in a folder

    admin/includes/
    define('DIR_WS_CATALOG', '/JPV3/');
    define('DIR_WS_HTTPS_CATALOG', '/JPV3/');

    includes/
    define('DIR_WS_CATALOG', '/JPV3/');
    define('DIR_WS_HTTPS_CATALOG', '/JPV3/');

    IF it is genuinely in a folder in the public root.


    Otherwise, if it's not...

    admin/includes/
    define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');

    includes/
    define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');

    I'm still not understanding why the redirect. The site is indexed without the folder. Was the store always in the folder? It just doesn't make any sense =(

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,914
    Plugin Contributions
    89

    Default Re: Runing Zen cart site in a folder

    Perhaps there's an .htaccess ReWrite to send root-directory accesses to that sub-directory.

  7. #7
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,093
    Plugin Contributions
    58

    Default Re: Runing Zen cart site in a folder

    Quote Originally Posted by lat9 View Post
    Perhaps there's an .htaccess ReWrite to send root-directory accesses to that sub-directory.
    Possibly.

    It broke the storefront not the admin side. The storefront wound up looking like the attached image:
    This statement implies to me that the configure files do not match.

    So if Lat is right and they configured your public root to be /JPV3/ then BOTH configure files would be like so.

    admin/includes/
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    admin/includes/
    define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');

    includes/
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    includes/
    define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');

    It would also mean that your issues with the Square plugin are not related to this. Also your SSL is fine, so that doesn't look to be the issue.

    Do you have the exact error message you received from the plugin?

    Can you contact your host and get the rundown of this folder? Specifically whether it's your public root or not.

    When you upgraded Zen Cart are you sure all of the files are upgraded?

    Are you using the stock Square plugin or Square Web pay plugin (https://www.zen-cart.com/downloads.p...file&id=2345)?

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

 

 

Similar Threads

  1. How to backup zen-cart folder but exclude the image folder?
    By alimtlai in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 6 Oct 2009, 11:14 PM
  2. Moving my Zen Cart folder
    By prefloor in forum General Questions
    Replies: 3
    Last Post: 22 Sep 2009, 08:00 PM
  3. Moving Zen Cart to my root folder
    By apotterdd in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 5 Sep 2008, 04:30 AM
  4. Zen not runing on MySQL older than 4.1?
    By Stellan in forum Installing on a Windows Server
    Replies: 2
    Last Post: 14 Mar 2007, 11:10 AM
  5. zen-cart folder
    By daniellekerese in forum General Questions
    Replies: 3
    Last Post: 18 May 2006, 12:35 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