I want to achieve a similar solution with all checkout activity going through a single checkout, as I don't currently have a wildcard SSL. I've tried doing the code change the user posted, but my session isn't actually carrying over between the two stores, so I though I have the products in the cart on one store, it's still coming up empty on the other store and will not allow checkout.
I have several domains;
domain1.com
domain2.com
domain3.com
All can be pointed to the same installation and display as individual shops with their own themes, but the shops have related products and my customer wants them to have a shared basket.
I know this can be done with subdomains (e.g. egg.domain1, ham.domain1.com, cheese.domain1.com) and tweaking the session.php and/or startup.php cookie declaration to include .domain1.com from earlier in this post.
But is there any way to accomplish similar using individual domains sharing the same session/cookie ? Or are we bordering on hacking in trying to achieve this ?
Is is possible to declare the session/cookie when lading on the site and then just GET the session when routing to the chosen store ?
Any help greatly appreciated...
“Reeling and Writhing, of course, to begin with, and then the different branches of arithmetic -- Ambition, Distraction, Uglification, and Derision." - The Mock Turtle
When a search is run from my second store (running as a sub domain) all the links on the returned page are to my main domain. Is this normal or have I missed something?
http://epos.mackandpear.com
For instance a £9.00 product comes out at €10.46 - you can't change this to a more marketing-friendly €10.50 for this product.
Looking directly at the database it appears this isn't an in-built feature - I'd expect to find various pricelist tables or some kind of matrix table like:
`product_price_to_currency_to_store`
(`store_id`, `currency_id`, `product_id`, `price`)
Our European office is pushing for a new website that has to be quick and easy to use (so that's Magento out) with a CMS that allows several stores to be maintained across several countries in several languages (Locales: de_DE, nl_NL, fr_BE, nl_BE, fr_FR and so on) with the ability to specify things like product prices and payment gateways on a per-store basis (we charge slightly different prices in different countries to cover the amount we subsidise our shipping costs by).
I was hoping OpenCart might help speed this process up somewhat, that I might be able to roll it out without too many major modifications ... am I wrong? (otherwise it's back to bespoke - I've looked at several systems and the only ones that come close are OpenCart and Magento).
Make sure you've added a trailing slash ( / ) in the Store URL setting for your second store, for instance "http://epos.mackandpear.com/" otherwise this happens it seems.mackandpear wrote:Hi
When a search is run from my second store (running as a sub domain) all the links on the returned page are to my main domain. Is this normal or have I missed something?
http://epos.mackandpear.com
OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English
Or maybe it can't..... ?barakka wrote: I know this can be done with subdomains (e.g. egg.domain1, ham.domain1.com, cheese.domain1.com) and tweaking the session.php and/or startup.php cookie declaration to include .domain1.com from earlier in this post.
Can someone clarify how to do this, I need;
monkey.domain.com
giraffe.domain.com
http://www.domain.com is the current shop and is pointed somewhere else (other hosting), once this is all working and loaded up with products it will replace the current setup.
I have purchased hosting for domain.com and installed OpenCart in the root web folder, then setup two shops monkey and giraffe, when I go to the domains above I get two shop fronts with the relevant products in each.
So how do I get them to share a cart/basket, i've set '.domain.com' in the session start in both system/phpstartup.php and system/library/session.php but it doesn't work.
I've searched all over but can't find anything saying how to do this ?
“Reeling and Writhing, of course, to begin with, and then the different branches of arithmetic -- Ambition, Distraction, Uglification, and Derision." - The Mock Turtle
I followed your instructions. The main page opens up with the proper subdomain. However when I go to a product or page that is supposed to be in the subdomain only the URL changes to my main domain and does not display the product or page that I wanted.
Does anyone know how to get in touch with the developers of OpenCart?
I think the trick to keep cart content and session data is session time, because both session.php and startup.php sets time = 0. You should change it like this:
before:
session_set_cookie_params(0, '/');
after:
session_set_cookie_params(3600, '/', '.mydomain.com');
This will change session time to one hour (3600sec), works only at the same browser, but for me this is pretty good.
I don't know anything about safety of this soultion so if anybody have please advice
I have a problem with multi-store. Account client, cart and checkout are separate.
Configuration :
Default : http://www.mydomain.com/dossier/ (not using, only for opencart)
Shop 1 : http://www.shop1.mydomain.com
Shop 2 : http://www.shop2.mydomain.com
Shop 3 : http://www.shop3.mydomain.com
I use this code : session_set_cookie_params(3600, '/', '.mydomain.com');
or this :
session.cookie_domain = ".mydomain" (in php.ini)
or that :
ini_set( "session.cookie_domain", ".mydomain.com" );
But nothing happens. Orders appears in all Shops. Cart (each shop keeps his cart in memory), Log in/Account : Not. Also, a visitor can log in 3 shops separatly. But, the account isn't keep in memory (we have to log in three times).
Any Idea ?
Thx
Code: Select all
$rootDomain = '.example.com';
session_set_cookie_params(
$currentCookieParams["lifetime"],
$currentCookieParams["path"],
$rootDomain,
$currentCookieParams["secure"],
$currentCookieParams["httponly"]
);
session_name('mysessionname');
session_start();
setcookie($cookieName, $cookieValue, time() + 3600, '/', $rootDomain);
?>
Code: Select all
ini_set( "session.cookie_domain", "http://www.domaine.com" ); );
The problem is weird... The customer has to authenticate on three stores. But, when he makes it, the cart is shared. A product buying in store 1 is kept in memory when customer authenticate on stores 2 and 3. In Other Hand, if we want to continue purchases after the authentification, products are not added on three shops (only the one who you buy the product). It is necessary to disconnect and to re-connect to have the new products in the cart. Any Idea ?
Without some serious "hacking" and possible security compromise, you won't be able to make basket from store 1 and basket from store 2 share over 2 different domain names.
However, in order to make 2 different subdomains share one cart, you need to delete the existing code and add the following to /system/library/session.php
Code: Select all
<?php
class Session {
public $data = array();
public function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
ini_set('session.cookie_domain', '.yourdomain.com');
session_set_cookie_params(0, '/');
session_start();
}
$this->data =& $_SESSION;
}
}
?>
Code: Select all
<?php
class Session {
public $data = array();
public function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
ini_set('session.cookie_domain', '.yourdomain1.com;.yourdomain2.com');
session_set_cookie_params(0, '/');
session_start();
}
$this->data =& $_SESSION;
}
}
?>
This would allow you to run something like:
clearance.yourdomain1.com and yourdomain1.com
usedproduct.yourdomain2.com and yourdomain2.com
all from one install and one admin.
This was all done in v1.5.2.1
I believe that if your current session.php looks like below, you'll be able to swap out for the code I've provided up above. I haven't worked with any versions other than this, so I'm not sure what that original session.php file looks like!
Code: Select all
<?php
class Session {
public $data = array();
public function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(0, '/');
session_start();
}
$this->data =& $_SESSION;
}
}
?>
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
customers can add the items to cart, when the click to checkout page there will be nothing because the items do not shows in cart at domain1.com.
I configure config as follows:
http server: http://domain2.com
https server: https://domain1.com
please advice, how can I fix this issue?
(both of domains focused to same directories.)
Are you hosting on a windows or Linux server? If you're using cPanel, you can only install an SSL certIficate for one domain. Others will allow you too use a SANS multi domain certificate.yenidem wrote:I have problem like this issue; I have SSL certificate for domain1.com, but I want to use domain2.com. The default domain name will be domain2.com
customers can add the items to cart, when the click to checkout page there will be nothing because the items do not shows in cart at domain1.com.
I configure config as follows:
http server: http://domain2.com
https server: https://domain1.com
please advice, how can I fix this issue?
(both of domains focused to same directories.)
DL
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
DL
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
Users browsing this forum: No registered users and 73 guests