Forums / Templates, Stylesheets, Page Layout / Adding a "Size guide" link only if the "size" attribute is active in the product

Adding a "Size guide" link only if the "size" attribute is active in the product

Started by dsided on 8 Sep 2008, 10:46 PM · Views: 3,675

Results 1 to 12 of 12
8 Sep 2008, 10:46 PM
#1
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Adding a "Size guide" link only if the "size" attribute is active in the product

I have some products with a colour attribute (drop down) and some with a size attribute (drop down).

I'd like a link to "Size guide" (which goes to a static page) to appear when the product has Size attributes (just next to the drop down), but not appear for anything other products without a size option.

I'm looking in modules/attributes.php (which I assume is the right file) but I'd really appreciate some help with coding. Many thanks in advance!

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

14 Apr 2009, 11:39 AM
#2
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

Is this possible?

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

14 Apr 2009, 2:31 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

You might look at the Option Name and hit Edit ...

There is a Comment there that if used right can be used for a number of purposes and you can probably set it to a link to something ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Apr 2009, 4:14 PM
#4
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

Genius! That's exactly what I wanted - thanks!

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

14 Apr 2009, 4:32 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

Perhaps you could share how you did this for others ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

14 Apr 2009, 6:47 PM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

dsided:

Genius! That's exactly what I wanted - thanks!

Yeah, I'd be interested in your method as well. Presently, I insert size guides manually, never thought of automating it until now...

Care to share?

15 Apr 2009, 5:01 PM
#7
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

I will share the method - to be honest I haven't done it yet, just tested it in principle by adding an attribute comment and viewing the html source. Will report back shortly

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

21 Apr 2009, 7:29 PM
#8
dsided avatar

dsided

Zen Follower

Join Date:
Jun 2008
Posts:
128
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

As promised here is the method:

You'll first need to write "Size guide" under Attributes controller -> Option names then edit (in my case) the "Size" attribute, under "en: Comments:" add the text "Size guide"

Next edit a file called "tpl_modules_attributes.php" which is under the templates\YOURTEMPLATE\templates\tpl_modules_attributes.php

Look for the tag around line 25 called

<h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>

In my case we had designed text with an image, so I removed the H3 and replaced it with a div called sizeGuide with float: right;. I added the link to the size guide page then tweaked the positioning and added the image as a background.

Have a look at (called Size guide):
http://www.iamhappie.com/dresses/coco-flower-print-dress-p-249

John Crumpton, Technical Director of Double Sided
Zen cart shop: Buy happie loves it

4 May 2011, 6:51 PM
#10
noobgal avatar

noobgal

New Zenner

Join Date:
Jun 2010
Location:
Manchester, UK
Posts:
27
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

I don't suppose you could be a bit more specific about what the code is I need to put in and where could you? I am looking to do exactly this, managed to add Size Guide to my attribute comment but just need to do the coding in the tpl_modules_attributes.php, being as I am fairly new to all this coding stuff I could really use an idiots guide to what you did. :D

4 May 2011, 7:06 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

You don't necessarily have to edit tpl_modules_attributes.php at all. You can just style

h3.attributesComments {}

in your stylesheet with whatever properties you want.

7 May 2011, 12:55 PM
#12
noobgal avatar

noobgal

New Zenner

Join Date:
Jun 2010
Location:
Manchester, UK
Posts:
27
Plugin Contributions:
0

Re: Adding a "Size guide" link only if the "size" attribute is active in the product

Ok that sounds good, but bearing in mind I am a noob at this, I have managed to add an attribute comment but how to I create the hyperlink to my size guide from the comment? Sorry for being a dumb ###### :frusty: