Can't Get Hidden Products

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.

Hello

Please try change params['area']

Best regards

Robert

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

Hello,

Hope you are doing well, maybe my issue has not to do with yours but maybe someone could help.

I tried to upload some product on my website but I am getting this error:

Error: Product must belong to some category created by the owner company

I can see the numbers of products on category page for each category but when I click there no products are shown

Can anyone help me with this?

Hello,

Hope you are doing well, maybe my issue has not to do with yours but maybe someone could help.

I tried to upload some product on my website but I am getting this error:

Error: Product must belong to some category created by the owner company

I can see the numbers of products on category page for each category but when I click there no products are shown

Can anyone help me with this?

Hello,

True, the issue is not relevant.. but do you have more than one storefronts? How are you trying to upload your products?

In general, categories is required field. Thus, is you want to upload / import products you need to have a category for them, too!

Hello,

True, the issue is not relevant.. but do you have more than one storefronts? How are you trying to upload your products?

In general, categories is required field. Thus, is you want to upload / import products you need to have a category for them, too!

Hello,

I am uploading the products through a cron script that gets the data from xml files. I have created the categories for each product, I can see for each category the exact number of products I have ( which is correct) so the products are imported but are not shown on the Products pages only 3 products are shown.

I have just one storefront,

Hello,

I am uploading the products through a cron script that gets the data from xml files. I have created the categories for each product, I can see for each category the exact number of products I have ( which is correct) so the products are imported but are not shown on the Products pages only 3 products are shown.

I have just one storefront,

I am using the API to do such things.. Actually, it did happen to me once, but trying to remember..

Propably, the products does not have the right category.

You could try to edit a product typing manually in the URL:

https://your-domain.gr/admin.php?dispatch=products.update&product_id=some-prouct-id

If you enter the product you could see the

- category

- price

- name

- company_id (if you have one storefront guess this value is company_id = 1)

- lang_code

which they are required fields.

What is the version of your CS-Cart?

Have you upgraded your store recently? There was a bug with incorrect connection of categories to store-fronts