I am trying to create a buy now feature so I have created another button on the product_info page. So now there are two submit buttons - the normal 'add to cart' button and my 'buy now' button.
After some testing however I am having difficulty in getting the next page to differentiate between the two buttons (which one was pressed). I have used techniques such as this:
in tpl_prod_info.php:
in tpl_shopping_cart_default.php:Code:<form name="testform" method="post" action="index.php?main_page=shopping_cart"> <input type="submit" name="button1" value="life"> <input type="submit" name="button2" value="Death"> </form>
.. which as a test works perfectly fine but when I apply it to the 'add to cart' and new 'buy now' buttons it doesn't. Here's what I tried amongst other things:PHP Code:if ($_POST['button1']) {
echo "button 1 was pressed";
}
if ($_POST['button2']) {
echo "button 2 was pressed";
}
in tpl_prod_info.php - the 'add to cart' button is already set and these are its properties:
in tpl_prod_info.php - here is the 'buy now' button:PHP Code:$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
in tpl_shopping_cart_default.php:PHP Code:$the_button2 = '<input type="hidden" name="cart_quantity2" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_BUY_NOW, BUTTON_IN_CART_ALT);
$display_button2 = zen_get_buy_now_button($_GET['products_id'], $the_button2);
I know that the buttons in the first example are significantly different - but does anyone know how I can do this or what I might be doing wrong??PHP Code:if ($_POST['cart_quantity']) {
echo "cart_quantity was pressed";
}
if ($_POST['cart_quantity2']) {
echo "cart_quantity 2 was pressed";
}
_thanks to all



