- Posts: 2
- Thank you received: 0
Add multiple products in one click
11 years 9 months ago #182684
by K-lol
Add multiple products in one click was created by K-lol
Hi,
I do not know if I'm in the right place ..
Is it possible to add multiple products with a single click?
Here is my code.
It works only with the last link
I also tested with this code that works on prestashop
Thank you for your answer
I do not know if I'm in the right place ..
Is it possible to add multiple products with a single click?
Here is my code.
Code:
<a class="hikashop_html_add_to_cart_link" href="http://www.proeco.ch/ProEco/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=<?php
if (($nombre_douche <= $nombre_robinet) OR ($nombre_douche <= $nombre_robinet_cuisine)){
$nombre_pack = $nombre_douche;
echo $nombre_douche;
}else{
$nombre_pack = '0';
echo '0';
}
?>&checkout=1&product_id=46,http://www.proeco.ch/ProEco/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=<?php $cal_naxos = ($nombre_douche - $nombre_pack);
if ($cal_naxos <= '0'){
$cal_naxos_val = '0';
echo '0';
}else{
$cal_naxos_val = $cal_naxos;
echo $cal_naxos;} ?>&checkout=1&product_id=19,http://www.proeco.ch/ProEco/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=<?php $cal_air45 = ($nombre_robinet - $nombre_pack);
if ($cal_air45 <= '0'){
$cal_air45_val= '0';
echo '0';
}else{
$cal_air45_val = $cal_air45;
echo $cal_air45; } ?>&checkout=1&product_id=10,http://www.proeco.ch/ProEco/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=<?php $cal_air60 = ($nombre_robinet_cuisine - $nombre_pack);
if ($cal_air60 <= '0'){
$cal_air60_val = '0';
echo '0';
}else{
$cal_air60_val = $cal_air60;
echo $cal_air60;}?>&checkout=1&product_id=11" class="btn btn-primary btn-lg">Commander</a>
It works only with the last link
I also tested with this code that works on prestashop
Code:
...&quantity=1,3,2,5&product_id=11,13,15,16
Thank you for your answer
Please Log in or Create an account to join the conversation.
11 years 9 months ago #182693
by nicolas
Replied by nicolas on topic Add multiple products in one click
Hi,
You need to do like this:
where XXX is the id of a product and YYY its corresponding quantity. Same for AAA and BBB and you can repeat these parameters for other products.
You need to do like this:
Code:
<a class="hikashop_html_add_to_cart_link" href="http://www.proeco.ch/ProEco/index.php?option=com_hikashop&ctrl=product&task=updatecart&data[XXX][cart_product_quantity]=YYY&data[AAA][cart_product_quantity]=BBB&checkout=1" class="btn btn-primary btn-lg">Commander</a>
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds