Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / putting attributes in the add to cart box on product info page

putting attributes in the add to cart box on product info page

Locked

Started by angela183 on 19 May 2006, 3:55 AM · Views: 21,211

Results 21 to 40 of 55
This thread is locked. New replies are disabled.
21 May 2006, 11:50 PM
#21
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #21 by clydejones

Angela,

In your stylesheet_new.css

first find this section and delete everything in red.

/*Shopping Cart Display*/
#cartAdd {
	float: right;
	text-align: left;
	margin: 1em;
	border: 0px dotted #666666;
	padding: 1em;
	}

second find this section and delete the portion in red

#productAttributes {
	float: right;
	text-align: left;
	border: 0px solid #666666;
        font-size: .9em;
        color: #666666;
	}

These 2 changes will center everything within the box.

If the box still appears too wide you can adjust that here:

#buybox {margin: 0; padding: 3px; width: 281px; text-align: center; background: #fdeaec; border: 1px solid #b08694;}

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 May 2006, 12:22 AM
#22
angela183 avatar

angela183

New Zenner

Join Date:
May 2006
Posts:
14
Plugin Contributions:
0

Post #22 by angela183

k that worked too but my last problem is centering the attributes in the box but at the same time having the text aligned left. the add to cart button is centered but not the attributes. im being such a pain! sorry. thanks for all the help

i tried to center it my self but it wouldnt move.

22 May 2006, 1:18 AM
#23
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #23 by clydejones

Angela,

increase the width of the box to 220px and I think you'll end up with the look you want.

#buybox {margin: 0; padding: 3px; width: 220px; text-align: center; background: #FFF3FA; border: 1px solid #b08694;}

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 May 2006, 1:21 AM
#24
angela183 avatar

angela183

New Zenner

Join Date:
May 2006
Posts:
14
Plugin Contributions:
0

Post #24 by angela183

perfect! Thank you!

22 May 2006, 1:23 AM
#25
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #25 by clydejones

Glad I could help

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Jul 2006, 9:54 PM
#26
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

Post #26 by turtledove

clyde, thanks for the info on this; i was seeking the same thing as angela. but, how would i center the 'buy box'?

I added float: center;, but it didnt work.

14 Jul 2006, 10:09 PM
#27
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #27 by clydejones

TurtleDove:

clyde, thanks for the info on this; i was seeking the same thing as angela. but, how would i center the 'buy box'?

I added float: center;, but it didnt work.

You can only float right or left.

Use text-align: center;

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Jul 2006, 10:14 PM
#28
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

Post #28 by turtledove

aww, that doesnt put the whole box in the center. it's allright though.

would there be a way for me to put the product description in that box also, on top of the attributes?

19 Jul 2006, 9:15 PM
#29
johnny43 avatar

johnny43

Zen Follower

Join Date:
Feb 2006
Posts:
231
Plugin Contributions:
0

Post #29 by johnny43

Thanks , managed to use this...very usefull :)

https://www.planetebio.net - Eat Right Feel Good !

26 Jul 2006, 10:03 PM
#30
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

Post #30 by turtledove

Clyde,

Since you were the one who first altered the code in order to put the Attributes into the Add to Cart box, how do I add the Product Description and the Product Additional into this box as well?

I tried posting a message about this a couple weeks ago in a new thread, hoping someone could help me out, but no one has answered yet. I even went into a PHP forum, but couldn't get help there either. So, I was thinking, that I might as well ask the helper of this topic! :)

5 Aug 2006, 10:42 AM
#31
psycho_chick avatar

psycho_chick

New Zenner

Join Date:
Aug 2006
Posts:
6
Plugin Contributions:
0

Post #31 by psycho_chick

TurtleDove:

aww, that doesnt put the whole box in the center. it's allright though.

would there be a way for me to put the product description in that box also, on top of the attributes?

I wanted the same, but I didn't combine all of this - I just wanted the "add this to my cart" box centered.

Instead of float: left or right, I did float: none, then made the left and right margins auto to make them even. That makes the box centered, but it takes up the whole page, so I gave it a width. I chose 120px, but you can experiment.

#cartAdd {
	float: none; width: 120px;
	text-align: center;
	margin-left: auto; margin-right: auto;
	border: 1px solid #000000;
	padding: 1em;
	}

This worked for me, but you have to know that I saw my first css code about a week ago (I've been reading like mad), so if someone else tells you not to do this, don't!

5 Aug 2006, 1:02 PM
#32
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #32 by clydejones

TurtleDove:

Clyde,

Since you were the one who first altered the code in order to put the Attributes into the Add to Cart box, how do I add the Product Description and the Product Additional into this box as well?

For the product details; in your tpl_product_info_display.php

move everything between

<!--bof Product description -->

and

<!--eof Product description -->

into the box

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Aug 2006, 2:04 PM
#33
gardengate avatar

gardengate

New Zenner

Join Date:
Jul 2006
Location:
Cleveland
Posts:
79
Plugin Contributions:
0

Post #33 by gardengate

I am a newbe to Zen Cart and I was just trying to move the add to cart botton to go below the attribute it does not have to be in the box of add to cart just above it. Any easy way to do that?

It appears natural for the customer after filling the attribute scrolling down not to have to go back up

Thanks.

9 Aug 2006, 2:18 PM
#34
gardengate avatar

gardengate

New Zenner

Join Date:
Jul 2006
Location:
Cleveland
Posts:
79
Plugin Contributions:
0

Post #34 by gardengate

Hi I gnore my previous post. I found it it is in tpl_product_info_display.php
I found the box

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

and I moved it to the bottom.
I repost it here to help other neebies.

9 Aug 2006, 2:26 PM
#35
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #35 by clydejones

khiyami:

I am a newbe to Zen Cart and I was just trying to move the add to cart botton to go below the attribute it does not have to be in the box of add to cart just above it. Any easy way to do that?

It appears natural for the customer after filling the attribute scrolling down not to have to go back up

Thanks.

Check your tpl_product_info_display.php and you will find that it is very easy to move things around as you wish.

You will find that the various sections are clearly marked by

<!-- bof something --> <!-- eof something -->

Just move everything including the comments to where you want them to appear.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Aug 2006, 4:52 PM
#36
dlaitila avatar

dlaitila

New Zenner

Join Date:
Sep 2005
Posts:
57
Plugin Contributions:
0

Post #36 by dlaitila

Could you please give an exact link to the the tpl_product_info_display.php?
I'm not sure which directory it's located in.

Thanks

9 Aug 2006, 5:10 PM
#37
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #37 by clydejones

You'll find it in:

includes -> templates -> YOUR_TEMPLATE -> templates

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

11 Aug 2006, 3:19 AM
#38
makulit avatar

makulit

New Zenner

Join Date:
May 2006
Location:
Japan
Posts:
36
Plugin Contributions:
0

Post #38 by makulit

thanks for this clydejones! really great :thumbsup:

12 Aug 2006, 1:34 PM
#39
dlaitila avatar

dlaitila

New Zenner

Join Date:
Sep 2005
Posts:
57
Plugin Contributions:
0

Post #39 by dlaitila

I noticed on this page http://mysticmountainnaturals.com/index.php?main_page=product_info&products_id=27
that you are able to have the attributes for the larger size bottle just show the price.

For example the 8 oz bottle is $12.00 and the 16 oz bottle is $15.60 plus you have the weight in there too for the sizes.

Is it possible to do this with Zen-Cart 1.2.6? I'm reluctant to upgrade to 1.3.

My client sells t-shirts and S-M-L-XL are all 15.99 but the 2XL shirts cost 17.99. I have it now so that the attributes show ok for the smaller sizes, but we don't want it to say in parentheses (+2.00) because it's too confusing for the customer. How can I avoid putting this and just show that the 2XL shirts are ($17.99) and not have (+2.00) show.

Thanks for your help.

12 Aug 2006, 4:45 PM
#40
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Post #40 by clydejones

I did this by setting up an option name as size

The option value(s) for soze would be:

S-M-L-XL
2XL

In the attributes controller

You would set the price for your S-M-L-XL at 15.99 and
the price for the 2XL at 17.99

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.