Jump to content

Basket not emptied after placing an order


Guest

Recommended Posts

Hi,

Running V3.04 (can't upgrade as I have had to do some serious hacking of the code, and it would be too time consuming). When I have placed an order, the basket is not being emptied properly. E.g.

First order:

- Order 3 products and pay in the normal way

- All details correct

Second order:

- Order 1 product, and pay. All emails and the order inventory show that products 2 and 3 from the first order are present in the basket BUT have not added to the cost - all prices/costs/taxes are correct, but the products are just appearing.

If I dump a print_r() of the $basket variable when in cart.inc.php, I get products from the previous order listed in $basket["invArray"]. I assume this should be emptied when an order is finished, but in which file should this happen and where?

Edit: If I go into the basket, nothing shows up. However, if I do the print_r() again, I get the list of products in the array. Clicking "Empty Basket" has no effect.

Cheers,

Matt

Link to comment
Share on other sites

Fixed! The following needed adding to /include/content/confirmed.inc.php:

Replace:

// empty basket & other session data

$basket = $cart->unsetVar("conts");

$basket = $cart->unsetVar("delInf");

$basket = $cart->unsetVar("cart_order_id");

$basket = $cart->unsetVar("shipCost");

$basket = $cart->unsetVar("subTotal");

$basket = $cart->unsetVar("tax");

$basket = $cart->unsetVar("shipCost");

$basket = $cart->unsetVar("grandTotal");

$basket = $cart->unsetVar("customer_comments");

$basket = $cart->unsetVar("counted");

$basket = $cart->unsetVar("shipMethod");




With:


// empty basket & other session data

$basket = $cart->unsetVar("conts");

$basket = $cart->unsetVar("delInf");

$basket = $cart->unsetVar("cart_order_id");

$basket = $cart->unsetVar("shipCost");

$basket = $cart->unsetVar("subTotal");

$basket = $cart->unsetVar("tax");

$basket = $cart->unsetVar("shipCost");

$basket = $cart->unsetVar("grandTotal");

$basket = $cart->unsetVar("customer_comments");

$basket = $cart->unsetVar("counted");

$basket = $cart->unsetVar("shipMethod");



//New lines

$basket = $cart->unsetVar("invArray");

$basket = $cart->unsetVar("shipKey");

$basket = $cart->unsetVar("gateway");

Matt

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 4 months later...
Guest katherinedenger

Just wondering what version of CubeCart this problem is related to. Does this issue have anything to do with these?

http://www.cubecart.org/forums/index.php?s...ic=1127&hl=

http://www.cubecart.org/forums/index.php?s...pic=293&hl=

I first noticed I was having a problem because I deleted an order from my admin, and three orders disappeared. I couldn't find anything at all in the forums about this problem but I was wondering if these other issues are related? I noticed when I buy and item in the cart and then log in as the same customer and order a different product, it gets the same order number, so the original order is replaced. And, I noticed the basket isn't empty when logged out, etc. Pretty much all of the things these 3 threads discuss.

I'm not really sure exactly what my problem is here, and also not sure what version other people are having problems with. Also, are these bugs? Or is cubecart supposed to work this way? Does anyone know if the newest version of cubecart has this problem?

By the way, I have version 3.0.11 with several mods installed, including the latest security patch. Thanks in advance to anyone who can help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...