Skip to main content

Vendor number of items is including characteristic

11 years 8 months ago #195226 by tomhika
-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.1
-- Joomla version -- : 3.4
-- PHP version -- : 5.4

On the vendor control panel under "total products" the vendor see a number that reflects not the actual items but the total number of different characteristics.

For example, vendor has 4 shirts and each has 4 sizes, S, M, L, XL. The "total product" under the vendor's panel will show 16 products instead of 4

How can I make it show just 4?

thank you.

Please Log in or Create an account to join the conversation.

11 years 8 months ago #195249 by Jerome
Hi,

In the file "administrator/components/com_hikamarket/classes/statistics.php" you will find the different "requests" that HikaMarket can perform for the statistics in the control panel.

The first one (products_count) in the "getVendor" function is the request which count the number of products.
The idea is to add a filter to just count the products with the" product_type = 'main' ":
Replacing:
Code:
'filters' => array( 'product_published' => 'product.product_published = 1', 'product_vendor_id' => ('product.product_vendor_id = ' . (int)$vendor_id) )
By
Code:
'filters' => array( 'product_published' => 'product.product_published = 1', 'product_type' => 'product.product_type = ' . $this->db->Quote('main'), 'product_vendor_id' => ('product.product_vendor_id = ' . (int)$vendor_id) )
I think I will integrate this modification into HIkaMarket.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: tomhika

Please Log in or Create an account to join the conversation.

11 years 8 months ago #195265 by tomhika
Thank you again Jerome, Yes that was it.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.055 seconds
Powered by Kunena Forum