Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Buy Button Leads To Homepage When Clicked!

Buy Button Leads To Homepage When Clicked!

Locked

Views: 702

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
5 Jun 2009, 10:02 AM
#1
joomoo79 avatar

joomoo79

New Zenner

Join Date:
Feb 2009
Posts:
33
Plugin Contributions:
0

Buy Button Leads To Homepage When Clicked!

I have done a mod on tpl_product_info_display.php in order to have a text link instead of an image as the add_to_cart button.

Below is the piece of code that includes the form and php bits to make the button... For some reason, when you click "buy now" it leads back to the homepage...

What am I missing here? :unsure:

<div id="shoppingBar">

<!--bof Form start-->
<?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'enctype="multipart/form-data" id="cart_quantity"') . "\n"; ?>
<!--eof Form start-->

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
<?php
	$display_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']);
	if ($display_button != '') { ?>
    <div class="buyBtn">
    <?php
      echo $display_button;
    ?>
    </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
	</form>
<!--bof Form close-->
  
<div id="shoppingMainWrapper">

<div id="purchaseButton">
<a href="#" onclick="$('cart_quantity').submit();return false;"><?php echo ADD_TO_SHOPPING_CART;?></a>
</div>

<div id="price">
<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<!--eof Product Price block -->
</div>

</div>

</div>
5 Jun 2009, 12:14 PM
#2
joomoo79 avatar

joomoo79

New Zenner

Join Date:
Feb 2009
Posts:
33
Plugin Contributions:
0

Re: Buy Button Leads To Homepage When Clicked!

any idea?