Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Location
    East Tennessee
    Posts
    24
    Plugin Contributions
    0

    Killing 'Add To Cart' for info pages

    Greetings.

    I just upgraded to version 1.3.0, and am continuing my attempt to get ZenCart to suit my not quite normal needs.

    In one section of my store I need to display information about a product but not allow it to be added to the shopping cart.

    I modified the file: tpl_product_free_shipping_info_display.php for this purpose and assigned this type of "product" to this handler page. All went well until I removed the following code block from the template:


    <!--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 = PRODUCTS_ORDER_QTY_TEXT . '<input type="text"

    name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '"

    maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display

    ((int)$_GET['products_id']) . '<br />' . 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);
    ?>
    <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
    echo $display_qty;
    echo $display_button;
    ?>
    </div>
    <?php } // display qty and button ?>
    <?php } // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Box-->

    It did remove the Add To Cart from thse pages, but also shows this at the footer of the page:

    This product was added to our catalog on Tuesday 09 May, 2006
    }}?>

    This product was added to our catalog on Tuesday 09 May, 2006

    I appear to have left something unclosed. Can anyone tell me what I need to put where to button things up properly?

    Thanks so much.

    Live URL: http://www.treasuresofappalachia.com...products_id=37

  2. #2
    Join Date
    Dec 2005
    Location
    East Tennessee
    Posts
    24
    Plugin Contributions
    0

    Default Re: Killing 'Add To Cart' for info pages

    DUUH! Never mind...

    I just stumbled across a bank of switches in the Admin panel that lets me turn Add To Cart on and off for the various handler pages. So I've uploaded the back-up copy of that template and done it the right way.

 

 

Similar Threads

  1. v139h DB/SQL Error when using SQL Patch for Add Pages More Info Sidebox addon
    By maperr55 in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 5 Mar 2012, 09:32 PM
  2. No Add to Cart Buttons on Product Info Pages
    By Yolanda in forum General Questions
    Replies: 12
    Last Post: 10 Jan 2012, 04:44 AM
  3. URGENT - add to cart box on product info pages not working
    By Sushigal in forum General Questions
    Replies: 3
    Last Post: 19 May 2010, 03:34 PM
  4. Javascript killing Secure Pages
    By ft11 in forum General Questions
    Replies: 2
    Last Post: 9 Oct 2007, 11:11 PM
  5. Product info pages showing "add to cart" only for products with attributes
    By hrm in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Aug 2006, 03:24 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