Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I add a background image (custom box) for the product attributes section?

How do I add a background image (custom box) for the product attributes section?

Views: 1,936

Results 1 to 16 of 16
17 Mar 2011, 9:07 PM
#1
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

How do I add a background image (custom box) for the product attributes section?

I am using ZenCart 1.3.9h and I want to have a custom box (image) as the background to where the product options are displayed. I would also like the Add To Cart box inside the attributes image box. Any suggestions on how best to implement this?

Thanks!

Michelle :smile:

17 Mar 2011, 9:25 PM
#2
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

mleahy:

I am using ZenCart 1.3.9h and I want to have a custom box (image) as the background to where the product options are displayed. I would also like the Add To Cart box inside the attributes image box. Any suggestions on how best to implement this?

Thanks!

Michelle :smile:

This might hlep with change tha background. in you styleseet.css you find :

#productAttributes {
padding: 10px 14px;
margin: 10px 0;
border: 1px #f3ecd9 solid;
background: #fcfcea; (change this to the image you like)
**like this : ** background-image:url(https://www.test.com/images/test.jpg)
}

17 Mar 2011, 10:07 PM
#3
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

Petlife:

This might hlep with change tha background. in you styleseet.css you find :

#productAttributes {
padding: 10px 14px;
margin: 10px 0;
border: 1px #f3ecd9 solid;
background: #fcfcea; (change this to the image you like)
**like this : ** background-image:url(https://www.test.com/images/test.jpg)
}

Thanks for the quick response. My template, my default template and classic stylesheet.css don't have the productsAttributes definition. Which makes me wonder because it is called in the file tpl_modules_attributes.php in the includes/templates/default_template directory. I'm wondering if that file isn't being used in my version.

Any thoughts?

17 Mar 2011, 10:14 PM
#4
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

what is the link to a product with attributes on your site. Then i can see a bit more an maybe help a bit more.. :D

17 Mar 2011, 10:34 PM
#7
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

Petlife:

I it possible that you can attach the styleseet, ??

I think so...

I had to make it a .doc file because the upload tool here doesn't allow .css file extensions. Hopefully you will be able to open it. :smile:

17 Mar 2011, 10:49 PM
#8
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

mleahy:

I think so...

I had to make it a .doc file because the upload tool here doesn't allow .css file extensions. Hopefully you will be able to open it. :smile:

im not shure but try adding this in the buttom of you stylesheet.

#productAttributes {
padding: 10px 14px;
margin: 10px 0;
border: 1px #333333 solid;
background-color:#333333}

What happens.. it shuld make the background af the attributes gray. does it do that???

if it do let me know så i can se it.

17 Mar 2011, 10:56 PM
#9
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

Petlife:

im not shure but try adding this in the buttom of you stylesheet.

#productAttributes {
padding: 10px 14px;
margin: 10px 0;
border: 1px #333333 solid;
background-color:#333333}

What happens.. it shuld make the background af the attributes gray. does it do that???

if it do let me know så i can se it.

It didn't have any effect. I think that it is because it productAttributes isn't being used anywhere. :dontgetit

17 Mar 2011, 11:02 PM
#10
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

mleahy:

It didn't have any effect. I think that it is because it productAttributes isn't being used anywhere. :dontgetit

Actually, I take that back, it does seem to be used in the following:

includes/templates/theme334/templates/tpl_product_info_display.php calls tpl_modules_attributes.php as follows:

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

and

/includes/templates/template_default/tpl_modules_attributes.php uses productAttributes as follow:

*/
?>

<div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3> <?php } // show please select unless all are readonly ?>

Any idea why it isn't showing the box?

17 Mar 2011, 11:07 PM
#11
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

My bad :huh:

It seems like the theme you are using dosen't use a overall css style for the attributes, that might have somthing to do with that.

It might be that the coding for the attributes in the php files have to be changed, but thats no my strong site.. sorry.. :cry:

17 Mar 2011, 11:10 PM
#12
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

Any idea why it isn't showing the box?

Okay, I accidentally edited the wrong stylesheet.css (I had a couple open). :blush:

Now the additions you suggested did work and I have a gray box around the attributes. I'll try adding the image now and see how it looks.

Thanks!

Any suggestions on how to put the Add to cart box inside the attribute box?

:smile:

22 Mar 2011, 6:40 PM
#13
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

I think it is the theme thats set up not using the brox around the attributes, but i hope a more experince Zenér ho can tell you have to do this.. im running out of options:shocking:

23 Mar 2011, 9:32 PM
#14
petlife avatar

petlife

New Zenner

Join Date:
Jun 2010
Location:
Denmark
Posts:
62
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

hey I can see that you have bin trying yourself.

I have a solution that might lock even better :

Change the #productAttributes in the stylesheet to this:

#productAttributes {
    background-image: url("http://naughticorner.com/Store/images/Add_To_Cart_Box_Short.jpg");
    border: 0px solid #333333;
    margin: 10px 0;
    padding: 10px 14px;
    background-repeat: no-repeat;
    background-size: 234px;
    height: 138px;
}

Then change .wrapperAttribsOptions in the stylesheet to this:

.wrapperAttribsOptions {
    display: inline-block;
    margin: 0.3em;
    margin-top: 1em;
}

And add this to the stylesheet :

#attribsOptionsText {
    margin-top: -1em;
    margin-left: -1em;
}

Remember its just at suggestion :D Hope you like it

**Before you change something be sure to make at backup :) **

28 Mar 2011, 6:14 PM
#15
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

Petlife:

hey I can see that you have bin trying yourself.

I have a solution that might lock even better :

Change the #productAttributes in the stylesheet to this:

#productAttributes {
background-image: url("http://naughticorner.com/Store/images/Add_To_Cart_Box_Short.jpg");
border: 0px solid #333333;
margin: 10px 0;
padding: 10px 14px;
background-repeat: no-repeat;
background-size: 234px;
height: 138px
;
}

> Then change .wrapperAttribsOptions in the stylesheet to this:
> ```
.wrapperAttribsOptions {
    display: inline-block;
    margin: 0.3em;
    margin-top: 1em;
}

And add this to the stylesheet :

#attribsOptionsText {
margin-top: -1em;
margin-left: -1em;
}

> 
> Remember its just at suggestion :D Hope you like it
> 
> **Before you change something be sure to make at backup :)  **

Thanks for the suggestions.  I will try them.  I took a little break from the project to get my taxes done, but now I am back into it.  I'll let you know how it goes....

- Michelle :smile:
28 Mar 2011, 6:53 PM
#16
mleahy avatar

mleahy

New Zenner

Join Date:
Nov 2010
Posts:
27
Plugin Contributions:
0

Re: How do I add a background image (custom box) for the product attributes section?

mleahy:

Thanks for the suggestions. I will try them. I took a little break from the project to get my taxes done, but now I am back into it. I'll let you know how it goes....

  • Michelle :smile:

I tried your suggestions and I also made the image fit the space better, and now it looks great. Take a look:

http://www.naughticorner.com/StoreNextUpgrade/index.php?main_page=product_info&cPath=76_77&products_id=106

Now I just have to figure out how to get the Add To Cart Box to sit on top of the image (shift it down) and how to get the spacing and alignment correct on the attributes and their options.

:smile:

P.S. I didn't put the last part you suggested in:

#attribsOptionsText { margin-top: -1em; margin-left: -1em; }

because it moved the attributes too far up to the top left of the box.