Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Can't Get Hidden Products Rate Topic   - - - - -

 
  • dataspotgr
  • Advanced Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 65 posts

Posted 05 August 2022 - 10:08 AM #1

In the app/addons/my_addon/func.php I created a custom function and where I'm creating and XML

 

In order to fetch the products i use the following code:

$params = array(
    // 'status' => 'H',
    'statuses' => array('A', 'H'),
    'product_type' => 'P',
    'type' => 'extended',
    // 'pid' => 4801 //Pick one product id for testing
);

list($products, $search) = fn_get_products($params);
$total_products = $search['total_items'];

$additional_params = array(
    'get_discounts' => true,
    'get_features' => true,
);    
fn_gather_additional_products_data($products, $additional_params);

print_r($products);

exit();

It works fine and i get the products, but the problem is that it gets only active product and i want to get Hidden products as well, and that why i added 'statuses' => array('A', 'H') but it only get Active products

 

I even tryied to add only 'status' => 'H' in order to get only hidden products, but it doesn't work too, and i still don't get any products.



 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 1696 posts

Posted 05 August 2022 - 11:56 AM #2

Hello

 

Please try change params['area']

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl | marketplace | Multi-Vendor/CS-Cart Development | Dedicated developers

We specialize in creating the highest quality addons, safe, useful and flexible


 
  • dataspotgr
  • Advanced Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 65 posts

Posted 05 August 2022 - 12:33 PM #3

Oh,

 

Thank you a lot, that actually worked. I couldn't think of this.

 

Also, i found that the params['statuses'] doesn't work in this case.

I had to make the array on $params['status'] = array('A', 'H')

 

Correct me if i'm wrong