Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    57
    Plugin Contributions
    0

    Default Style Quantity Box and Add To Cart Button separately

    I am attempting to style the quantity box and add to cart button on tpl_product_info_display but can't seem to separate the two. I have tried modifying the code from

    Code:
      <?php if ($display_qty == '0' or $display_button != '') { ?>
    
        <?php
          echo $display_qty;
          echo $display_button;
    	?>
    
      <?php } // display qty and button ?>
    to

    Code:
     <?php if ($display_qty != '') { ?>
        <div id="cartQty">
        <?php
          echo $display_qty;
                ?>
              </div>
      <?php } // display qty ?>
    
      <?php if ($display_button != '') { ?>
        <div id="addToCartButton">
        <?php
          echo $display_button;
                ?>
              </div>
      <?php } // display button ?>
    to no avail.
    The code renders the div 'addToCartButton' around the two objects as a whole, instead of putting that div just around the button. Any ideas?

  2. #2
    Join Date
    Sep 2013
    Location
    Texas
    Posts
    315
    Plugin Contributions
    0

    Default Re: Style Quantity Box and Add To Cart Button separately

    Please clarify.
    It's not clear to me what you are trying to do.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Style Quantity Box and Add To Cart Button separately

    Quote Originally Posted by k1ra View Post
    I am attempting to style the quantity box and add to cart button on tpl_product_info_display but can't seem to separate the two. I have tried modifying the code from

    Code:
      <?php if ($display_qty == '0' or $display_button != '') { ?>
    
        <?php
          echo $display_qty;
          echo $display_button;
        ?>
    
      <?php } // display qty and button ?>
    to

    Code:
     <?php if ($display_qty != '') { ?>
        <div id="cartQty">
        <?php
          echo $display_qty;
                ?>
              </div>
      <?php } // display qty ?>
    
      <?php if ($display_button != '') { ?>
        <div id="addToCartButton">
        <?php
          echo $display_button;
                ?>
              </div>
      <?php } // display button ?>
    to no avail.
    The code renders the div 'addToCartButton' around the two objects as a whole, instead of putting that div just around the button. Any ideas?
    Quote Originally Posted by linuxguy2 View Post
    Please clarify.
    It's not clear to me what you are trying to do.
    Somewhat agree with linuxguy; however, the fact that a change to the code is not being seen seems to suggest that the code being changed is not the code being parsed... As this is a template issue, you are modifying the overriden template file correct? Not the default (where an override exists or not).

    From what I understand, the desire is to either end up using CSS to adjust the view of each "button" differently or to prevent the view of one or the other, and to accomplish this, they are trying to create two separate div tags, but the div tags are either not showing up, or the single tag is somehow embedded in the button array/string.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,870
    Plugin Contributions
    96

    Default Re: Style Quantity Box and Add To Cart Button separately

    As always with any question that has to do with styling, a link to the page in question would help us help you ...

  5. #5
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: Style Quantity Box and Add To Cart Button separately

    Quote Originally Posted by k1ra View Post
    I am attempting to style the quantity box and add to cart button on tpl_product_info_display but can't seem to separate the two. I have tried modifying the code from

    Code:
      <?php if ($display_qty == '0' or $display_button != '') { ?>
    
        <?php
          echo $display_qty;
          echo $display_button;
    	?>
    
      <?php } // display qty and button ?>
    to

    Code:
     <?php if ($display_qty != '') { ?>
        <div id="cartQty">
        <?php
          echo $display_qty;
                ?>
              </div>
      <?php } // display qty ?>
    
      <?php if ($display_button != '') { ?>
        <div id="addToCartButton">
        <?php
          echo $display_button;
                ?>
              </div>
      <?php } // display button ?>
    to no avail.
    The code renders the div 'addToCartButton' around the two objects as a whole, instead of putting that div just around the button. Any ideas?
    I changed tpl_product_info_display to this:

    Code:
    	// show the quantity box
    /*    $the_button = '<div class="minMaxUnits">' . PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="8" size="6"/><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . '<br />' . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT, 'style="margin:0 auto;"') . '</div>';*/
        $the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="8" size="6"/>' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . '<br />' . 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><!-- end cartAdd -->
    Then in stylesheet.css did this, although certain bits may not apply to your situation

    Code:
    #cartAdd {
    	background:#ffd;
    	border:2px solid #ddd;
    	border-top:1px solid #ddd;
    	border-bottom:3px solid #ddd;
    	clear:left; /* right */
    	float:none;
    	width:98%;
    	margin:0.5em auto; /* 1.0em */
    	padding:0.5em 0em; /* 1.0em */
    	text-align:center;
    	}
    
    #cartAdd input[type="text"] {
    	clear:left;
    	float:none;
    	width:4em;
    	margin:0.25em auto;
    	}
    
    #cartAdd input[type="image"] {
    	clear:left;
    	float:none;
    	margin:0.25em auto;
    	}
    
    .minMaxUnits {
    	float:none;
    	margin:0.5em auto;
    	}

    ATM however I am not sure if this is all I did to also change the display of min-max units, as it is tied in with Justin's 150 Edit_Cart mod. This will have to wait until Sunday.

    Hope this helps.

 

 

Similar Threads

  1. v139h Style quantity and add to cart button on product listing
    By barendfaber in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Aug 2012, 03:39 PM
  2. Separating Quantity Box and Add to Cart button
    By k8ee in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Sep 2010, 03:53 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. 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
  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

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