Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Product Page Price, quantity, order button layout

Product Page Price, quantity, order button layout

Locked

Views: 1,639

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 May 2008, 9:07 PM
#1
nev avatar

nev

New Zenner

Join Date:
Nov 2007
Location:
Canada
Posts:
49
Plugin Contributions:
0

Product Page Price, quantity, order button layout

Desperately looking for help here.
I’ve rearranged everything else on the product page but now I’m stuck. :frusty: And after hours of attempting to rearrange the code in tpl_product_info_display.php a cry for help is the only option.

What I want to rearrange is the price [quantity box] add to cart button
into one line and when an item is already in the shopping cart the Quantity in shopping cart notice underneath instead of in the middle of it.

The site: www.mllem.com/mademoiselle_m

This I what is looks like now:

This is what I would like to get:

If there is an attribute selection:

change to display like this:

so to elimate the Please Chose: and what is not visible in this image if there was an quantity box it would be between the price and the attribute.

The present code for that section in tpl_product_info_display.php is:

<!--bof Product Price block -->
<p id="productPrices" class="productGeneral">
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></p>
<!--eof Product Price block -->

<!--my change of place for add to cart box-->
<div id="buybox">
<!--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="4" size="3" /><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 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 -->

can someone please, please please help :blush:
thanks
nev

21 May 2008, 9:28 AM
#2
crashley1784 avatar

crashley1784

New Zenner

Join Date:
May 2008
Location:
Alconbury, UK
Posts:
27
Plugin Contributions:
0

Re: Product Page Price, quantity, order button layout

I've been trying to figure out the same thing. What is up with the add to cart button??! Why is it so darned hard to move??

22 May 2008, 2:43 AM
#3
nev avatar

nev

New Zenner

Join Date:
Nov 2007
Location:
Canada
Posts:
49
Plugin Contributions:
0

Re: Product Page Price, quantity, order button layout

ok it doesn’t seem like I can easily get the attributes where I want them.. to many div-s in the attribute template.. so for now above will have to do

got rid of the last few remaining <br/> and enclosed everthign in one div and
pasting the php code I butchered to get the 1st part to display in one line with the quantity in cart line under it (image 2), can someone who actually has at least some idea about php (unlike me) have a look at it .. and hopefully tell me how to fix potentially dangerous bits of code that are left dangling or anything else I might have done wrong specially the

$display_qty = (($_SESSION['cart']->in_cart($_GET['products_id'])) ? '' . '' : ''); part

<!--my change of place for add to cart box-->
<div id="buybox">
<!--bof Product Price block -->
<p id="productPrices" class="productGeneral">
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span>';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></p>
<!--eof Product Price block -->


<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($_SESSION['cart']->in_cart($_GET['products_id'])) ? '' . '' : '');
            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="4" size="3" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . 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 != '') { ?>
<!--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 -->  
    <!--take out div ref<div id="cartAdd">-->
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
            
            
      <?php
    $display_sh = (($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>' : '');
	?>
    <?php
      echo $display_sh;
            ?>
	      
    <!--take out cartAdd div ref</div>-->  
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->

thanks for any help
nev

24 May 2008, 3:18 AM
#4
Join Date:
May 2008
Posts:
1
Plugin Contributions:
0

Re: Product Page Price, quantity, order button layout

Is real? Ha