Hi all, I'm new on zen-cart. I have many problems that I hope all of you can help me.
I have an issue as following:
If I have a products list on the left of shopping-cart and with each product, customer can add it to cart.
I will have to create a submit button named 'order now'.
It means I will must create an other form with action is 'add_product'.
This is my code:
<tr>
<td>
<form id="id_form" action="<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'action=add_product')?>" name="cart_quantity" method="POST">
print products list....
foreach ($leftmenus as $key => $value)
{
if ($value->indent == 1)
{
print '<tr><td class="ordernowradio" align="left"><input value="'.$value->id.'" type = "radio" name="products_id"><a href="' . $value->url . '" class="listproducts ">' . $value->desc . '</a></input></td></tr></br>';
}
else
{
print '<tr><td align="left" class="leftmenu"><a href="' . $value->url . '" class="selleftmenu">' . $value->desc . '</a></td></tr>';
}
}
.....
</form>
</td>
<td>
<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product'));?>
list all the products that customer selected.
</td>
<tr>
<td>
echo zen_inputimage_button(zen_imagename_button('<input type = "image" src ="../catalog/includes/templates/template_default/buttons/english/pady_b_ordernow0.gif" alt="Order Now" title = "Order Now" onclick="javascript:OrderButton();">',BUTTON_UPDATE_CART_ALT, '<input '), zen_imagemouse_action(BUTTON_IMAGE_ORDER_NOW_OVER,'BUTTON_ORDER_NOW_ALT')); ?>
</td>
<td> update cart button here...
</td>
</tr>
</form>
my javascript function:
function OrderButton()
{
var oForm = document.getElementById('id_form');
oForm.submit();
return ;
}
After click on order now button, I get $_POST['product_id'].
But I don't know why the product can't be added to cart.
I do wrong any thing?
Sorry about my English.
Please tell me what I must do?
Thank in advance!