Retrieve product feature data

I’ve been stumbling around CS-cart docs and examples for the past week and decided to give the forums a try.



Hopefully somebody can help ease the learning curve.



I’m trying to retrieve product.product_features information that’s available on the full product page but doesn’t seem to be available from the compact_list.tpl template i’m using on page that displays the newest 10 items. (see screenshot)



what’s the method of making database calls or requesting data? it seems that the product_features.tpl file has this information available to it already. (as seen using the smarty {debug})



Please help :)

product-features-cart-screenshot.png

Did you try seeing what the products array shows to you?



{product|print_r}

[quote name='solesurvivor' timestamp='1344631182' post='142667']

Did you try seeing what the products array shows to you?



{product|print_r}

[/quote]



Yeah, but I used {debug}



here's {$products} from the page using compact_list.tpl


Array (5)
0 => Array (48)
product_id => "2"
product_code => ""
product_type => "P"
status => "A"
company_id => "0"
list_price => "0.00"
amount => "1"
weight => "0.00"
length => "0"
width => "0"
height => "0"
shipping_freight => "0.00"
low_avail_limit => "0"
timestamp => "1344542400"
updated_timestamp => "1344606979"
usergroup_ids => "0"
is_edp => "N"
edp_shipping => "N"
unlimited_download => "N"
tracking => "B"
free_shipping => "N"
feature_comparison => "N"
zero_price_action => "R"
is_pbp => "N"
is_op => "N"
is_oper => "N"
is_returnable => "Y"
return_period => "10"
avail_since => "0"
out_of_stock_actions => "N"
localization => ""
min_qty => "0"
max_qty => "0"
qty_step => "0"
list_qty_count => "0"
tax_ids => ""
age_verification => "N"
age_limit => "0"
options_type => "P"
exceptions_type => "F"
details_layout => "default"
shipping_params => "a:5:{s:16:"min_items_in_box&..."
product => "Camo Cup Koozie"
price => "2.500000"
category_ids => Array (1)
0 => "1"
position => "0"
seo_name => "camo-cup-koozie"
main_category => "1"
1 => Array (48)
product_id => "3"
product_code => "" ... etc




and here's {$product} from a single product page:


Array (83)
min_items_in_box => "0"
max_items_in_box => "0"
box_length => "0"
box_width => "0"
box_height => "0"
product_id => "5"
product_code => ""
product_type => "P"
status => "A"
company_id => "0"
list_price => "0.00"
amount => "1"
weight => "0.00"
length => "0"
width => "0"
height => "0"
shipping_freight => "0.00"
low_avail_limit => "0"
timestamp => "1344542400"
updated_timestamp => "1344632879"
usergroup_ids => "0"
is_edp => "Y"
edp_shipping => "N"
unlimited_download => "N"
tracking => "B"
free_shipping => "N"
feature_comparison => "N"
zero_price_action => "R"
is_pbp => "N"
is_op => "N"
is_oper => "N"
is_returnable => "Y"
return_period => "10"
avail_since => "0"
out_of_stock_actions => "N"
localization => ""
min_qty => "0"
max_qty => "0"
qty_step => "0"
list_qty_count => "0"
tax_ids => ""
age_verification => "N"
age_limit => "0"
options_type => "P"
exceptions_type => "F"
details_layout => "default"
shipping_params => "a:5:{s:16:"min_items_in_box&..."
lang_code => "EN"
product => "900-245-1-23.1"
shortname => ""
short_description => "

