Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Plugin Contributions
    0

    Default Add to Cart button does not work

    This is the code in the "tpl_product_info_display.php" file.
    Code:
    <?php
    /**
     * Page Template
     *
     * Loaded automatically by index.php?main_page=product_info.<br />
     * Displays details of a typical product
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_product_info_display.php 5369 2006-12-23 10:55:52Z drbyte $
     */
     //require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
     // Niroshan edited......
    ?>
    <div id="mid_top"></div>
    <div id="mid_bodypro">
    <div id="mid_body_toppro"></div>
    <div id="body_mid_bgpro">
    <div id="prepro">
    <!--bof Prev/Next top position -->
    <?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
    <?php
    /**
     * display the product previous/next helper
     */
    require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
    <?php } ?>
    <!--eof Prev/Next top position-->
    
    </div>
    <div style="clear:both;"><br /></div>
    <div id="proimg">
    <!--bof Main Product Image -->
    <?php
      if (zen_not_null($products_image)) {
      ?>
    <?php
    /**
     * display the main product image
     */
       require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
    <?php
      }
    ?>
    <!--eof Main Product Image-->
    </div>
    <div id="probanner"><img border="0" src="images/AdSpace2.jpg" /></div>
    <div id="prorder">
    <!-- Product order items start -->
    <?php 
    echo '<div id="nimship">Free Shipping on orders over <font color="#CC0000"> $75</font></div>';
    ?>
    <!--bof Product Code   -->
    <div id="pcoden">
    <?php 
    if (zen_get_products_code((int)$_GET['products_id']))
    {
    echo 'Product Code: ';
    echo zen_get_products_code((int)$_GET['products_id']);
    //echo 'LKSER1148';
    }
    ?>
    </div>
    <!--eof Product Code  -->
    <!-- purposely comented
    <div class="cust_review">Customer Review<br><img src="includes/templates/hnb/images/star_5.png" width="60" height="12"></div> -->
    <!--bof Product Price block -->
    <div id="productPrices">
    
    <?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 'List Price: $4.99<br>';
      echo '<div class="price_lbl">Our Price:<font color="#CC0000">'.$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']).'</font></div>';
      //echo 'You Save: $1.00';
    ?>
    <!--bof Add to Cart Box -->
    <?php
    if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
      // do nothing
    } else {
    ?>
                <?php
        $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
                if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
                  // hide the quantity box and default to 1
                  $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);
                } else {
                  // show the quantity box
        $the_button = '<div id=atn>'.PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) .zen_draw_hidden_field('products_id', (int)$_GET['products_id']) .'</div><div id="addtobtn">'. zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT).'</div>';
                }
        $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
      ?>
      <?php if ($display_qty != '' or $display_button != '') { ?>
      
        <?php
         //echo $display_qty;
    	 //echo '<br>';
         echo "<div class='cart_btn'>".$display_button."</div>";
         ?>
      <?php } // display qty and button ?>
    <?php } // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Box-->
    </div>
    <!--bof Reviews button and count-->
    <?php
      if ($flag_show_product_info_reviews == 1) {
    ?>
    <div id="productReviewLink" class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params()) . '">' . zen_image_button(BUTTON_IMAGE_REVIEWS, BUTTON_REVIEWS_ALT) . '</a><br>'; ?></div>
    <?php
    }
    ?>
    <!--eof Reviews button and count -->
    
    <div style="clear: both;"></div>
    
    <!--bof Reviews write-->
    <div class="rwn"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array('reviews_id'))) . '">' . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . '</a>'; ?></div>
    <!--eof Reviews write-->
    
    <!--eof Product Price block -->
    
    
    <!--bof free ship icon  -->
    <?php if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
    <div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
    <?php } ?>
    <!--eof free ship icon  -->
    
    <!--bof Quantity Discounts table -->
    <?php
      if ($products_discount_type != 0) { ?>
    <?php
    /**
     * display the products quantity discount
     */
     require($template->get_template_dir('/tpl_modules_products_quantity_discounts.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_quantity_discounts.php'); ?>
    <?php
      }
    ?>
    <!--eof Quantity Discounts table -->
    <!-- Product order items end -->
    </div>
    
    <!--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"') . "\n"; ?>
    <!--eof Form start-->
    
    <?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?>
    <div id="prodetails">
    <!-- bof click to enlarge -->
    <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
    <script language="javascript" type="text/javascript"><!--
    document.write('<?php echo '<div id="tf"><a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')"><br /><span class="imgLink"><img src="includes/templates/hnb/images/enlarge.gif" /></span></a>'; ?>');
    //--></script>
    <noscript>
    <?php
      echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
    ?>
    </noscript>
    <!-- end of click to enlarge -->
    
    <!--bof Tell a Friend button -->
    <?php 
      if ($flag_show_product_info_tell_a_friend == 1) { ?>
    <?php 
    echo '<img src="includes/templates/hnb/images/seperater_tell_friend.gif" />';
    echo ($flag_show_product_info_tell_a_friend == 1 ? '<a href="' . zen_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $_GET['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_TELLAFRIEND, BUTTON_TELLAFRIEND_ALT) . '</a></div>' : ''); ?>
    <?php
      }
    ?>
    <!--eof Tell a Friend button -->
    <br>
    <!--bof Product Name-->
    <h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>
    <!--eof Product Name-->
    <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <?php echo stripslashes($products_description); ?>
    <?php } ?>
    <!--eof Product description -->
    </div>
    
    <div id="lastbtn" >
    </div>
    <!--bof Form close-->
    <div style="clear:both"></div>
    </form></div><div id="body_mid_bottompro"></div><!--bof also purchased products module--><br>
    <?php require($template->get_template_dir('tpl_modules_also_purchased_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_also_purchased_products.php');?>
    <!--eof also purchased products module-->
    </div>
    <div id="mid_bottom"></div>
    Thanks in advance!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Add to Cart button does not work

    Your custom version of that file is all hacked up beyond recognition.

    It probably works just fine if you use the original version of the file, right?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Add to Cart button does not work

    It does work, however it does not match with the template I currently have.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Add to Cart button does not work

    Quote Originally Posted by whosurdavid View Post
    It does work, however it does not match with the template I currently have.
    I'm not sure I understand.

    You titled this thread "Add to Cart button does not work" ... but then you say "It does work".

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 27
    Last Post: 22 Feb 2015, 07:25 PM
  2. My ADD TO CART does not work in SSL / HTTPS
    By limelites in forum General Questions
    Replies: 3
    Last Post: 4 Mar 2014, 11:45 PM
  3. Please Help! My add to cart button does not work
    By powerstar in forum General Questions
    Replies: 4
    Last Post: 23 Aug 2010, 02:06 AM
  4. product page does not have an 'add to cart' button or link
    By kaylaugh in forum General Questions
    Replies: 3
    Last Post: 18 Feb 2010, 09:47 AM
  5. add to cart button does not show if there is no description !?
    By vandiermen in forum General Questions
    Replies: 4
    Last Post: 11 Jun 2009, 04:30 PM

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