Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    Default 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?

    PHP Code:
    <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 == 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>

  2. #2
    Join Date
    Feb 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Buy Button Leads To Homepage When Clicked!

    any idea?

 

 

Similar Threads

  1. v139h nothing happens when checkout button is clicked
    By TaoArtGuy in forum General Questions
    Replies: 2
    Last Post: 15 Feb 2012, 09:53 PM
  2. Replies: 5
    Last Post: 19 Dec 2011, 05:45 PM
  3. Button changes size when clicked
    By Joseph M in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 May 2008, 03:05 AM
  4. Buy now button in homepage
    By wdh in forum Customization from the Admin
    Replies: 0
    Last Post: 11 Nov 2007, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg