- Posts: 515
- Thank you received: 22
coupon unwanted applied
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
9 years 4 months ago #274396
by jouwnaambord.nl
coupon unwanted applied was created by jouwnaambord.nl
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.3
-- PHP version -- : 7.0
When a product is assigned to more than one category, it gets a 10% COUPON discount (wich shouldn't, because this should only apply when a customer order more than 1 product). When assigning the product to a single category, it works fine???
See screenshots
-- Joomla version -- : 3.7.3
-- PHP version -- : 7.0
When a product is assigned to more than one category, it gets a 10% COUPON discount (wich shouldn't, because this should only apply when a customer order more than 1 product). When assigning the product to a single category, it works fine???
See screenshots
Please Log in or Create an account to join the conversation.
9 years 4 months ago #274403
by nicolas
Replied by nicolas on topic coupon unwanted applied
Hi,
Try changing the code:
to:
in the file administrator/components/com_hikashop/classes/discount.php
That should allow the system to count the products only once and not once per category link between the product and the categories of the coupon.
Let us know how that goes so that we can add the patch on our end.
Try changing the code:
Code:
foreach ($id as $productid) {
if($product->product_id !== $productid[0]) {
foreach ($products as $product2) {
if(!empty($product->cart_product_parent_id) && $product2->cart_product_id == $product->cart_product_parent_id && $product2->product_id == $productid[0]) {
$coupon->products[] = $product;
}
}
} else {
$coupon->products[] = $product;
}
}
Code:
foreach ($id as $productid) {
if($product->product_id !== $productid[0]) {
foreach ($products as $product2) {
if(!empty($product->cart_product_parent_id) && $product2->cart_product_id == $product->cart_product_parent_id && $product2->product_id == $productid[0]) {
$coupon->products[] = $product;
break 2;
}
}
} else {
$coupon->products[] = $product;
break;
}
}
That should allow the system to count the products only once and not once per category link between the product and the categories of the coupon.
Let us know how that goes so that we can add the patch on our end.
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
9 years 4 months ago #274462
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic coupon unwanted applied
Hello Nicolas,
Yes, this code works fine, problem solved! Thanks again.
Yes, this code works fine, problem solved! Thanks again.
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
9 years 2 months ago #278674
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic coupon unwanted applied
Hello Nicolas,
I installed the 3.2.0 version, but the couponpatch was not applied as far as I could see, as the unwanted coupon behaviour was back....I changed the code myself again.
I installed the 3.2.0 version, but the couponpatch was not applied as far as I could see, as the unwanted coupon behaviour was back....I changed the code myself again.
Please Log in or Create an account to join the conversation.
9 years 2 months ago #278687
by nicolas
Replied by nicolas on topic coupon unwanted applied
Hi,
I do not confirm.
I see the patch on the install package of the 3.2.0:
monosnap.com/file/XAsMnyG4znkRuJKaKu0A62B8oLx9wa
So either we're talking about something else, or you didn't look at the install package of the 3.2.0
I do not confirm.
I see the patch on the install package of the 3.2.0:
monosnap.com/file/XAsMnyG4znkRuJKaKu0A62B8oLx9wa
So either we're talking about something else, or you didn't look at the install package of the 3.2.0
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
9 years 2 months ago #278698
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic coupon unwanted applied
Hi Nicolas,
You're right, I didn't. But after installing 3.2.0, the couponcode was applied again to a single product in multiple categories. After pasting the php code into discount.php it worked as before.
You're right, I didn't. But after installing 3.2.0, the couponcode was applied again to a single product in multiple categories. After pasting the php code into discount.php it worked as before.
Please Log in or Create an account to join the conversation.
9 years 2 months ago #278703
by nicolas
Replied by nicolas on topic coupon unwanted applied
Hi,
I don't see why applying that patch would change anything since the code is already there.
There must have been a reason to it.
For next release, if you could first do a copy of the website and test the update there so that you could confirm the issue we should be able to look into it.
I don't see why applying that patch would change anything since the code is already there.
There must have been a reason to it.
For next release, if you could first do a copy of the website and test the update there so that you could confirm the issue we should be able to look into it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.108 seconds