Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to add extra field values to the product list page
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #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,531
 

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).
__________________
redli.me | xcarthelp.com
custom mods and design integration
4.7 linux
Reply With Quote
  #12  
Old 03-29-2016, 01:39 PM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

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

There is no [extra_fields] section.

Code:
) [2] => Array ( [productid] => 25 [productcode] => 01PB03041R [provider] => 1 [distribution] => [weight] => 0.00 [net_weight] => 0.00[list_price] => 0.00 [avail] => 0 [rating] => 0 [forsale] => Y [add_date] => 1459014062 [shipping_freight] => 0.00 [free_shipping] => N [discount_avail] => Y [min_amount] => 1 [length] => 0.00 [width] => 0.00 [height] => 0.00 [low_avail_limit] => 10 [free_tax] => N [product_type] => N [manufacturerid] => 0 [return_time] => 0 [meta_description] => [meta_keywords] => [small_item] => N [separate_box] => N [items_per_box] => 1 [title_tag] => [taxcloud_tic] => 00000 [avatax_tax_code] => [is_variants] => [is_product_options] => [is_taxes] => [variantid] => 0 [price] => 3.67 [product] => 01 Light Duty Rigid Plate [descr] => 01 Light Duty Rigid Plate [fulldescr] => 01 Light Duty Rigid Plate [taxed_price] => 3.67 [is_image_T] => 1 [tmbn_url] => FAKEURL.com/images/T/LD_01Series_300-T-22.jpg [image_x] => 150 [image_y] => 150 [tmbn_x] => 150 [tmbn_y] => 150 [appearance] => Array ( [empty_stock] => [has_price] => 1 [has_market_price] => [buy_now_enabled] => [buy_now_form_enabled] => 1 [min_quantity] => 1 [max_quantity] => 50 [buy_now_buttons_enabled] => 1 [force_1_amount] => [added_to_cart] => [quantity_input_box_enabled] => [is_auction] => [buy_now_cart_enabled] => 1 [loop_quantity] => 51 [buy_now_add2wl_enabled] => ) [page_url] => product.php?productid=25&cat=22&page=1 ) [3] => Array

I double checked, there are extra fields, the module is turned on and the values are showing on the customer product page.
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
  #13  
Old 03-29-2016, 01:45 PM
  cherie's Avatar 
cherie cherie is offline
 

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

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

I did some testing and my hunch about the new $obtain_extra_fields variable is correct. Before the include/search.php line add the following:

PHP Code:
$obtain_extra_fields 1
__________________
redli.me | xcarthelp.com
custom mods and design integration
4.7 linux
Reply With Quote

The following user thanks cherie for this useful post:
zone1creative (01-08-2019)
  #14  
Old 03-29-2016, 03:07 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,427
 

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

https://forum.x-cart.com/showthread.php?t=73783
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:41 AM.

   

 
X-Cart forums © 2001-2018