[Skip to main content](#vessel-content)

#   \[SOLVED\] Discount not on list view but only on detail page

##

- **[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")**
- [![nico.van.leeuwen's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile") Topic Author
- [ Offline](/forum/user/12404-nico-van-leeuwen)

Less More

- Posts: 343
- Thank you received: 28
-
-
- [](http://www.delinie-ict.nl)
-

9 years 5 months ago -  9 years 5 months ago [\#271194](#271194) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  *[\[SOLVED\] Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271194 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")* was created by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")*

-- url of the page with the problem -- : [ www.viajuul.nl](https://www.viajuul.nl)
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.19

Hi,
I'm a bit searching for the cause of the discount behaviour on my site.
We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.

Have been removing modified views to see if they are the issue but unfortunately no luck so far.
Any tips are most welcome.
Discount not applied : [ list view](https://www.viajuul.nl/aanbiedingen)
Discount applied : [ detail view](https://www.viajuul.nl/aanbiedingen/product/3443-croky-chips-bolognese-20-x-40-gram)

Last edit: 9 years 5 months ago by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile"). Reason: problem solved after update

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GW](/forum/user/33851-gw "View GW's Profile")**
- [![GW's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33851-gw "View GW's Profile")
- [ Offline](/forum/user/33851-gw)

Less More

- Posts: 200
- Thank you received: 75
-
-

9 years 5 months ago -  9 years 5 months ago [\#271206](#271206) by [GW](/forum/user/33851-gw "View GW's Profile")  Replied by *[GW](/forum/user/33851-gw "View GW's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271206 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

- EDIT -

Hi,

apologies for the previous answer and edit, we can reproduce the same issue, in Hikashop 3.0.1 discounts showed correctly in product listings, but in 3.1.1 not anymore.

Last edit: 9 years 5 months ago by [GW](/forum/user/33851-gw "View GW's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

9 years 5 months ago -  9 years 5 months ago [\#271197](#271197) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271197 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi,

@nico.van.leeuwen : In the settings of your menu item, under the "products options" there is a discount setting where you can configure if you want to see the prices with or without discount on the listing.

@GW : We do not have any issue with the display of the discounted prices on the listings as far as I could test. Please provide screenshots and more information as we can't reproduce.

Last edit: 9 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")**
- [![nico.van.leeuwen's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile") Topic Author
- [ Offline](/forum/user/12404-nico-van-leeuwen)

Less More

- Posts: 343
- Thank you received: 28
-
-
- [](http://www.delinie-ict.nl)
-

9 years 5 months ago [\#271221](#271221) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  Replied by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271221 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi Nicolas,

This is set to "display discount amount".
It has not been touched for a long time.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GW](/forum/user/33851-gw "View GW's Profile")**
- [![GW's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33851-gw "View GW's Profile")
- [ Offline](/forum/user/33851-gw)

Less More

- Posts: 200
- Thank you received: 75
-
-

9 years 5 months ago [\#271274](#271274) by [GW](/forum/user/33851-gw "View GW's Profile")  Replied by *[GW](/forum/user/33851-gw "View GW's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271274 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi Nicolas,

we're pretty sure we have the same issue as nico.van.leeuwen, to clarify: in Hikashop 3.0.1 our listings showed discounted prices fine.
When we update to 3.1.1 without touching *any* settings anywhere, suddenly the listings are not showing discounted prices anymore at all, it's always the original full price.

If we install 3.0.1 back again and refresh frontend, discounted price is back. So something has changed somewhere between 3.0.1 and 3.1.1 but it isn't us who changed anything. The product pages always show discounts fine both in 3.0.1 and 3.1.1.

If you need any screenshots, let us know, but we're fairly sure it's not any of our settings that is at fault.
We did a little bit of searching, perhaps the following is of help to narrow down the issue:
If we set "Discounted only" to Yes, the listing will correctly show all discounted products but still not with the correct discounted price.
If we print_r the variable $this-&gt;row in our product/category listing, in 3.1.1 all the discount variables are missing completely.

Hopefully this is of help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

9 years 5 months ago [\#271277](#271277) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271277 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi,

I'm not doubting you. It's just that I tested myself on HikaShop 3.1.1 with discounted products and it worked just fine.

So try this:
create a discount without any restriction so that it applies to all the products and make sure that the discount price display setting is properly set in your menu item.
Then, you should see the discounted price on the listing, like me.
So that means that there is something on your website, maybe the way the discount is configured, or the way the products are configured, which makes it not work with changes included in the 3.1.1.
If I check the change log of HikaShop, I see this line:
The price of products without price but with variants with price was not displaying on the products listing due to a side-effect of the code changes to support variants on discounts in HikaShop 3.1.0.
That fix was included in HikaShop 3.1.1.
So maybe it has some unforseen side-effect in your case.

The fix consisted in changing the line:
if($price-&gt;price_product_id == $element-&gt;product_id) {
to:
if(!empty($element-&gt;variant_ids) &amp;&amp; in_array($price-&gt;price_product_id, $element-&gt;variant_ids)) {
in the file administrator/components/com_hikashop/classes/currency.php

Unfortunately, we don't know how your products or how your discounts are configured. So I can't reproduce the problem on my end.
Could you provide screenshots of a discount settings, a product settings, a menu item settings and a link to the page with the issue where that product appears ?
Also, try to revert that patch to see if it comes from that or not.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GW](/forum/user/33851-gw "View GW's Profile")**
- [![GW's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33851-gw "View GW's Profile")
- [ Offline](/forum/user/33851-gw)

Less More

- Posts: 200
- Thank you received: 75
-
-

9 years 5 months ago [\#271318](#271318) by [GW](/forum/user/33851-gw "View GW's Profile")  Replied by *[GW](/forum/user/33851-gw "View GW's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271318 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi Nicolas,

we've narrowed the issue down in the file currency.php, it wasn't the line you mentioned, but line 496: Code:

$product_matches[] = 'discount_product_id LIKE \'%,'.(int)$all_ids.',%\'';

The variable **$all\_ids** looks to be incorrect, since you're looping **$id**, this has changed from 3.0.1 to 3.1.1.
If we're not mistaken, you meant to change the variable **$ids** on line 495 to **$all\_ids** but instead changed the wrong variable.

If we change **$all\_ids** on line 496 to **$id** the discount prices are correct again in the listings.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

9 years 5 months ago [\#271397](#271397) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271397 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi,

Actually, the whole: Code:

foreach($ids as $id) { $product_matches[] = 'discount_product_id LIKE \'%,'.(int)$all_ids.',%\''; }

should be removed since it is now handled by Code:

$product_matches = array( 'discount_product_id IN (\'\',\'0\',\''.implode('\',\'', $all_ids) . '\')', );

above it.
Try removing the foreach and that should work properly too.

Replacing $all_ids by $id would make it work but only with discounts applied to main products, not for discounts applied to variants, which was the point of changing the code around there.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")**
- [![nico.van.leeuwen's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile") Topic Author
- [ Offline](/forum/user/12404-nico-van-leeuwen)

Less More

- Posts: 343
- Thank you received: 28
-
-
- [](http://www.delinie-ict.nl)
-

9 years 5 months ago [\#271406](#271406) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  Replied by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271406 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi,
Just curious but is this going to be applied in the latest downloads ?
Thanks everybody for helping to sort this!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GW](/forum/user/33851-gw "View GW's Profile")**
- [![GW's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33851-gw "View GW's Profile")
- [ Offline](/forum/user/33851-gw)

Less More

- Posts: 200
- Thank you received: 75
-
-

9 years 5 months ago -  9 years 5 months ago [\#271409](#271409) by [GW](/forum/user/33851-gw "View GW's Profile")  Replied by *[GW](/forum/user/33851-gw "View GW's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271409 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hmm, no that doesn't work either Nicolas, hopefully you can take a minute to look at your code, because I think you may have it mixed up. Apologies if I'm wrong, but the query
Code:

$product_matches = array( 'discount_product_id IN (\'\',\'0\',\''.implode('\',\'', $all_ids) . '\')', );

is never going to return any results, right.

- If you create a discount on some products, in the database the discount_product_id's are stored as for example: **,9,13,7,**
- In a product listing the $product_matches can look something like: **discount\_product\_id IN ('','0','6','10','14','9','8','7','13','5')**
This means it will try to match the entire string ",9,13,7," against '6' or '10' or '14', etc. which is never true, isn't it?
It will compare discount_product_id to each value and look for an exact match, which even with a discount applied to only one product will never happen because discount_product_id will have commas around it and e.g. '**,9,**' is not equal to '**9**'.

The LIKE queries created in the foreach loop on the other hand will return true since **,9,13,7,** will match **%,13,%**. So instead of Code:

$product_matches = array( 'discount_product_id IN (\'\',\'0\',\''.implode('\',\'', $all_ids) . '\')', ); foreach($ids as $id) { $product_matches[] = 'discount_product_id LIKE \'%,'.(int)$all_ids.',%\''; }

the IN doesn't do anything and what seems to work correctly so far as we've tested is Code:

$product_matches = array(); foreach($all_ids as $id) { $product_matches[] = 'discount_product_id LIKE \'%,'.(int)$id.',%\''; }

In any case, hopefully you can take a look at it, thanks!

Last edit: 9 years 5 months ago by [GW](/forum/user/33851-gw "View GW's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

9 years 5 months ago -  9 years 5 months ago [\#271415](#271415) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271415 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi,

Thank you for your feedback. Indeed, I had forgotten about that.
Now your code is missing some bits as it needs to match with 0 and empty, and it should be backward compatible to discounts saved in the database when the discount_product_id column was an integer type.

Thus, the final code should be that I think: Code:

$product_matches = array('discount_product_id IN (\'\',\'0\',\''.implode('\',\'', $ids) . '\')'); foreach($all_ids as $id) { $product_matches[] = 'discount_product_id LIKE \'%,'.(int)$id.',%\''; }

I've tested it on my end and it seems to work.
Please check on your end.

And to answer nico.van.leeuwen, yes that patch will be included. You can easily test it yourself by just replacing the code.

Last edit: 9 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GW](/forum/user/33851-gw "View GW's Profile")**
- [![GW's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33851-gw "View GW's Profile")
- [ Offline](/forum/user/33851-gw)

Less More

- Posts: 200
- Thank you received: 75
-
-

9 years 5 months ago [\#271477](#271477) by [GW](/forum/user/33851-gw "View GW's Profile")  Replied by *[GW](/forum/user/33851-gw "View GW's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271477 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Ah yes, the final code works fine at our end too, thanks!

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")**
- [![nico.van.leeuwen's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile") Topic Author
- [ Offline](/forum/user/12404-nico-van-leeuwen)

Less More

- Posts: 343
- Thank you received: 28
-
-
- [](http://www.delinie-ict.nl)
-

9 years 5 months ago [\#271520](#271520) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  Replied by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271520 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

Hi, the issue is solved after applying the latest download ![:)](/media/kunena/emoticons/3.png ":)")

Thank you all for helping !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

9 years 5 months ago [\#271483](#271483) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not on list view but only on detail page](/forum/46-discount-coupon/890566-solved-discount-not-on-list-view-but-only-on-detail-page#271483 "-- url of the page with the problem -- :   www.viajuul.nl  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.19  Hi, I'm a bit searching for the cause of the discount behaviour on my site. We have monthly updates of our discounted products and after applying the updates for this month I found that the discounts are not applied when I have the products in a catagory list. When I click on a product, the detail page comes up and the right prices is visible.  Have been removing modified views to see if they are the issue but unfortunately no luck so far. Any tips are most welcome. Discount not applied : Discount applied :")*

The code has been included on our end.
If anyone wants it without applying the patch manually, you can download the install package on our website in the menu My account&gt;My subscriptions and install it on your website and it will be added automatically.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84OTA1NjYtc29sdmVkLWRpc2NvdW50LW5vdC1vbi1saXN0LXZpZXctYnV0LW9ubHktb24tZGV0YWlsLXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.135 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
