-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.26
-- PHP version -- : 7.4.20
Hello Team,
I have made a massaction, with a filter on the product code and several actions to reset, configure the orders using the copy function from the administration order list.
We are a teaching center, each order only contains one product, which is a certain course.
What we are looking for with this massaction is that the students who pass the course receive pre-registration for the next year's course.
We use your system as follows:
1.- We enter the code of a specific course in the search engine for the list of orders on the backend, thus showing us the list of students that correspond to that course. (We have made the pertinent modifications in this view order / listing.php of the administration and in the file admin / components / com_hikashop / views / order / view.html.php, so that this search and listing can be carried out through the product code search.)
2.- The code of each course begins with the last digit of the year in question. In this case, the students of the year 2020 always begin with 0. Those of the current year 2021, begin with 1.
In the list obtained, we select the students who pass the course, and we make a copy of that selection.
This is where we use the massaction, which is the following:
Event trigger: after an order is created
Fiter: order_product_code start by 0
Update values: order_payment_price = 0
Update values: order_full_price = 0
Update values: order_payment_id = 4
Udpdate values: order_shipping_id = 3
Update values: order_product_quantity = 0
the latter is to empty the product of the order
In this way, the values we want are reset and we remove the product that corresponds to last year.
When we use the massaction by copying the orders 1 by 1, it works correctly and we obtain the desired result, but if we select several orders at the same time that it is our desire, it does not make any modification, simply copy it with the existing values.
3.- Once the new code for the current course has been copied and inserted, in this case 2021, it is manually placed in provisional status.
Are we performing any of the steps in the wrong way, or can a modification be implemented, so that when selecting several values the massaction is effective?
4.- After this massaction, we carry out another one, to send the status change email:
Event trigger: after an order is created
Filter: provisional status
Filter: order_product_code starts by 1
Action change status to pre-registration with sending email
Thank you very much for your help