Products in promotion

  • Posts: 134
  • Thank you received: 6
9 years 8 months ago #193248

-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.0
-- Joomla version -- : 3.3.6

Hi,

I would like to list all the products from all the vendors, that have discounts. Is there a way to?
I tried using product_sales as Ordering field, in HikaShop options, but it is not the case.

Thank you!

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 8 months ago #193276

Hi,

It will first depends on how you set discounts on the products.

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.

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

  • Posts: 134
  • Thank you received: 6
9 years 8 months ago #193291

There is an example of discount that is not listet this way.

What is the wright way to set them or could I find example somewhere?

Regards

Attachments:

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

  • Posts: 134
  • Thank you received: 6
9 years 8 months ago #193293

The only way that I found searching the forum is by adding all the discounted products in a category and then listing that category. But for the multivendor case where each of the vendors creates his own discounts this is not so suitable.

Is there another way to do that?

Thank You!

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 8 months ago #193319

Hi,

That's right, there is no such kind of filter in the HikaShop product listing (menu/modules).
But it is possible to add such feature using a plugin and there are two different solutions for the implementation.

You can use a plugin which will add settings when you configure a product listing menu/module (like HikaMarket do for the settings "show sold by" or "link vendor category to vendor page").
Then the plugin can read the setting when a product listing is displayed.

The other solution is to have a plugin which contains the ID of the modules/menu it has to filter.
The plugin "hikashop / productvendorfilter" currently do this job and you can use this plugin as a base for a new one.
Thanks to it, you can copy the plugin (to have a new one) and change the part of the filter

$vendor = hikamarket::loadVendor(false);
$filters[] = 'b.product_vendor_id = ' . (int)$vendor;
Into something like
$c .= ' INNER JOIN ' . hikashop_table('discount').' AS discount ON discount.discount_type = \'discount\' AND (discount.discount_product_id = b.product_id OR discount.discount_product_id LIKE CONCAT(\'%,\', b.product_id, \',%\')';
$filters[] = 'discount.discount_published = 1';
$filters[] = '(discount.discount_start = 0 OR discount.discount_start >= ' . time().')';
$filters[] = '(discount.discount_end = 0 OR discount.discount_end <= ' . time() .')';
(which should be improve if you want to manage the ACL ; I did not test it so I can't guarantee that it will work directly).

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: filiar

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

  • Posts: 134
  • Thank you received: 6
9 years 8 months ago #193343

Thank You, Jerome.

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

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