Additional characteristics of the product cycle are displayed in the sort order in the administrative part. They even have a separate template modules/shop/views/shop.view.param.php.
But it so happens that you need some particular characteristics bring in a certain place. For example, there is a characteristic "Color" and the information to us about the color you want to display in this form:
Example:
Colors:
There are two ways to select characteristic: by identifier and name.
An array of features with an identifier called – $result["names_param"]
. In this case, the code will be:
Example:
if(! empty($result["names_param"]["Color"]))
{
echo 'Color: ';
foreach($result["names_param"]["Color"]["value"] as $value)
{
echo '<img src="/img/box_';
switch($value)
{
case 'Yellow';
echo 'yellow';
break;
case 'Red';
echo 'red';
break;
case 'Green';
echo 'green';
break;
}
echo '" alt="'.$value.'">';
}
}
In the example, we were taken to the type of response "select multiple". For it is given several values, so the variable $result["names_param"]["Color"]["value"] is defined as an array. All other variables have a single value. For example, characteristics for the text "Material" will be the following code:
Example:
if(! empty($result["names_param"]["Material"]))
{
echo 'Material: '.$result["names_param"]["Material"]["value"];
}
If you want to use instead of the identifier, then turn to the array $result["ids_param"]
.
Example:
if(! empty($result["ids_param"][3]))
{
echo $result["ids_param"][3]["name"].': '.$result["ids_param"][3]["value"];
}
The above discussed cases in which characteristics an item card. In other cases, we replace $result
on $row
. To display the characteristics in the block or the list, make sure the appropriate option should be marked for it.
An example can be applied to "Ads" module.
Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor #1 include_once() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499] #2 Docs_model->prepare_text( Additional characteristics of the product cycle are displayed in the sort order in the administrative part. They even have a separate template *modules/shop/views/shop.view.param.php*. But it so hap...) called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:94] #3 Docs_model->show() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.php:29] #4 Docs->init() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:474] #5 Init->module() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:119] #6 Init->start() called at [/var/www/diafan/data/www/diafancms.com/index.php:62] | /var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499 |