Subdirectory Storefronts In 4.1.x?

This document from the Knowledge Base explains how to configure storefronts for CS-Cart Ultimate Edition 3.x. I am trying to configure multiple storefronts in CS-Cart 4.1.4. Do these instructions apply? I am trying to create multiple storefronts - 1 per subdirectory. The storefront initially appears to operate from the subdirectory, but all navigation leads to a 404. has anyone done this? I need some help.

thanks,

Glen

The V4 documentation should take you through it. Remember that Ultimate is the default in V4. Most of alternate storefronts come from the DB or the “stores” directory.

Thanks for the reply. Yes, I think I understand how V3 Ultimate translates to V4 CS-Cart (standard edition). I've just been unable to find documentation for V4 that describes storefront configuration when using a subdirectory. I have had success using an “addon domain” for additional storefronts, but I need to use subdirectories for this project.



-Glen

I think it you really want mystore.com and mystore.com/store2 then you're going to have to have sub-domains and use .htaccess to map things to the locations you want. Maybe you could describe the business problem you are trying to solve.

My client is a baseball league. They want a league store located at “leaguexyz.com” and individual team stores located at “leaguexyz.com/teamabc”. Each team store needs a unique store template and products. I still haven't gotten a solution from the helpdesk, but they seem to think this is possible.

So why not use sub-domains for the league? I.e. team1.league123.com, team2.league123.com etc. The physical location should NOT be mandatory. Using sub-domains allows you to ensure that the actual data is anywhere (it's actually in store/[store_number] on the site). So process would be to add a sub-domain in cpanel. Point it to the store root for league123.com and then configure the cart to add the new store.

Yes, the subdomain method is my fallback. I'm still pursuing this because I had made the promise to my client. CS-Cart helpdesk has yet to provide a solution but seems to believe it is possible.

The issue has been confirmed as a bug. CS-Cart support is investigating a fix.

Helpdesk has provided a fix:

In /app/functions/fn.ultimate.php, change:

} elseif (!empty($_SERVER['REQUEST_URI']) && preg_match("/^" . preg_quote($parsed_url['path'], '/') . "([\/\?].*?)?$/", $_SERVER['REQUEST_URI'], $m)) {
$priority = count(explode('/', $parsed_url['path']));


to:


} elseif (!empty($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $parsed_url['path']) === 0) {
$priority = count(explode('/', $parsed_url['path']));
$priority -= strlen(str_replace($parsed_url['path'], '', $_SERVER['REQUEST_URI']));


This is at about line 1600.

I'm guessing that this fix will be included in 4.1.5, but maybe this will help others in the meantime.

-Glen

Given 4.1.5 is already released, I would hope not… Unless it was known/reported before.

Oops - I meant 4.1.6.

Hello,



i try to configure a second frontend in version 4.1.5.

I have already create the subdomain point to “httpdocs” of my main domain that cscart installed.

I create from the admin the new store but my problem now is that when i am trying to open a product i get a message “error 404” url not found. What i make wrong?



Thanks in advance

[quote name='thanasisloi7' timestamp='1403629877' post='186355']

Hello,



i try to configure a second frontend in version 4.1.5.

I have already create the subdomain point to “httpdocs” of my main domain that cscart installed.

I create from the admin the new store but my problem now is that when i am trying to open a product i get a message “error 404” url not found. What i make wrong?



Thanks in advance

[/quote]



It sounds like you want to create a storefront at “subdmainXYX.mydomain.com”. If so, you don't need my code fix above. Did you create the subdomain in Cpanel?

-Glen

Very impressed. I gave up the last time I tried this a year or so ago.


[quote name='2020' timestamp='1401206081' post='184387']

Helpdesk has provided a fix:

In /app/functions/fn.ultimate.php, change line 1600.

I'm guessing that this fix will be included in 4.1.6, but maybe this will help others in the meantime.[/quote]