Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Cambridge, ON
    Posts
    14
    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
    641
    Plugin Contributions
    4

    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
    Cambridge, ON
    Posts
    14
    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. Aligning Quantity Box and Add to Cart Button
    By eyal8r in forum General Questions
    Replies: 14
    Last Post: 24 Feb 2010, 04:32 AM
  2. shopping cart - hide the Cart Quantity Update button when not needed
    By dause in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Oct 2009, 04:28 AM
  3. 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
  4. add to cart button and quantity
    By taydu in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Apr 2008, 03:30 PM
  5. Only Add To Cart Button No Quantity Box
    By ryanp in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Jun 2006, 08:57 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
  •