Jump to content

admin@iksi

Recommended Posts

Im working on booking site using prestashop 1.6.1.1

It has 4 age prices (adult, senior, kid, infant) and other expences - as seen in picture

post-1046522-0-10422600-1447210699_thumb.png

 

In table cart_product and cart.php there are 'quantity', 'quantity_adult', 'quantity_senior', 'quantity_kid', 'quantity_infant',
'quantity_other'

// Build query
$sql = new DbQuery();

// Build SELECT
$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity,
cp.`quantity_adult`,cp.`quantity_senior`, cp.`quantity_kid`, cp.`quantity_infant`, cp.`quantity_other`,
....

 

In front office and cartcontroller.php qty, qty_adult, qty_senior, qty_kid qty_infant, qty_other.

$this->qty = abs(Tools::getValue('qty_adult', 1)); is changed to

$this->qty_adult =abs(Tools::getValue('qty_adult',1));
$this->qty_senior =abs(Tools::getValue('qty_senior',1));
$this->qty_kid =abs(Tools::getValue('qty_kid',1));
$this->qty_infant =abs(Tools::getValue('qty_infant',1));
$this->qty_other =abs(Tools::getValue('qty_other',1));
$this->qty = $this->qty_adult + $this->qty_senior + $this->qty_kid + $this->qty_infant;

 

 

quantity should be adult+senior+kid+infant, quantity-other should be independent and can be ordered as many as wished as long there is at least one adult or senior, just like there needs to be at least one senior or adult to have kids or infants.

 

at the moment when saved it saves / adds to cart minimum quantity, nothing in error report and cant be deleted, it should save all quantities and person booking quantities,

 

all quantities need to be saved in one booking not each individually.

combinations and attributes can not be used

 

can someone help with at least in which files which functions need to be changed to do this?

if possible then for checkout too

Edited by admin@iksi (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...