Ultimate Coder Needed

[size=4]Hi everyone, [/size]

[size=4]I'm evaluating the trial version of CS-Cart Ultimate Edition.[/size]

[size=4]So far so good, but I need to know if someone can make a small modification to it.[/size]

[size=4]Basically, I have 2 storefronts. I have one user associated with store A, and at the same time I have the share user options enabled, so a user belonging to storefront A can login also to store B.

Now, the modification I need: When a user logins to a store that it's not the store to which he initially registered with, then he should be redirected to his original store.


USER A → Registered on STORE A

If he logins to STORE B, he must be redirected immediately to STORE A.[/size]

[size=4]There are no issues with loosing the cart information on the checkout login, because an user can only see and add products if they are loged in.[/size]



Just curious on the logic of why you would have a customer login on site B but redirect them to site A?

Our company holds two different accounts, one in Dollars and one in Euros (main currency). Our USD prices are a direct pricing, meaning that they're not based on a daily currency conversion, but on values reviewed every year. All the payments received in Euros goes directly into our bank account in Euros, and payments in USD goes to our account in USD.

We have been working only with Euros, using the CS-Cart community edition, but recently we got some request to buy our products in USD. Until now we have been treating USD dollars in separate, without any online support, and we want to offer our USD clients the same tools we have for the ones who don't care to pay in Euros.

I've tested the cs-cart professional, but the administrator backend was only able to show orders in only one currency, despite that prices were able to show in both currencies in the frontend. For that reason, I'm evaluating ultimate edition, but the problem with the logins it a stopper for us. We can see the orders reports per storefront which is great, but that login issue is stopping us to move forward. We would like to continue to use cs-cart because it's so easy to administrate, and because I haven't found another shopping system that we can host that can offer the same features as cs-cart.

We only want to continue to advertise our main store in euros, but allow the customers that request USD, to login into our main store, and be redirected to the USD store frontend. I heard some freelancers saying that it was possible, but as soon as they get redirected they need to login again! What's the point on that? Has anyone heard about user friendly?

We don't allow guest checkout, meaning that if someone wants to use our store, they will have to send us an email, and we will open an account for them. Guest users are not able to see prices also.

I hope that made it more clear. It may look like an unusual, but trust me, it makes perfect sense for us. If it was a software done in C++ I could do all the changes by myself in a couple of hours, but PHP? definitely not my area.

An idea that may solve your problem - You could add a page so that when you click “log-in” on either site it goes to this new page explaining that customers require an account and to E-Mail you for a requst for an account if they don't have one. It could then have the two options “I have a Euro acccount” or “I have a USD account” - each one taking you to the login of the relevant store. This way the customer only does the login once on the right store. This page could be generated in CS Cart using the website-content option or just a html file and a “login” link to it on both websites using the block manager (design-blocks).

How would I change the login link to point to that new page? Do I need to change the php/tpl files?

Depends on where you are showing your link currently and if you are using SEO Addon.

If using SEO Addon you could give the Log-in page its own filename by going to: Website - SEO rules and add a new rule with SEO name login.html and despatch value auth.login_form. This way any links you have to the login page will then be to login.html and this will show the standard CS Cart Login with this name login.html.

You can then create your own file called login.html and this new file will be served instead of the standard one. In this you have your explanation that an account is required, how to contact you if they don't have one and links “I have a USD account” or “I have a Euro account” are links to the CS Cart Login page of the relevant website using the full domain and path such as [url=“https://www.mysite.com/index.php?dispatch=auth.login_form&return_url=index.php”]https://www.mysite.com/index.php?dispatch=auth.login_form&return_url=index.php[/url]. You then have full design control over this page.

In your new links you are directly addressing index.php and the SEO name is not used (but all the links on your site will use the SEO name). You can set the return URL to where you want the customer to go after successful log-in - a good return URL in this instance may be the customers order history page (assuming that they want to see their orders and easily repeat order).

If not using SEO you could modify the links wherever you have them in the tpl file or use hooks to make the change. If for instance you are using the My Account block you could edit /skins/basic/customer/blocks/my_account.tpl (where “basic” is replaced with your active skin name).

You can easily find the relevant tpl file by going to design - design mode - Enable customization. There is then an option to view the storefront in design mode and it shows the structure of the tpl files and their location (starting from the active skin directory).

An alternative if not using SEO would be to remove anything with login links and create your own link to your new login page in the block manager (either as a html block or a banner). This way you can create whatever look you want for your “log-in” link on your site (although this would still show “Login” even when logged-in so you want to disable this block from pages that only show when you are logged-in).

In conclusion - the SEO route is probably the simplest if already using SEO and you are concerned about modifying tpl or using hooks (which will take a little more learning).

If not currently using SEO and you want to attract new website visitors (rather than limiting to existing account holders) you probably want to have SEO enabled anyway - it's free but needs setting-up - see Administration - Addons - SEO as this allows you to configure your category and product pages with search engine friendly URLs (as well as any other page by setting-up in Website - SEO rules).

Hope that helps.

Going back to the original problem - why do you need to share the users between stores if they can only have an account with one store? - You could disable this and make it clear on the login page that “This is the USD Store” - “If you have a Euro account click here” to take customers to the login of the other store. All the text in CS Cart is configurable in Admin - Languages. You are not just restricted to text in these language variables - you can insert html so can have links and change the layout of the text etc.

You can even change the login failed message by searching for the text in Admin - Languages. This way if login fails you could again state again that login was unsuccessful to the USD store, if you have a Euro account click here to go to the Euro store.

Lots of ways to skin the cat.