Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default How to change the "Add to Cart" block

    Dear all,

    I need change the css and the "add to cart: 1" on the "tpl_product_info_display.php"

    But after I finded the relevant code, I am not understand how the "$display_button;" value base from?

    Code:
    <!--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-->
    Specially the CSS of the output on my templates

    My HTML output will be like that

    Code:
    <!--bof Add to Cart Box -->
                      <div id="cartAdd">
        <p>Quantity in Cart: 1</p>Add to Cart: <input type="text" name="cart_quantity" value="1" maxlength="6" size="4" /><br /><br /><input type="hidden" name="products_id" value="6" /><IMG border="0" SRC="includes/templates/ZC03C00093/images/az_button_left.gif" /><input class="az_button_submit" style="padding-top: 1px; padding-bottom: 4px;" type="submit" value="Add to Cart" /><IMG border="0" SRC="includes/templates/ZC03C00093/images/az_button_right.gif" />          </div>
      <!--eof Add to Cart Box-->
    I want to change the
    <input class="az_button_submit" style="padding-top: 1px; padding-bottom: 4px;" type="submit" value="Add to Cart" /> this column's CSS value.

    Who can tell me which part control the "$display_button;"

    Thx for your time.

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,611
    Plugin Contributions
    25

    Default Re: How to change the "Add to Cart" block

    It looks to me as though you are using an Algozone template where they have rewritten one of the Zen Cart functions. I'm hoping that it's an old template, as I'fd hate think that they might be inserting inline CSS like this unnecessarily now.

    As it's not standard Zen Cart, you might want to get in touch with them to cofirm this, but I suspect that what they have done is re-write the zen_get_buy_now_button function in the includes/functions/functions_general.php file and which is called by the following line in the code that you posted.
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
    The zen_get_buy
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2007
    Posts
    375
    Plugin Contributions
    3

    Default Re: How to change the "Add to Cart" block

    Yes, it is using Algozone template, my boss ask me change something.

    But I am not a programmer, just a designer, so many part make change with the php code is hard for me.

 

 

Similar Threads

  1. How to change the default quantity values of "add to cart"
    By xuxinunuon in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2010, 01:22 PM
  2. Replies: 0
    Last Post: 17 Mar 2010, 05:24 PM
  3. Help with "Add to cart box", a font change and "New Produts Module"...
    By BenhamCollectibles in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 5 Dec 2009, 05:24 PM
  4. How to change the link on the "add this to my cart" button?
    By chiflatin in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 19 Oct 2009, 09:02 PM
  5. How can I rename the "add to cart" to "checkout now"?
    By InterSign in forum General Questions
    Replies: 5
    Last Post: 6 May 2008, 08:45 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR