rotezecke wrote:has anyone found a way to synchronise sessions so i can use $_SESSION variables accross osCommerce and CMSms?
This is a separate topic from my CMSMS Shop Skin Helper, and should probably have it's own thread. However, since you have asked, I did write a plugin (circa 2009) for CMSMS that reads the cookie set by
osCommerce v2.2. It isn't perfect and that's why I've never released it.
osc_cookie plugin file attached.
How to use it:
You will need to open the plugin in your php editor of choice, and change lines 28 to 34 under the comment:
/* setup the links */
Then upload it to your CMSMS /plugins/ directory.
To find more instructions on how to use it; In the CMSMS Admin section click on Extenstions -> Tags -> osc_cookie
What it does:
It reads the osC v2.2 cookie and looks up the session information stored in the osCommerce database. You can get:
- get='customer_id'
will return the customer id if the customer is logged in. Othewise it will return 0 (zero).
- get='cart'
returns the number of items in the cart and the cost of those items as a string e.g. "4 Items ($49.95)"
- get='cart_qty'
returns the number of items in the cart e.g. "4"
this is one of the issues I was talking about above: sometimes the number of items in the cart returned isn't accurate. Didn't really care enough to track down the bug.
- get='cart_cost'
returns the cost of the items in the cart e.g. "49.95"
- get='login_link' will display a login or logout link based upon the users login state.
The license:
Might not be what you are looking for, but it's what I have. Also it's released under the GNU GPL v3 so do what you want with it. Add your own copyright above mine if you re-release it with your own changes.
This also means you could use it as a base to write a plugin that would read osC v3 cookies.
No support provided for this plugin:
Also I'm not going to provide support this plugin, unless someone want's to pay some cash money to have me do it.
I no longer install osCommerce for clients, but I do still support my clients that I haven't convinced to move on yet. It took the osC team 10+ years to release v3 after they announced it as "soon to be released". Guess I got tired of waiting

In their latest email the osC team said v3 is going to be a framework and not just an eCommerce platform, so watch for a complete CMS to be developed around it.