Post by superuser » Sun Dec 20, 2009 10:00 am

Dear All,

I'm thinking of allowing 1 product per order.

Thus, I wish to only add the last "add to chart" product to basket. I know there is a thread discussing on limiting the number of product in an order but that is not exactly what i want..


What I wish to get is:

Eg,

1. User chosen "Product A", "Product A" is added to the basket and proceed to shipping.
2. User continue to click on "Product B", "Product A" in basket will be removed and only "Product B" is shown in the basket.

Is this possible?

I have check the controller/checkout/cart.php and system/library/cart.php, but they are a bit complicated to me..

New member

Posts

Joined
Sat Dec 19, 2009 8:15 pm

Post by Qphoria » Sun Dec 20, 2009 1:53 pm

1. EDIT: catalog/controller/checkout/cart.php

2. FIND:

Code: Select all

if (isset($this->request->post['quantity'])) {
3. BEFORE, ADD:

Code: Select all

$this->cart->clear();

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by superuser » Sun Dec 20, 2009 2:02 pm

Qphoria wrote:1. EDIT: catalog/controller/checkout/cart.php

2. FIND:

Code: Select all

if (isset($this->request->post['quantity'])) {
3. BEFORE, ADD:

Code: Select all

$this->cart->clear();
Qphoria,

Thanks for being so helpful! :D

New member

Posts

Joined
Sat Dec 19, 2009 8:15 pm
Who is online

Users browsing this forum: No registered users and 13 guests