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 1 to 20 of 55
This thread is locked. New replies are disabled.
19 May 2006, 3:55 AM
#1
angela183 avatar

angela183

New Zenner

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

Post #1 by angela183

hello!
I was wondering if anyone knew how i can make my attribute radio options be displayed in the same box as the add to cart button on the product info page. see the attachment to for a picture of this to see what im talking about.
thanks

21 May 2006, 4:46 AM
#2
angela183 avatar

angela183

New Zenner

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

Post #2 by angela183

anyone have any clue?????????:down:

21 May 2006, 5:01 AM
#3
clydejones avatar

clydejones

Deceased

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

Post #3 by clydejones

Good News, Yes it can be done.

You'll need to move things around in the tpl_info_display.php and add/change some new IDs in the stylesheet.

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

21 May 2006, 5:04 AM
#4
angela183 avatar

angela183

New Zenner

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

Post #4 by angela183

hi thanks for replying. Do you have any idea what code i need to add to the css ( i have no clue)?
and for the template info display would i just move the attributes section into the same section as the add to cart???

21 May 2006, 6:07 AM
#5
clydejones avatar

clydejones

Deceased

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

Post #5 by clydejones

Let me play around with a couple of ideas (may take a day or two) and see what I can come up with.

When I have something I'll post it for you.

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

21 May 2006, 6:09 AM
#6
angela183 avatar

angela183

New Zenner

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

Post #6 by angela183

ok your awesome because i don't know what to do and i would love to have my attributes and add to cart look like that :)

21 May 2006, 6:28 PM
#8
clydejones avatar

clydejones

Deceased

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

Post #8 by clydejones

Angela,

OK, here's what I came up with.

CSS (make sure these IDs are unique and not duplicated anywhere in your stylesheet) You can change colors as needed.

#buybox {margin: 0; padding: 3px; width: 281px; text-align: center; background: #fdeaec; border: 1px solid #b08694;}
#productAttributes {background-color: #fdeaec;}
.wrapperAttribsOptions {margin: 0.3em 0em;	text-align: left; background-color: #fdeaec;}
#attribsOptionsText {margin: 0; padding: 0.5em 5px; border: 1px solid #b08694; background-color: #d6477d;	color: #FFF; text-align: center; }
.optionName {color: #580c84; margin: 0; font-weight: bold; padding-left: 3px; text-align: left; background: #fdeaec; width: 8em;}
#cartAdd {margin: 1em; padding: 3px; font-size: 1em; /*width: 100px; height: 75px;*/ text-align: center;	/*border: 2px dotted blue;	background-color:  #fdeaec;*/}
#cartImage {margin: 0.5em 1em;}

Have you made any changes to your tpl_product_info_display.php? If you have, can you attach it here so I can take a look where You'll need to make the additional changes.

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

21 May 2006, 6:39 PM
#9
angela183 avatar

angela183

New Zenner

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

Post #9 by angela183

hi! thanks for that! i will give it a try momentarily.
i have not really made too many changes to template_info_display. i tried to attatch it in a word doc. but it wont let me because the file is too big. so should i email it to you or what do you think i should do?

21 May 2006, 6:53 PM
#10
clydejones avatar

clydejones

Deceased

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

Post #10 by clydejones

Not a problem. Here are the changes you'll need.

<br class="clearboth" />
<div id="buybox" class="forward">
<!--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
  }
?>
<br class="clearboth" />
<!--eof Attributes Module -->
<!--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-->
</div>

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

Try it and let me know if it works.

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

21 May 2006, 7:20 PM
#11
angela183 avatar

angela183

New Zenner

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

Post #11 by angela183

ok i tried that. added the css code provided to the bottom of my stylesheet page. i dont believe there were any repeats in the code (that i know of)
then begining at <!--bof attributes module--> and ending at <!--eof Product details list --> i replaced that with the code you provided and it didnt work :(

you can see the code for both my temp_info_display and my css by clicking here (scroll down for the css its on the same page but further down).

21 May 2006, 7:52 PM
#12
clydejones avatar

clydejones

Deceased

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

Post #12 by clydejones

Are you using the classic template with version 1.3.0.1?

If so you are actually using two stylesheets (stylesheet_original and stylesheet_new)

"classic" was included with v1.3.0.1 to be backwards compatable with earlier versions that contained tables. Since the new version is almost tableless its better to start clean.

Your best bet is to make your own template and use just one stylesheet. start clean with template_default.

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

21 May 2006, 7:56 PM
#13
angela183 avatar

angela183

New Zenner

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

Post #13 by angela183

yes i am using that version and i have two templates, not sure how to make just one tho. sorry im new to zen so not really sure. but thank you for your help

21 May 2006, 8:05 PM
#14
angela183 avatar

angela183

New Zenner

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

Post #14 by angela183

wait i didnt mean i have two templates. i have two stylesheets
stylsheet new and stylesheet original

21 May 2006, 8:13 PM
#15
clydejones avatar

clydejones

Deceased

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

Post #15 by clydejones

Do you have a url for your site I could look at?

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

21 May 2006, 8:19 PM
#16
angela183 avatar

angela183

New Zenner

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

Post #16 by angela183

well yes its my sisters site. trying to help her out as we work on finishing it together. :smile: you can click here to access it and here for the product page that im trying to fix.

21 May 2006, 8:55 PM
#17
clydejones avatar

clydejones

Deceased

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

Post #17 by clydejones

OK, try this.

use stylesheet.css from template_default -> css

make changes to your colors etc in this stylesheet

add the stylesheet code I gave you - double check for duplicates.

delete stylesheet_new and stylesheet_original from your server and upload the single stylesheet.

This is a bit of work in the beginning but worth it later when upgrading or making additions later on.

PS I like the look of the site

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

21 May 2006, 9:22 PM
#18
angela183 avatar

angela183

New Zenner

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

Post #18 by angela183

thanks clyde
ill try that. it may take forever though. i basically have to start over and redo my whole stylesheet right?
whenever i finish, ill let you know if it works
thanks for your compliment on the site! and thanks for all your help!

21 May 2006, 10:10 PM
#19
angela183 avatar

angela183

New Zenner

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

Post #19 by angela183

clyde!
it worked! i havent changed my stylesheet to one sheet yet because I dont want to mess with that now so what i did was enter that code in both sheets (stylesheet new and original) and it displayed! but the only thing is, the box is wider than it should be. how would i make it fit exactly around the text. I'm so excited that it works! thanks
see:
http://shopjackiesjewels.com/index.php?main_page=product_info&cPath=1&products_id=21

21 May 2006, 11:36 PM
#20
clydejones avatar

clydejones

Deceased

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

Post #20 by clydejones

I'm checking now.

I thhink there must be a duplicate of one of the CSS ID's that is pushing everything to the right within 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.