The developers who originally built our site did some customisation which I need to add to, the following is an example of a variable in the code.
$product.product_features.11.value
```<br />
<br />
The number obviously corresponds to a 'Product Feature but what I don't know is how to find out what feature corresponds to what numbers, there seems to be no logic to the numbering to even guess at so how can I find the id number of a newly added feature?
The ID can be found the URL on the “Update feature” page in the admin panel
I never noticed that as i'm using 3.x which opens up the option is a viewer, opened it in a new window and all is good
Thanks
In this case you can simply hover over the Edit link and check the ID in the status bar of your browser
How do adapt this for version 4.3.7.
I want to pull the a variable feature values.
How do adapt this for version 4.3.7.
I want to pull the a variable feature values.
It should work on 4.3.x versions also
Thanks, i tried using the following -
$product.product_features.33.variant_id
- this gives me the right variant_id
$product.product_features.33.variant_id.variant
$product.product_features.33.variant
- this will not give me the variant value needed. As the feature is a select box option and not a text it will not port the value from `cscart_product_feature_variant_descriptions` - variant - any ideas anyone.
Untested:
$product.product_features.33.variants.{$product.product_features.33.variant_id}.variant
You can print the content of the product_features array in the following way:
{$product.product_features|fn_print_r}
Post the result here so that we can help you
[58] => Array
(
[feature_id] => 58
[company_id] => 1
[feature_type] => S
[parent_id] => 29
[display_on_product] => Y
[display_on_catalog] => N
[display_on_header] => N
[description] => Brand
[lang_code] => en
[prefix] =>
[suffix] =>
[categories_path] =>
[full_description] =>
[status] => A
[comparison] => N
[position] => 0
[group_position] => 0
[value] =>
[variant_id] => 71074
[value_int] =>
[variants] => Array
(
[71074] => Array
(
[variant_id] => 71074
[variant] => snom
[description] =>
[page_title] =>
[meta_keywords] =>
[meta_description] =>
[lang_code] => en
[feature_id] => 58
[url] =>
[position] => 0
[selected] => 71074
[feature_type] => S
[seo_name] =>
[seo_path] =>
[image_pair] =>
)
)
)
[33] => Array
(
[feature_id] => 33
[company_id] => 1
[feature_type] => S
[parent_id] => 29
[display_on_product] => Y
[display_on_catalog] => N
[display_on_header] => Y
[description] => Condition
[lang_code] => en
[prefix] =>
[suffix] =>
[categories_path] =>
[full_description] =>
[status] => A
[comparison] => N
[position] => 0
[group_position] => 0
[value] =>
[variant_id] => 22070
[value_int] =>
[variants] => Array
(
[22070] => Array
(
[variant_id] => 22070
[variant] => New
[description] =>
[page_title] =>
[meta_keywords] =>
[meta_description] =>
[lang_code] => en
[feature_id] => 33
[url] =>
[position] => 1
[selected] => 22070
[feature_type] => S
[seo_name] =>
[seo_path] =>
[image_pair] =>
)
)
)
[37] => Array
(
[feature_id] => 37
[company_id] => 1
[feature_type] => T
[parent_id] => 29
[display_on_product] => Y
[display_on_catalog] => N
[display_on_header] => N
[description] => GTIN
[lang_code] => en
[prefix] =>
[suffix] =>
[categories_path] =>
[full_description] =>
[status] => A
[comparison] => N
[position] => 0
[group_position] => 0
[value] => 4260059581967
[variant_id] => 0
[value_int] =>
)
[35] => Array
(
[feature_id] => 35
[company_id] => 1
[feature_type] => T
[parent_id] => 29
[display_on_product] => Y
[display_on_catalog] => N
[display_on_header] => N
[description] => MPN
[lang_code] => en
[prefix] =>
[suffix] =>
[categories_path] =>
[full_description] =>
[status] => A
[comparison] => N
[position] => 0
[group_position] => 0
[value] => D375
[variant_id] => 0
[value_int] =>