- Posts: 575
- Thank you received: 11
Calculation of point error when buy more than 1
- ler@singmuiheng.com
-
Topic Author
- Offline
-- Joomla version -- : 3.4.1.
-- PHP version -- : 5.4..40
-- Browser(s) name and version -- : Chrome IE
-- Error-message(debug-mod must be tuned on) -- : No message
Hi
Just discover a bug of user point system using alphauser point integration, when a product category set to award 5 points, if the product purchased more than 1, it is still award 5 points instead of award nx5 points (n = number of quantity purchased)
Please advise any hotfix to fix this, thanks
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
Please Log in or Create an account to join the conversation.
In fact, it's not a bug or an error ; it is the algorithm for the points per categories.
Having one product in that category will "unlock" the point credits for that category. And the option "limit by type" will disallow a product to "unlock" points from several categories in the same time.
Having more several products in a category can "unlock" several times the credit ; but it will not multiply it.
The setting is a "retro compatibility" setting for the previous point plugins : alphauserpoints
www.hikashop.com/support/documentation/i...ts-form.html#earning
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
Please Log in or Create an account to join the conversation.
There is no option to do so for the moment ; it's something which should be added in the plugin.
(and something that I put in the TODO list)
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
I had post this request in commercial jobs, maybe if your team are interested can prioritize this first
Please Log in or Create an account to join the conversation.
We generally don't reply to the "commercial jobs" requests.
You can also contact some of our partners and/or use the "contact us" form (we are currently quite busy with the next release, so if we can do something, it wouldn't be before the release).
www.hikashop.com/home/our-partners.html
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
i had make a custom product field "points" and change plugin/userpoint.php to below, the checkout page point calculation is now correct but when i change the order status the point is not populated to aup nor hk point, are you able to give some advise?
Please Log in or Create an account to join the conversation.
The best is to take a look in your database, in the table "hikashop_order".
You will find a column name "order_payment_params" and in that column for the corresponding order you should see something like
So when the order is confirmed (the status changed for something in the "invoice order statuses" setting), the plugin will give the points to the user.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
after checking the database i found that whenever i use calculation taking custom field "points" from product
$points += $product->points * $product->order_product_quantity;
it will be always empty point in the database
is there any way to take custom field into calculation during if(isset($product->order_product_quantity)) line 659 ?
Please Log in or Create an account to join the conversation.
In the userpoints plugin, to get the product quantity we are using
Otherwise, the object "$product" is coming from the cart/order ; so you do not have access to the product custom field; you have data from the "item custom fields" and element in the table "hikashop_order_item".
If you want to access to product custom field, you will need to load the products from the database.
The variable $product_ids contains all id of the products ; so you can perform a query to load the data from the table "product" and then check the value of the custom field.
Something like (raw code / untested)
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
we managed to get the working code to use custom product point of each product and variants multiply by quantity as below code
add at line 386 after return 0;
modify line 680
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
check in database the order table, userpoint serial are empty, any piece of code is regarding backend order in userpoint.php?
Please Log in or Create an account to join the conversation.
First, are the points calculated if you remove your modifications ?
Because that ought to work, and thus it would mean that there is something missing in your code.
Like for example, you might not have access to the variants attribute of your products ? I guess some debug of the code would be necessary in that function to understand what's going on.
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
- Posts: 575
- Thank you received: 11
as i think the topic is more related to this thread www.hikashop.com/forum/3-bug-report/8773...nd-order.html#204163 so lets continue in the thread
Please Log in or Create an account to join the conversation.