Forum Moderators: buckworks

Message Too Old, No Replies

Oscommerce - Save Cart on Logout

It is dafult but not working

         

anisrehan

11:36 am on Mar 30, 2009 (gmt 0)

10+ Year Member



I am having a good trouble, I have customized my site and added alot of contributions (around 20-25), and now when a customer logs out this message is displayed

"Your shopping cart has been saved, the items inside it will be restored whenever you log back into your account."

the problem is, when the customers logs in back, nothing from the previous session remains.

I think it's default feature of OsCommerce, and cannot find any contribution for it.

ytswy

12:06 pm on Mar 30, 2009 (gmt 0)

10+ Year Member



It's certainly a default feature in oscommerce. As far as I can follow it an object $cart of class shopping_cart is declared in catalogue/includes/application_top.php
The shopping_cart class is declared in catalogue/includes/classes/shopping_cart.php

The restoring seems to be done by 1 line in catalogue/login.php:
$cart->restore_contents();
this comes in this block of code:


..
..
..
tep_session_register('customer_zone_id');

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

// restore cart contents
$cart->restore_contents();

if (sizeof($navigation->snapshot) > 0) {
..
..
..


Hopefully you've just managed to edit out that line :)

anisrehan

11:09 am on Mar 31, 2009 (gmt 0)

10+ Year Member



Thanks for the reply,
Let me check it, if it works

card_demon

12:07 am on Apr 8, 2009 (gmt 0)

10+ Year Member



The new osCommrce Project might be able to help with complex issues like this interactions between mods.

(Since the original project is basically killed by Harald Ponce Deleon alientating all of the key developers they are all here now):

[forums.oscommerceproject.org...]

goldstrikn

11:56 pm on Apr 11, 2009 (gmt 0)

10+ Year Member



Hello ytswy. How do I change this code? I'm trying to get this to work, but I don't know what to change/update or add. Any solutions are greatly welcomed. Thanks for your time.

ytswy

11:54 am on Apr 14, 2009 (gmt 0)

10+ Year Member



Hi goldstrikn,

The code I quoted is from the shopping_cart.php file, which is immediately inside the main directory (called catalog by default - 'scuse UK spelling in my previous post).

If you can't find the particular lines I quoted I'd download a clean copy and have a look for them there - if they are missing from your copy then you would be having a cart recreation problem I would think!

The actual gubins of the cart recreation is defined inside:
/catalog/includes/classes/shopping_cart.php
since it is a method of the shopping_cart class - I doubt you want to mess around with that.

Does that answer your question? I'm not sure if that is what you were asking, if not let me know and I'll help if I can.