test short descripti..."
full_description => ""
meta_keywords => ""
meta_description => ""
search_words => ""
page_title => ""
age_warning_message => ""
price => "7500.000000"
category_ids => Array (3)
0 => "2"
1 => "3"
2 => "5"
popularity => "8"
seo_name => "900-245-1-23.1-land-ny-westhampton"
sales_amount => "0"
discussion_type => "D"
base_price => "7500.000000"
main_category => "5"
main_pair => Array (5)
pair_id => "10"
image_id => "0"
detailed_id => "10"
position => "0"
detailed => Array (7)
image_path => "/store/images/detailed/0/900-245-1-23..."
alt => ""
image_x => "1028"
image_y => "699"
http_image_path => "/store/images/detailed/0/900-245-1-23..."
absolute_path => "/home/buyland/public_html/store/image..."
is_flash => "0"
image_pairs => Array (2)
11 => Array (5)
pair_id => "11"
image_id => "0"
detailed_id => "11"
position => "0"
detailed => Array (7)
image_path => "/store/images/detailed/0/900-245-1-23..."
alt => ""
image_x => "1200"
image_y => "657"
http_image_path => "/store/images/detailed/0/900-245-1-23..."
absolute_path => "/home/buyland/public_html/store/image..."
is_flash => "0"
12 => Array (5)
pair_id => "12"
image_id => "0"
detailed_id => "12"
position => "0"
detailed => Array (7)
image_path => "/store/images/detailed/0/900-245-1-23..."
alt => ""
image_x => "418"
image_y => "277"
http_image_path => "/store/images/detailed/0/900-245-1-23..."
absolute_path => "/home/buyland/public_html/store/image..."
is_flash => "0"
taxes => Array (0)
product_features => Array (1)
3 => Array (19)
feature_id => "3"
company_id => "0"
feature_type => "G"
parent_id => "0"
display_on_product => "1"
display_on_catalog => "1"
description => "Land"
prefix => ""
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => ""
value => ""
variant_id => ""
value_int => ""
subfeatures => Array (5)
7 => Array (18)
feature_id => "7"
company_id => "0"
feature_type => "T"
parent_id => "3"
display_on_product => "1"
display_on_catalog => "1"
description => "Annual Taxes"
prefix => ""
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => "0"
value => "$15.10"
variant_id => ""
value_int => ""
1 => Array (18)
feature_id => "1"
company_id => "0"
feature_type => "T"
parent_id => "3"
display_on_product => "1"
display_on_catalog => "1"
description => "Google Earth"
prefix => "[link=google]"
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => "0"
value => "http://maps.google.com/maps/ms?msid=2..."
variant_id => ""
value_int => ""
4 => Array (19)
feature_id => "4"
company_id => "0"
feature_type => "S"
parent_id => "3"
display_on_product => "1"
display_on_catalog => "1"
description => "Location"
prefix => ""
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => "0"
value => ""
variant_id => "7"
value_int => ""
variants => Array (7)
1 => Array (13)
variant_id => "1"
variant => "Flanders, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
2 => Array (13)
variant_id => "2"
variant => "North Sea, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
3 => Array (13)
variant_id => "3"
variant => "Northampton, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
4 => Array (13)
variant_id => "4"
variant => "Okeechobee, FL"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
5 => Array (13)
variant_id => "5"
variant => "Remsenberg, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
6 => Array (13)
variant_id => "6"
variant => "Southampton, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => ""
feature_type => "S"
seo_name => ""
7 => Array (13)
variant_id => "7"
variant => "Westhampton, NY"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "4"
url => ""
position => "0"
selected => "7"
feature_type => "S"
seo_name => ""
5 => Array (18)
feature_id => "5"
company_id => "0"
feature_type => "T"
parent_id => "3"
display_on_product => "1"
display_on_catalog => "1"
description => "Size"
prefix => ""
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => "0"
value => "11,260 s.f. (0.26 ac.)"
variant_id => ""
value_int => ""
6 => Array (19)
feature_id => "6"
company_id => "0"
feature_type => "M"
parent_id => "3"
display_on_product => "1"
display_on_catalog => "1"
description => "Type"
prefix => ""
suffix => ""
categories_path => "2"
full_description => ""
status => "A"
comparison => "N"
position => "0"
group_position => "0"
value => ""
variant_id => "9"
value_int => ""
variants => Array (2)
8 => Array (13)
variant_id => "8"
variant => "Recreational"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "6"
url => ""
position => "0"
selected => ""
feature_type => "M"
seo_name => ""
9 => Array (13)
variant_id => "9"
variant => "Residential"
description => ""
page_title => ""
meta_keywords => ""
meta_description => ""
lang_code => "EN"
feature_id => "6"
url => ""
position => "0"
selected => "9"
feature_type => "M"
seo_name => ""
detailed_params => Array (9)
info_type => "D"
get_icon => "1"
get_detailed => "1"
get_options => "1"
get_discounts => "1"
get_features => ""
get_extra => ""
get_taxed_prices => "1"
get_for_one_product => "1"
have_required => "N"
selected_options => Array (0)
product_options => Array (0)
options_update => "0"
changed_option => ""
base_modifier => "7500.000000"
original_price => "7500.000000"
modifiers_price => "0"
combination_hash => "2226203566"
has_options => ""
discounts => Array (2)
A => "0"
P => "0"
qty_content => Array (0)
tags => Array (2)
user => Array (0)
popular => Array (0)




I need access to (or poll the database for) the product_features array on the compact_list.tpl page for each product.

bump?

The printed array you provided shows a product_features array. Isn't that what you want?

The 'compact list' block only requests a sub-set of the product attributes. So you will either need to modify the requested fields sent to fn_get_product_data() or you will have to make a custom list block to retrieve the data you want and then display it appropriately.



Note that retrieving the data won't get it to display in that template.