Hikashop Order Export Includes User Points

  • Posts: 25
  • Thank you received: 0
1 year 8 months ago #349580

Hi,

When exporting orders to CSV if the user has used user points as part payment this is listed as product_1 in their order. With the actual product ordered being in product_2 etc.

Is there anyway of excluding user points from showing as if they are a product ordered?

This will help with uploading orders to a shipping platform.

I have tried using mass actions with a range of filters but cannot fix this issue.

Mike

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 8 months ago #349585

Hi,

There is no option for this. However, the order_product_quantity would be equal to 0. So it would be similar to what you would get if you were to remove a product from an already created order.
The best would be to ignore the products with an order_product_quantity equal to 0.

A quick and dirty solution would be to change the line:
$query .= ' ORDER BY order_product_id ASC';
to:
$query .= ' AND order_product_quantity > 0 ORDER BY order_product_id ASC';
in the file administrator/components/com_hikashop/classes/massaction.php

A proper solution would be to add an extra option to the export action to exclude products with a quantity of 0 from the export.

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

  • Posts: 25
  • Thank you received: 0
1 year 8 months ago #349589

Thank you for your response.

I tried using the order_product_quantity. However this does not seem to remove them. I believe it is because the User points entry do not show any value in that column, just blank, so the mass action is not removing them on the export.

Sorry and to add in mass actions the adding of more than one filter does not seem to work. It only takes the first filter. So If we set if as order status X and exclude product_name which contains User then it does not actually work, those user points are still shown. If we put the product_name filter first and the order status second then it will show all order statuses, but does remove those user points.

Mike

Last edit: 1 year 8 months ago by mjs23112005.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 8 months ago #349671

Hi,

The order_product_quantity > 0 code modification should help. You can check the value of order_product_quantity in the hikashop_order_product table in the database for the points and it will be 0. And thus the rows for the points should be ignored with that extra condition in the code.

Note that you can't add that condition as a filter of the mass action. This won't work.
The products of the order are loaded during the export process, after the orders have been filtered.
Adding a filter on order_product_quantity > 0, or order_product_name not containing "User" won't work. This filter would mean "only select orders with at least one product with a quantity > 0" or "only select orders with at least one product with name not containing 'User'" and thus it would match with all the orders.
That's why I told you to change the code and not to add the condition as a filter of the mass action.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum