04-21-2017, 08:16 AM
When using shopp() tags with dot notation, the options are the second argument
otherwise it will be the third argument
Options come in pairs
There is a name and a value for every option, for example
In this case, the name of the option is 'alt', the value is 'My Image'.
Multiple options
Most shopp() tags have multiple options you can set. To combine options you use the &-sign.
All the option name-value pairs combined, are within one pair of single quotes, no matter how many options you set.
Using variables in options
To make options even more flexible, you can also use variables to set the value.
Pay attention to the quotes, when you use variables you need to use double quotes.
Code:
shopp('Object.property', 'options');
otherwise it will be the third argument
Code:
shopp('Object', 'property', 'options');
Options come in pairs
There is a name and a value for every option, for example
Code:
shopp('product.coverimage', 'alt=My Image' );
In this case, the name of the option is 'alt', the value is 'My Image'.
Multiple options
Most shopp() tags have multiple options you can set. To combine options you use the &-sign.
Code:
shopp('product.coverimage', 'alt=My Image&size=300' );
All the option name-value pairs combined, are within one pair of single quotes, no matter how many options you set.
Using variables in options
To make options even more flexible, you can also use variables to set the value.
Code:
$size = 300;
shopp('product.coverimage', "alt=My Image&size=$size" );
Pay attention to the quotes, when you use variables you need to use double quotes.