View Single Post
  #11  
Old 03-29-2016, 01:31 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: How to add extra field values to the product list page

print_r should be available if you enable DEVELOPMENT_MODE in config.php. Or you should be able to use debug_print_var.

In subcategories.tpl $cat_products gets assigned to $products when calling products.tpl.

Before your new code (or comment it out) in products.php, after includes/search.php (which gets the products and extra_fields), try adding something like this:

PHP Code:
echo'<!-- ';print_r($products);echo'-->'
Then look at the page source to see the products array. I'm curious to know if your array has an [extra_fields] section.

Dumb question: are you looking at a set of products that have assigned extra_field values in the admin?

I don't believe that SO link applies.

I believe Rob's solution was to get extra_fields that weren't known to already exist. This is a common oversight.

One thing I noticed is that as of 4.7.4 there is a new variable ($obtain_extra_fields) in include/search.php but I don't see it referenced anywhere else and has not stopped me from getting extra_fields normally (though it appears it should).
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote