- Posts: 15
- Thank you received: 0
Product Custom Fields and Add to Shopping Cart
The problem is in adding a second copy of the same product (second individual being registered for the same program) to the shopping cart. It is added as a separate item in the shopping cart which means that the volume discount pricing mechanism for the product no longer works. I suspect that this is because of the custom fields.
Is there any simple way to make this work as expected?
Please Log in or Create an account to join the conversation.
What kind of volume discount pricing are you using ? Coupons, discounts or prices with minimum quantities ?
Please Log in or Create an account to join the conversation.
Note that I do use the coupon mechanism for providing discounts based on previous volunteer work. That works as expected and as desired.
Please Log in or Create an account to join the conversation.
foreach($cart->products as $k => $row){
$currencyClass->quantityPrices($cart->products[$k]->prices,@$row->cart_product_quantity,$main_currency);
}
by:
$product_quantities = array();
foreach($cart->products as $row){
$product_quantities[$row->cart_product_id]+=(int)@$row->cart_product_quantity;
}
foreach($cart->products as $k => $row){
$currencyClass->quantityPrices($cart->products[$k]->prices,$product_quantities[$row->cart_product_id],$main_currency);
}
in the file administrator/components/com_hikashop/classes/cart.php ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
-
- person 1, person 2, person 3 - all individual details different: separate entries in cart with base price;
- person 1, person 2, person 3 - person 1 and 2 the same with person 3 different: two entries in cart with first entry reflecting price for ordering quantity of 2 and second entry reflecting free;
- person 1, person 2, person 3, person 4 - in order with person 1 and 3 the same and person 2 and 4 the same: two entries in cart with first entry reflecting price for ordering quantity of 2 and second entry reflecting free
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The product is set up with pricing as follows:
-
$117CDN with minimum qty of 0
$100CDN with minimum qty of 2
I have set up an FTP account. Can you give me an email address to which to send it to?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You need to edit the file components/com_hikashop/views/product/view.html.php and change the code:
foreach($rows as $k => $row){
$currencyClass->quantityPrices($rows[$k]->prices,@$row->cart_product_quantity,$main_currency);
}
to:
$product_quantities = array();
foreach($rows as $row){
if(empty($product_quantities[$row->cart_product_id])){
$product_quantities[$row->cart_product_id] = (int)@$row->cart_product_quantity;
}else{
$product_quantities[$row->cart_product_id]+=(int)@$row->cart_product_quantity;
}
}
foreach($rows as $k => $row){
$currencyClass->quantityPrices($rows[$k]->prices,$product_quantities[$row->cart_product_id],$main_currency);
}
I couldn't do it with your FTP access since yu only gave me access to the back end files of hikashop.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The problem is fixed now on your website and will be included in next version of HikaShop. There were a bit more modifications to do in other places so that it works properly.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.