Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2012
    Posts
    12
    Plugin Contributions
    0

    Default Add to Cart - splitting attribute options

    Hi i have a page on my site with 3 sets of attribute options but the add to cart is displaying in between them and causing a large gap as can be seen HERE Does anyone know how i can force it to the bottom of the option boxes?

  2. #2
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Add to Cart - splitting attribute options

    You sure it's not your sharing code?

    Failing that you just need to play around with grouping and styling elements within
    includes/templates/YOUR_TEMPLATE/templates/product_info_display.php
    Phil Rogers
    A problem shared is a problem solved.

  3. #3
    Join Date
    Dec 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Add to Cart - splitting attribute options

    Quote Originally Posted by philip937 View Post
    You sure it's not your sharing code?
    Not sure what that is?

    Quote Originally Posted by philip937 View Post
    Failing that you just need to play around with grouping and styling elements within
    includes/templates/YOUR_TEMPLATE/templates/product_info_display.php
    Sorry I'm a real beginner when it comes to code So dont wanna play around with anything, its usually the best way to break it lol

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Add to Cart - splitting attribute options

    You sure it's not your sharing code?
    Not sure what that is?
    Facebook, tweet, share - the code for these
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Add to Cart - splitting attribute options

    If you didn't tinker with the code files, then you need to chat to the person who did...

    Somebody has played around with the files - and they've not done it in the most appropriate way.

    The main issues stem from the use (or non-use) of -
    </div>
    <br class="clearBoth" />
    </div>


    - elements, and this is contributing to layout problems.

    There are probably TWO files that have been tampered with, that will need addressing.

    1. /includes/templates/apparel_boutique/templates/tpl_product_info_display.php (perhaps a <br class="clearBoth" /> needs to be added to the Add To Cart section, and the Attributes section needs to be moved ABOVE the add to cart. SEE BELOW - The BLUE code needs to be moved to below the RED code.

    Code:
     <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
    <?php } ?>
    <!--eof Product description -->
    <br class="clearBoth" />
    
    <!--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-->
    
    <!--bof Product details list  -->
    <?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
    <ul id="productDetailsList" class="floatingBox back">
      <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
    </ul>
    <br class="clearBoth" />
    <?php
      }
    ?>
    <!--eof Product details list -->
    
    <!--bof Attributes Module -->
    <?php
      if ($pr_attr->fields['total'] > 0) {
    ?>
    <?php
    /**
     * display the product atributes
     */
      require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
    <?php
      }
    ?>
    <!--eof Attributes Module -->
    2. /includes/templates/apparel_boutique/templates/tpl_modules_attributes.php Not sure what might have been done here as we can't see the file - just the RESULT. but it may need looking at.

    Additionally, your SOCIAL MEDIA links seem to have been hard-coded into the left column as well. This is a very messy way of doing this and can present problems (especially when upgrading software). Ideally, these should be put into a custom sidebox which is then properly coded and referenced. The BLANK SIDEBOX module is perfect for this.
    20 years a Zencart User

  6. #6
    Join Date
    Dec 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Add to Cart - splitting attribute options

    Many thanks for that schoolboy The code change in 1. /includes/templates/apparel_boutique/templates/tpl_product_info_display.php almost did the job it has moved the button down ok but it has put it at the side of and pushed the prev / next button over to one side. but this is not a problem as that my next quest to discover how to not have them displayed lol. I dont have a /includes/templates/apparel_boutique/templates/tpl_modules_attributes.php file at all is that a problem? the sharing code is written into /includes/templates/apparel_boutique/templates/tpl_product_info_display.php i think

    <!--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;
    ?>

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style">
    <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
    <a class="addthis_button_tweet"></a>
    <a class="addthis_counter addthis_pill_style"></a>
    </div>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4cd1ec2b08cdcb12"></script>
    <!-- AddThis Button END -->

    </div>
    <?php } // display qty and button ?>
    <?php } // CUSTOMERS_APPROVAL == 3 ?>
    </BR>
    </BR></BR></BR></BR></BR></BR></BR></BR>
    <!--eof Add to Cart Box-->
    Last edited by home2gifts; 24 Feb 2013 at 03:17 PM.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Add to Cart - splitting attribute options

    Quote Originally Posted by home2gifts View Post
    I dont have a /includes/templates/apparel_boutique/templates/tpl_modules_attributes.php file at all is that a problem?
    No.. not a problem. In fact it means the CORE file has not been tinkered with.

    Quote Originally Posted by home2gifts View Post
    the sharing code is written into /includes/templates/apparel_boutique/templates/tpl_product_info_display.php i think
    This would be the case, and again not a problem. It looks like it's been "embedded" into the "add-to-cart" segment.

    You just need to play around with the tpl_product_info_display.php file to decide the ORDER of the elements.

    The elements (sections) are "encased" in <!--BOF xxxxxx --> and <!-- EOF xxxx --> comment tags.

    You can "cut" and "paste" these in whatever order you like, and this influences their order of appearance on the screen.
    20 years a Zencart User

  8. #8
    Join Date
    Dec 2012
    Posts
    12
    Plugin Contributions
    0

    Default Re: Add to Cart - splitting attribute options

    Thanks You've been a big help

 

 

Similar Threads

  1. v150 Need to add and/or to 4 attribute controller options
    By webmeister in forum Customization from the Admin
    Replies: 3
    Last Post: 30 Oct 2012, 04:27 AM
  2. Attribute question: add/remove price when selecting options?
    By aceproductsusa in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 26 Feb 2011, 01:15 AM
  3. How to add extra help me button in the side of attribute options
    By himal in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 1 Mar 2010, 06:07 PM
  4. add cost plus attribute/link attributes to options
    By wolfkin in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Jan 2010, 08:41 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