Vendor number of items is including characteristic

  • Posts: 110
  • Thank you received: 6
9 years 1 month ago #195226

-- 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.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
9 years 1 month ago #195249

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:

	'filters' => array(
		'product_published' => 'product.product_published = 1',
		'product_vendor_id' => ('product.product_vendor_id = ' . (int)$vendor_id)
	)
By
	'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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: tomhika

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

  • Posts: 110
  • Thank you received: 6
9 years 1 month ago #195265

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.070 seconds
Powered by Kunena Forum