Mass Action Filter Error

  • Posts: 39
  • Thank you received: 4
  • Hikashop Essential
1 week 1 day ago #366245

-- HikaShop version -- : 5.1.5
-- Joomla version -- : 4.4.12
-- PHP version -- : 8.2.27
-- Browser(s) name and version -- : Firefox 136.0.1
-- Error-message(debug-mod must be tuned on) -- : None

I have written a Mass Action to display the price_values of products that have a product_name containing the string boot.

Name: Display Selected Product Prices
Description: Show the prices of selected products with certain text in the product name.
Data: Product
Product: no triggers
Filters: Product columns > product_name Contains boot (35 results before Save)
Limitations > Start: 0 Value: 10000
Actions: Display the results (product_id, product_name, price_value)

Back in the Products section, I select all products and then select the Display Selected Product Prices button.

The table displayed shows 35 lines with the word boot. Unfortunately there are an additional 58 lines with product_names that do not contain that word.

Examples: F80 E Brake Handle, Z4 E85 Manual Shift Knob, E82 DCT Thick M Sport Steering Wheel.

If I switch to the CSV output, the results are the same.
If I switch the product_name filter to LIKE %boot%, the result is the same.
If I switch the product_name filter to REGEXP, .*boot.*, the result is still wrong.
If I try other strings in the product_name, the output still has more matches than it should.

What can I do to fix this problem?


Charles

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

  • Posts: 83486
  • Thank you received: 13507
  • MODERATOR
1 week 1 day ago #366246

Hi,

From what I understand you've activated the "actions as a button" setting of the mass action so that you get a button with the name of the mass action on the backend products listing.
And you're then using this button on the products that you select in the listing.
As the name of the setting implies, the button will only run the actions of the mass action on the product you select in your backend.

When you run a mass action with the "process" button, you don't select any product, so by default, it takes into account all the products. Thus, filtering is necessary.
We figured that there is little point in running the filters of the mass action when using the action button since you're the one selecting the products before clicking the action button.
So, if you select 93 products on the listing and click on the action button, the actions of the mass action will run on the 93 products, regardless of the filters configured in the mass action.

So it is not an error. The system is meant to work like this.
If you need to filter the products based on their name, you could just use the search input field at the top of the products listing to first filter the products listing, and then only select the remaining 35 products before clicking on the action button.

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

  • Posts: 39
  • Thank you received: 4
  • Hikashop Essential
1 week 1 day ago #366267

nicolas wrote: We figured that there is little point in running the filters of the mass action when using the action button since you're the one selecting the products before clicking the action button.
So, if you select 93 products on the listing and click on the action button, the actions of the mass action will run on the 93 products, regardless of the filters configured in the mass action.

That behaviour is not noted in the documentation. A cautionary note should be added to that page. I suggest, "Caution: Even though entered and saved, Mass Action filters might be ignored in some scenarios." Perhaps that will prompt the website Administrator to scrutinize the display and investigate further.


Charles

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

  • Posts: 83486
  • Thank you received: 13507
  • MODERATOR
1 week 21 hours ago #366268

Hi,

Thanks but this is already explained on the documentation page though. Here :
www.hikashop.com/support/documentation/1...ion-form.html#action

Here, we activate the "Actions as a button" setting of the mass action.
This will add an extra button to the corresponding listing in the backend with the name of the mass action as label of the button.
When the button will be pressed, the actions of the mass action will run on the selected elements.
Warning: Triggers, filters and limitations will be ignored when the action button is pressed. Only the actions will be processed.

Last edit: 1 week 1 day ago by nicolas.

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

  • Posts: 39
  • Thank you received: 4
  • Hikashop Essential
1 week 20 hours ago #366274

During some future software revision, you could also add the Warning to the Actions as a button tootip.


Charles

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

  • Posts: 83486
  • Thank you received: 13507
  • MODERATOR
1 week 7 hours ago #366277

That's a good idea. Thanks for the feedback.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum