Skip to main content

Move products with a temporary price to a category

More
5 years 9 months ago #326862 by Joomill
-- 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.

More
5 years 9 months ago #326876 by nicolas
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.

More
5 years 9 months ago #326883 by Joomill
Hi,

Hereby some screenshots.

Attachment not found



Attachment not found

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

More
5 years 9 months ago #326901 by nicolas
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.

More
5 years 9 months ago #326979 by Joomill
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.

More
5 years 9 months ago #327048 by nicolas
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.

More
5 years 8 months ago - 5 years 8 months ago #327855 by Joomill
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)

Attachment not found




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

Attachment not found



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

Do you have any idea whats going wrong?

Thanks in advance
Last edit: 5 years 8 months ago by Joomill.

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

More
5 years 8 months ago #327856 by nicolas
Hi,

I'm not sure.
Try changing the line:
Code:
$query->where[] = 'hk_price.'.$filter['type'].' '.$filter['operator'].' '.$db->quote($filter['value']);
to:
Code:
$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.

More
5 years 8 months ago #328630 by Joomill
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.

More
5 years 8 months ago #328676 by nicolas
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.

More
5 years 7 months ago #328700 by Joomill
Hi,

I changed the code:

Attachment not found



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

Attachment not found



And changed the mass-action filters like:

Attachment not found



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

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

More
5 years 7 months ago - 5 years 7 months ago #328704 by Philip
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: 5 years 7 months ago by Philip.

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

More
5 years 7 months ago #328730 by Joomill
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.269 seconds
Powered by Kunena Forum