Product with variants do not gain userpoints

  • Posts: 29
  • Thank you received: 1
8 years 2 months ago #248424

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- Browser(s) name and version -- : Google Chrome

Hi support,

We set up a User point plugin in Hikashop and the setting is 1MYR to 1 point.
We tried to checkout two products -
product A with no variant and product B with variant.

When the order has confirmed,
we took a look at AUP activities and we found that user can only receive product A's point but no point from product B.
Both products are set into two categories - Dress and Skirts.

We hope to hear from you soon.
Thank you.

Attachments:

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 2 months ago #248429

Hi,

Try changing the line:
if((int)$category->product_id != (int)$product->product_id)
to:
if(!in_array((int)$category->product_id , array((int)$product->product_id, (int)@$pids[$product->product_id]->product_parent_id)))
and the line:
$pids = $db->loadObjectList();
to:
$pids = $db->loadObjectList('product_id');
in the file plugins/hikashop/userpoints/userpoints.php

Last edit: 8 years 2 months ago by nicolas.

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

  • Posts: 29
  • Thank you received: 1
8 years 2 months ago #248468

Hi Nicolas,

Thank you for your reply.
I edited the code as you said, but it is still not working as expected.
:( :(

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 2 months ago #248474

Hi,

Then try changing instead the line:
if((int)$category->product_id != (int)$product->product_id)
to:

if((int)$category->product_id != (int)$product->product_id && (int)$category->product_id != (int)$product->product_parent_id)

The following user(s) said Thank You: haur0214

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

  • Posts: 29
  • Thank you received: 1
8 years 2 months ago #248615

Hi Nicolas,

Thank you!
This one works fine!
Will this plugin get fix after next hikashop update?

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 2 months ago #248627

Yes. We'll add the patch for that in the next release.

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

  • Posts: 29
  • Thank you received: 1
8 years 1 month ago #249315

Hi,

It seems the problem still exists.
We have already upgrade our hikashop to 2.6.4 but products with variants still unable to gain user point.
Attachments are the settings of products and userpoint plugin.
Please guide us. :) :)

Thank you.

Attachments:
Last edit: 8 years 1 month ago by haur0214.

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 1 month ago #249334

Hi,

How is that possible ? We've added the patch exactly like I gave it to you, and you said it worked. So I don't see why it would be any different with the 2.6.4.
You can check the file, you should find the line:
if((int)$category->product_id != (int)$product->product_id && (int)$category->product_id != (int)$product->product_parent_id)

I actually don't see why it wouldn't work with that patch. Did you modify other things previously in that file with the 2.6.3 ?

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

  • Posts: 29
  • Thank you received: 1
8 years 1 month ago #249371

Hi Nicolas,

No I did not modify the file on live site. I test the code on my localhost.
I upgrade my live site once 2.6.4 release.
It works fine when we did not set product categories on user point plugin.
But when we set few categories into it, products with variants not working again.

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 1 month ago #249420

Hi,

I am not able to reproduce your issue using the "HikaShop user point" plugin on my local website.
The plugin have filter on product categories and I have a variant in my cart ; I can see the number of point change depending the variant product quantity in my cart.

Do you have the block "user points" in your checkout workflow ?
Are you able to reproduce the issue in our demo website ?

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.

  • Posts: 29
  • Thank you received: 1
8 years 1 month ago #249682

Hi Jerome,

We selected Alphauserpoint as the point mode so we are not able to try out on hikashop demo website.
The userpoint payment method and userpoint plugin are both published.
As you can see the images attached shows that SF00298 only assign 18 points for the user but the order contains two products with different prices - 18 and 30.

Attachments:

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 1 month ago #249688

Hi,

And regarding your previous screenshots, I have to deduce that TP00126 is a variant ; right ?

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.

  • Posts: 29
  • Thank you received: 1
8 years 1 month ago #249764

Hi Jerome,

Soory for the lack of information in last reply.
DS00104_粉红色 is a variant which does not give point in this order.
TP00126 is not a variant.

Attachments:

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 1 month ago #249831

Hi,

And what are the categories of the main product of the "DS00104_粉红色".
Why do you not have a default variant for that product ?
How your categories are configured ?

Did you try to just use one category in the "user point" plugin so, instead of selecting a lot of categories you can choose if the product will give points or not by placing the product in a specific (and hidden) category.

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.

  • Posts: 29
  • Thank you received: 1
8 years 1 month ago #250134

Hi,

The product categories of "DS00104_粉红色" is Top and New Arrivals.
These 2 categories are under another category which call "Type".
So the category flow is like Root -> Product Category -> Type -> Top.

We also set a default variant to test and it still not working.

We select a lot of categories because we do not want some of the categories under "Type" to give point.
We also tried to select only "Type" this category but the result is still the same.

Regards,
Haur

Attachments:

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 3 weeks ago #251573

Hi,

Sorry for the delay. We found the issue and added a patch on our end. Download the install package on our website and install it on yours and it will fix the problem.

The following user(s) said Thank You: haur0214

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

Time to create page: 0.060 seconds
Powered by Kunena Forum