Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Ontario, Canada
    Posts
    23
    Plugin Contributions
    0

    cart error Separating Quantity Box and Add to Cart button

    Ok, I think I am really close to achieving what I'm looking for, but I need the help of someone with a little more knowledge. The idea is to have the Qty: Box above the product attributes, and then once they have completes the attributes section the 'add to cart' would be located at the bottom. Here is an image to illustrate this:



    Here is a link to where the actually page is: http://www.12stepjewelry.com/atgwhol...roducts_id=553

    At this point I've only duplicated the entire Add to Cart Box section. I've tried fooling around with the code so that it hides the button at the top and the box at the bottom, but it always loads as a blank page.

    Anyone with a link to a thread that talks about this or anyone with any suggestions would be my hero.

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Separating Quantity Box and Add to Cart button

    is this what you're after?


    it took me 60 seconds to do it so don't look at the styling... the quantity field can be done as one div and button as another and then you can do anything you want with it.

    this is what you have to do:
    - open your tpl_product_info_display.php
    - find where you want to position the quantity field
    - insert this code:
    Code:
    <!--bof Quantity 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']);
                }
        $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
      ?>
      <?php if ($display_qty != '' or $display_button != '') { ?>
        <div id="cartAddQuantity">
        <?php
          echo $display_qty;
          echo $display_button;
                ?>
              </div>
      <?php } // display qty and button ?>
    <?php } // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Quantity Box-->
    - now find where you want to position the button and add this code:
    Code:
    <!--bof Add to Cart Button 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 = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
                }
        $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
      ?>
        <div id="cartAdd">
        <?php
          echo $display_button;
                ?>
              </div>
    <?php } // CUSTOMERS_APPROVAL == 3 ?>
    <!--eof Add to Cart Button Box-->
    As you can see, I created a new div called cartAddQuantity for the quantity field. Create a new id (#cartAddQuantity) in your stylesheet.css and style it as you like.

    Have fun! Let us know how it went...

  3. #3
    Join Date
    Sep 2009
    Location
    Ontario, Canada
    Posts
    23
    Plugin Contributions
    0

    Default Re: Separating Quantity Box and Add to Cart button

    Oh Wow, you are truly my hero. I kinda knew that was what I was supposed to do... I'm just not there yet in being able to put all the peices together. Thanks so much for this fantastic solution.

    You are the best ever! Thanks!

 

 

Similar Threads

  1. v151 Style Quantity Box and Add To Cart Button separately
    By k1ra in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 29 Nov 2013, 06:49 AM
  2. Add to Cart button replaced by quantity box
    By jwebster8 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Aug 2010, 06:37 PM
  3. Aligning Quantity Box and Add to Cart Button
    By eyal8r in forum General Questions
    Replies: 14
    Last Post: 24 Feb 2010, 04:32 AM
  4. Separating add quantity and price into two columns
    By wongasta in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 26 Jun 2009, 01:05 AM
  5. please help me fix this code, adding quantity box and add to cart button to xsell
    By lankeeyankee in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 7 Nov 2007, 03:24 AM

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