Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do you edit the "Add to Cart" area?

How do you edit the "Add to Cart" area?

Locked

Views: 773

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
11 Mar 2008, 5:21 PM
#1
bugyoutoo avatar

bugyoutoo

New Zenner

Join Date:
Nov 2007
Posts:
34
Plugin Contributions:
0

How do you edit the "Add to Cart" area?

The default layout is

Quantity: XX
Add to Cart

I'm trying to play around with different layouts, including:

A)
Quantity
XX

and B)
Be able to put the Add to Cart button anywhere I want.

At the moment, in product_info_display template I tried to separate this code but still the quantity and Add to Cart button are always connected together, it's very frustrating..

 <?php
      echo $display_qty;
      echo $display_button;
?>

Here's my site: http://www.thuyvancollection.com/index.php?main_page=product_info&cPath=5_6&products_id=34

11 Mar 2008, 5:42 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do you edit the "Add to Cart" area?

The two parts are embedded in a conditional:```php

<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
  echo $display_qty;
  echo $display_button;
        ?>
      </div>
<?php } // display qty and button ?>
You can separate them into different divs and position those with your stylesheet:
```php
<?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartQty">
    <?php
      echo $display_qty;
            ?>
          </div>
    <div id="cartAdd">
    <?php
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>

You could also completely separate them, provided you keep both elements below the code that builds the output:

  <?php if ($display_qty != '') { ?>
    <div id="cartQty">
    <?php
      echo $display_qty;
            ?>
          </div>
  <?php } // display qty ?>
...

  <?php if ($display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_button;
            ?>
          </div>
  <?php } // display button ?>