Forums / Addon Templates / Flexible Attributes addon support

Flexible Attributes addon support

Results 1 to 20 of 274
31 Dec 2009, 05:33
#1
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Flexible Attributes addon support

Flexible Attributes has been submitted to Free Addons.

This mod allows control over the display of individual attributes on the product info page. Each attribute can be styled globally to affect it in all products which use it, or with a per-product stylesheet to affect its display in only one product.

All user customization is done through the stylesheet (example stylesheet included).

An optional SQL patch is included to allow longer Option Name comments if desired.
31 Dec 2009, 06:01
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

An example of this mod in use can be seen at www.nyfaeriefest.com . Click on "Artist Vendors", then "Artist Vendor Application". This is an extreme example, showing a "product" turned into an application form which collects a wide variety of types of info including images and saves it to the database.

On a more ordinary level, attributes can be organized into columns or given individual styling for whatever purposes may arise.
01 Jan 2010, 15:44
#3
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Posts:
6,940
Plugin Contributions:
24

Re: Flexible Attributes addon support

Thank you for contributing this great mod!
24 Mar 2010, 17:48
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

Are you wanting to get the dropdown to be under the "Number of 2-Page Spreads" text? Add to your stylesheet

#wAttrib-2 .back {float: none;}
27 Mar 2010, 18:01
#6
gl3ny avatar

gl3ny

New Zenner

Join Date:
Dec 2009
Posts:
24
Plugin Contributions:
0

Re: Flexible Attributes addon support

Thank you so much, a great contribution!!!!:clap:

However, I'm having a bit of a problem getting a TEXT attribute to sit to the right of a RADIO attribute. Should this work or does it only work with dropdowns?

/*Promo Code (radios)*/
#wAttrib-5 {float:left;; margin:0; Padding:0 5px 0 30px;}
#wAttrib-5 label {float:left; text-align:right; width:84px; margin:0; padding:0;}
#wAttrib-5 .back{float:left; margin-top:3px;}
#attrib-5-9, #attrib-5-10, #attrib-5-11, #attrib-5-12{width:30px;}
/*Promo Code URL*/
#wAttrib-6 {clear:left; float:left; margin:0; Padding:0 5px 0 0;}
#wAttrib-6 label {float: left; text-align:right; width:100px; margin:0; padding:0;}
#wAttrib-6 .back{ margin-top:3px;}
27 Mar 2010, 19:12
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

I can't tell for sure what should be happening here, or what is actually happening on your site. A link to see it live will let me advise.
28 Mar 2010, 13:45
#8
gl3ny avatar

gl3ny

New Zenner

Join Date:
Dec 2009
Posts:
24
Plugin Contributions:
0

Re: Flexible Attributes addon support

gjh42:

I can't tell for sure what should be happening here, or what is actually happening on your site. A link to see it live will let me advise.



Thanks man! I fixed it now anyways with this:

/*Promo Code (radios)*/
#wAttrib-5 {clear:left; float:left; margin:0; Padding:0 5px 0 30px;}
#wAttrib-5 label {float:left; text-align:right; width:84px; margin:0; padding:0;}
#wAttrib-5 .back{float:left; margin-top:3px;}
#attrib-5-9, #attrib-5-10, #attrib-5-11, #attrib-5-12{width:30px;}
/*Promo Code URL*/
#wAttrib-6 {float:left; margin:0; Padding:0 5px 0 0;} Removed clear:left on this line
#wAttrib-6 label {float: left; text-align:right; width:100px; margin:0; padding:0;}
#wAttrib-6 .back{ margin-top:3px;}
29 Jun 2010, 18:16
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

Re [thread=47059]Side by side read-only attributes... possible? how?[/thread]

You can space out the attributes in a row by adding side margins or padding, such as this at the bottom of your stylesheet:
/*attribute layout*/
.wrapperAttribsOptions label {font-size: 1.0em;}/*make "label" elements match other text*/
h3#attribsOptionsText {display: none;}/*hide the "Please Choose:" heading*/
h4.optionName {font-size: 1.0em;}
.wrapperAttribsOptions+br.clearBoth {display: none;}/*allow floated attributes to sit side by side if desired*/
#wAttrib-3 {clear: left; float: left;}
#wAttrib-4 {float: left;}/*this will sit beside #wAttrib-3*/
#wAttrib-5 {float: left;}/*this will sit beside #wAttrib-4*/
/*#wAttrib-5 {clear: left;}*/ /*this will sit on a new line*/
/*#wAttrib-14 h4 {display: none;}*/
/*#wAttrib-15 h3  {font-size: 1em; font-weight: normal;}*/ /*make comments above attribute like standard text*/
/*#wAttrib-35 .attribsOptions {display: none;}*/ /*for a read-only attribute to hide all but comments*/

.attribsOptions {margin-right: 2.0em;}

Note also that CSS does not recognize the // comment; you need to use /* */ around the commented code as shown.
29 Jun 2010, 21:17
#10
fiddycent avatar

fiddycent

New Zenner

Join Date:
Apr 2007
Posts:
12
Plugin Contributions:
0

Re: Flexible Attributes addon support

Thanks for the spacing tip! Worked perfectly.

Does your mod also allow attributes to list the option values themselves side by side instead of in a vertical list? Such as:

Style 1: Small, Medium, Large
Style 2: Small, Medium, Large

I'm just trying to figure out the cleanest way to list read-only attributes. My ideal would be a table of some kind, but I'm not sure if the Product Attribute Grid add-on works with read-only attributes.
30 Jun 2010, 10:35
#11
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: Flexible Attributes addon support

Hi we have downloaded the flexible attributes which is great :D
but we would like all the attributes to sit to the right of the picture
in list format ie one under the other and the option names above eg

Name
dropdown
Size
dropdown
image
dropdown
etc etc.....

is there a way we can acheive this if so how?

thanks
30 Jun 2010, 10:46
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

Let's see your site so I can give accurate advice for your specific layout.
30 Jun 2010, 13:29
#14
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: Flexible Attributes addon support

think we may have sorted it put padding-right which moved them all down :D
just wondering if you have to duplicate all the attributes in the stylesheet to get the same layout for all, or whether there is a way of making all attributes in the stylesheet across the site do the same.
ie on tshirts the attributes 1,3,4,5 and 6 are all laying to the right of the image but on our cushions attributes 12,13,14,15 are laying to the right hand side.:frusty:
30 Jun 2010, 15:08
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

If you want an effect for specific attributes, use a selector like #wAttrib-1, #wAttrib-2 {}.
If you want styling to apply to all attributes, you can use .wrapperAttribsOptions {}.
30 Jun 2010, 15:24
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

If you want most of the attributes to sit one per row, but certain small ones to sit to the right of the preceding attribute, you can add to your stylesheet

.wrapperAttribsOptions {width: 300px;}

and then add to #wAttrib-6 {
...
width: auto;
}

Eliminate the paddings as they may interfere with the widths in some cases.
02 Jul 2010, 11:28
#17
artifaxworthing avatar

artifaxworthing

New Zenner

Join Date:
Mar 2010
Posts:
74
Plugin Contributions:
0

Re: Flexible Attributes addon support

we are still struggling with the flexible attributes.

we added the 300px width to the wrapperAttribsOptions in the css stylesheet and it moved all the attributes beneath the image.

We want to achieve the image on the left hand side and then the attributes listed one beneath each other to the right of the image but left hand aligned. We want to apply this to all attributes on all products.

How is the easiest way to achieve this, we have tried padding and margins but we would need to apply that to each individual attribute(and we have loads!!!)

www.artifaxonline.co.uk/t-shirts
02 Jul 2010, 14:45
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

Looks like you have figured out enough of the CSS to get the attributes located. Floating them right with a width more than half the column width also takes care of the case where they go lower than the main image.

The last thing you need to do is get the discount box to stay below the rest. Add to your stylesheet

#productQuantityDiscounts {clear: left;}

if you want it just below the image, or

#productQuantityDiscounts {clear: both;}

if you want it below the add button.


Also, you don't need to apply universal styling to attributes one at a time; all #wAttrib-x elements are also .wrapperAttribsOptions elements, so styling .wrapperAttribsOptions will automatically apply to any that are not individually styled with #wAttrib-x.
15 Jul 2010, 19:42
#19
horsetags avatar

horsetags

New Zenner

Join Date:
Jun 2009
Posts:
44
Plugin Contributions:
0

Re: Flexible Attributes addon support

Hi

Is this ok to use with 1.3.9d please?

Tia

Paul
15 Jul 2010, 20:12
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Flexible Attributes addon support

I haven't tested it yet, but one file in the mod has changed for v1.3.9: /includes/modules/attributes.php.
There is only one added line of mod code in that file (around line 606), so it should be extremely easy to apply that to the new version - just copy/paste that line in the appropriate place in the new file.[php]
$options_wrapper_id[] = 'wAttrib-' . $products_options_names->fields['products_options_id'];//gjh42[/php]

I will get the download updated as soon as some testing for another improvement to the mod is finished.