Move products with a temporary price to a category

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 4 months ago #326862

-- url of the page with the problem -- : www.joomla-webshops.nl
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23

Hi,

I have products with a temporary discounted price. The price is added as an additional price with start and end date.
Now i would like to move automaticly these products in a discount category. and remove them when this price ends.

Some discounts starts 01-12-2020

In the massaction i have
price_start_date < {time}

But it counts 0 products

I think {time} isn't working in this case, but what do i need to fill in here?

Thanks in advance

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 4 months ago #326876

Hi,

The {time} tag should work fine on the price_start_date. In fact, it works on my end.

Could you provide a screenshot of the settings of your massaction ?

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 4 months ago #326883

Hi,

Hereby some screenshots.



Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 4 months ago #326901

Hi,

So what is the action of your mass action ?
What is displayed when you "process" it manually ?

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 4 months ago #326979

When i process manually or cron it works.
So it seems a false count of results only

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 4 months ago #327048

Hi,

Ah yes, the count of results doesn't take into account the {time} tag.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 3 months ago #327855

Hi,

I still have trouble with this option:

I set up the mass action like this ("verwijder" = remove the category ACTIE when the price-end-date is lower than actual date)




When i look at the product the end date was 23 december but the category ACTIE is still there



Even when i manual trigger this massaction it doesn't work.

Do you have any idea whats going wrong?

Thanks in advance

Attachments:
Last edit: 3 years 3 months ago by Joomill.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 3 months ago #327856

Hi,

I'm not sure.
Try changing the line:

$query->where[] = 'hk_price.'.$filter['type'].' '.$filter['operator'].' '.$db->quote($filter['value']);
to:
$query->where[] = $this->massaction->getRequest($filter,'hk_price');
in the file plugins/hikashop/massaction_product/massaction_product.php and see how it goes.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 2 months ago #328630

Hi Nicolas,

This removes all products, even when they have no end date (these products need to stay in this category)

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 2 months ago #328676

Hi,

Well yeah. My code fix was to properly process the {time} tag for filters in the "price" table as this didn't without this change.
However, what I see in your screenshot is that it will take into account all the products with a price end date smaller than "now". And when you don't enter anything in the setting it will still consider that it is smaller than "now".
So what you're saying is that my code change does fix the problem you reported initially.
Now you just need to fix your mass action and have a second filter on that same column with the condition "> 0" so that it skips products without a price end date.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 2 months ago #328700

Hi,

I changed the code:



Added a price with end-date (in the past):


And changed the mass-action filters like:


But the product is not removed from the category.
Do i miss something else?

Attachments:

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

  • Posts: 4508
  • Thank you received: 610
  • MODERATOR
3 years 2 months ago #328704

Hello,

It's quite strange that you don't have any displayed results in your screenshot, have a look on mine :



A little tricks to create your mass-action, first set your filters and for your action choose display the results & define which columns of your targeted elements to see.
From my screenshot this will display 124 products (results), then define your actions like my screenshot.

If you have defined an action and nothing is processed, then provide your complete massaction screenshot.
Awaiting your returns to progress on your subject.

Regards

Last edit: 3 years 2 months ago by Philip.

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

  • Posts: 200
  • Thank you received: 9
  • Hikashop Multisite
3 years 2 months ago #328730

Yes it seems to work now.
Thanks Philip

The following user(s) said Thank You: Philip

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

Time to create page: 0.114 seconds
Powered by Kunena Forum