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

#   Coupon restriction on product not working

##

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago -  15 years 11 months ago [\#2024](#2024) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  *[Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2024 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")* was created by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")*

I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click "OK", once done, I have a blank page with only one line top left "1 Registre de coaching" appearing (this is the selected product) and nothing else, no button nothing. If I go back, then I get back to the main coupon creation page and there is not attached products.

Got the same problem when trying to affect a zone when comes time to select the zone, I have a pup-up displayiong the zones, I then choose Canada and click "OK", once done, I have a blank page with only one line top left "38 Canada" appearing (this is the selected product) and nothing else, no button nothing. If I go back, then I get back to the main coupon creation page and there is not attached zones.

I also just tried to build a simple coupon with a %, I can create the coupon but it is impossible to use on the front-end, I always have a message saying "Le code du coupon que vous avez entré n'est pas valide"

This look's like if some debugging code where still in the component code

Joomla 1.5.22
Hikashop 1.3.6
IE 8

Last edit: 15 years 11 months ago by [goldriver](/forum/user/162-goldriver "View goldriver's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2025](#2025) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2025 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Hi,

This looks like a limitation of internet explorer.

In the file administrator/components/com_hikashop/views/product/view.html.php near line 685, could you try to replace the code Code:

window.top.document.getElementById('product_id').innerHTML = document.getElementById('result').innerHTML;

by the code Code:

obj = window.top.document.getElementById('product_id'); while(obj.firstChild) obj.removeChild(obj.firstChild); obj.appendChild(document.getElementById('result'));

and try again ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2026](#2026) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2026 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

For the zone, try to replace the code Code:

window.top.document.getElementById('zone_id').innerHTML = document.getElementById('result').innerHTML;

by the code Code:

obj = window.top.document.getElementById('zone_id'); while(obj.firstChild) obj.removeChild(obj.firstChild); obj.appendChild(document.getElementById('result'));

near line 240 of the file administrator/components/com_hikashop/views/zone/view.html.php and try again.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago -  15 years 11 months ago [\#2027](#2027) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2027 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

same proble, nothing changes. I also tried with Firefox, same problem.

If you still have credentials for halonacoachong.com/joomlatest, you can go and try. (I've sent then by mail earlier last week)

Last edit: 15 years 11 months ago by [goldriver](/forum/user/162-goldriver "View goldriver's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2028](#2028) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2028 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

For the "coupon is not valid" error will happen when:
The type of the discount is "discount" and not "coupon" (coupons are to be entered by the user while discounts are applied automatically)
or the coupon is not published
or the code entered doesn't match any coupon code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2029](#2029) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2029 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

The login you sent me earlier this week do not seem to work as I couldn't login.

Do you have the same problem on our demo website ?

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago [\#2030](#2030) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2030 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

I've fixed the credentials, they now should work.

I have not tested on your demo site yet.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2031](#2031) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2031 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

That was something else.

It's a bug we found already at the beginning of the week. On some website the modal javascript library wasn't loaded on that page for some reason. So we added the code below in the view in order to force it:
JHTML::_('behavior.modal');

It's now working on your website.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago [\#2032](#2032) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2032 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

In wich document have you made the change ? I'll need to port that change to the live environment.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2034](#2034) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2034 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

you can add it to the file administrator/components/com_hikashop/views/discount/view.html.php just after
$discount_id = hikashop::getCID('discount_id',false);
near line 185

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago -  15 years 11 months ago [\#2046](#2046) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2046 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

It looks like another problem appear, if I select the coupon, I still have a message saying that this coupon is not usable in my zone.

I've check the coupon, it is set to zone 38 and the customer adress is also set to 38, the coupon type is coupon. I've noticed that if I open the coupon, I see the product number and the zone number but right beside I have a message "product not found" and "zone not found"

Last edit: 15 years 11 months ago by [goldriver](/forum/user/162-goldriver "View goldriver's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2086](#2086) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2086 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

For the display of the "not found" message on the backend it's just a bug in the display. We fixed it on our end.

We were able to reproduce the problem of the coupon not accepted although you're in the good zone on your website.

We tried to edit the files directly via FTP but we got the error "552 Disk full - please upload later" while trying to edit the files.
We will try to reproduce the problem on our end.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago [\#2087](#2087) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2087 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

My provider is having a disk issue, it should be fixed whitin the next hour, if you want, you can test it later (I guess it will be tommorow for you), thanks again for your support

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2089](#2089) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2089 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

We were able to reproduce the problem on our end and fixed it. You need to replace the code Code:

if($coupon-&gt;discount_quota &amp;&amp; $coupon-&gt;discount_quota&lt;=$coupon-&gt;discount_used_times){ $error_message = JText::_('QUOTA_REACHED_FOR_COUPON'); }elseif($coupon-&gt;discount_zone_id &amp;&amp; !in_array($coupon-&gt;discount_zone_id,$zones)){ $error_message = JText::_('COUPON_NOT_AVAILABLE_IN_YOUR_ZONE'); }elseif(bccomp($coupon-&gt;discount_minimum_order,0,5)){ $currency-&gt;convertCoupon($coupon,$total-&gt;prices[0]-&gt;price_currency_id); if($coupon-&gt;discount_minimum_order&gt;$total-&gt;prices[0]-&gt;price_value){ $error_message = JText::sprintf('ORDER_NOT_EXPENSIVE_ENOUGH_FOR_COUPON',$currency-&gt;format($coupon-&gt;discount_minimum_order,$coupon-&gt;discount_currency_id)); } }

by the code Code:

if($coupon-&gt;discount_quota &amp;&amp; $coupon-&gt;discount_quota&lt;=$coupon-&gt;discount_used_times){ $error_message = JText::_('QUOTA_REACHED_FOR_COUPON'); }else{ if($coupon-&gt;discount_zone_id){ $class = hikashop::get('class.zone'); $zone = $class-&gt;get($coupon-&gt;discount_zone_id); if(!in_array($zone-&gt;zone_namekey,$zones)){ $error_message = JText::_('COUPON_NOT_AVAILABLE_IN_YOUR_ZONE'); } } if(empty($error_message) &amp;&amp; bccomp($coupon-&gt;discount_minimum_order,0,5)){ $currency-&gt;convertCoupon($coupon,$total-&gt;prices[0]-&gt;price_currency_id); if($coupon-&gt;discount_minimum_order&gt;$total-&gt;prices[0]-&gt;price_value){ $error_message = JText::sprintf('ORDER_NOT_EXPENSIVE_ENOUGH_FOR_COUPON',$currency-&gt;format($coupon-&gt;discount_minimum_order,$coupon-&gt;discount_currency_id)); } } }

in the file administrator/components/com_hikashop/classes/discount.php near line 75. That will fix the check of the zone restriction. For the display problem of the zone name in the edit you can replace the code Code:

if(!empty($element-&gt;price_product_id)){ $query = 'SELECT * FROM '.hikashop::table('product').' WHERE product_id = '.(int)$element-&gt;price_product_id; $database-&gt;setQuery($query); $product = $database-&gt;loadObject(); if(!empty($product)){ foreach(get_object_vars($product) as $key =&gt; $val){ $element-&gt;$key = $val; } } } if(empty($element-&gt;product_name)){ $element-&gt;product_name = JText::_('PRODUCT_NOT_FOUND'); } //get category info if(!empty($element-&gt;price_category_id)){ $query = 'SELECT * FROM '.hikashop::table('category').' WHERE category_id = '.(int)$element-&gt;price_category_id; $database-&gt;setQuery($query); $category = $database-&gt;loadObject(); if(!empty($category)){ foreach(get_object_vars($category) as $key =&gt; $val){ $element-&gt;$key = $val; } } } if(empty($element-&gt;category_name)){ $element-&gt;category_name = JText::_('CATEGORY_NOT_FOUND'); } //get zone info if(!empty($element-&gt;price_zone_id)){ $query = 'SELECT * FROM '.hikashop::table('zone').' WHERE zone_id = '.(int)$element-&gt;price_zone_id; $database-&gt;setQuery($query); $zone = $database-&gt;loadObject(); if(!empty($zone)){ foreach(get_object_vars($zone) as $key =&gt; $val){ $element-&gt;$key = $val; } } }

by the code Code:

if(!empty($element-&gt;discount_product_id)){ $query = 'SELECT * FROM '.hikashop::table('product').' WHERE product_id = '.(int)$element-&gt;discount_product_id; $database-&gt;setQuery($query); $product = $database-&gt;loadObject(); if(!empty($product)){ foreach(get_object_vars($product) as $key =&gt; $val){ $element-&gt;$key = $val; } } } if(empty($element-&gt;product_name)){ $element-&gt;product_name = JText::_('PRODUCT_NOT_FOUND'); } //get category info if(!empty($element-&gt;discount_category_id)){ $query = 'SELECT * FROM '.hikashop::table('category').' WHERE category_id = '.(int)$element-&gt;discount_category_id; $database-&gt;setQuery($query); $category = $database-&gt;loadObject(); if(!empty($category)){ foreach(get_object_vars($category) as $key =&gt; $val){ $element-&gt;$key = $val; } } } if(empty($element-&gt;category_name)){ $element-&gt;category_name = JText::_('CATEGORY_NOT_FOUND'); } //get zone info if(!empty($element-&gt;discount_zone_id)){ $query = 'SELECT * FROM '.hikashop::table('zone').' WHERE zone_id = '.(int)$element-&gt;discount_zone_id; $database-&gt;setQuery($query); $zone = $database-&gt;loadObject(); if(!empty($zone)){ foreach(get_object_vars($zone) as $key =&gt; $val){ $element-&gt;$key = $val; } } }

in the file amdinistrator/components/com_hikashop/views/discount/view.html.php near line 210.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago [\#2121](#2121) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2121 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Hi Nicolas,

I'm unable to do the second modification, teher is no amdinistrator/components/com_hikashop/views/discount/view.html.php file in my system !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2126](#2126) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2126 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Hi,

Yes, when I tried to edit it via FTP and that I got the disk space error, I deleted it hoping that it would free some space and that I would be able to upload the new version of the file. Unfortunately, I still had the error afterwards and it wouldn't let me put it back.

You should get that file from your hikashop install package in the folder back/views/discount and upload it manually in order to restore it and apply the fix.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 11 months ago -  15 years 11 months ago [\#2160](#2160) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2160 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Nicolas,

I took the views.html.php file from the installation package and dropped it in the right directory and did the changes mentionned above and here is the message I Have when I try to open a coupon to modify it:

Fatal error: Call to a member function setQuery() on a non-object in /home/brisebo/public_html/halonacoaching.com/joomlatest/administrator/components/com_hikashop/views/discount/view.html.php on line 187

But now the coupon works, I'm just unable to modify the discount once created.

Last edit: 15 years 11 months ago by [goldriver](/forum/user/162-goldriver "View goldriver's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 11 months ago [\#2168](#2168) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2168 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Hi,

We just released the new version of HikaShop. You can download it and update your version. That will fix both problems. Alternatively, you can just get the back/views/discount/view.html.php file of the new package and put it over the administrator/components/com_hikashop/views/discount/view.html.php file.

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

- **[goldriver](/forum/user/162-goldriver "View goldriver's Profile")**
- [![goldriver's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar162.jpg)](/forum/user/162-goldriver "View goldriver's Profile") Topic Author
- [ Offline](/forum/user/162-goldriver)

Less More

- Posts: 39
- Thank you received: 0
-
-

15 years 10 months ago [\#2270](#2270) by [goldriver](/forum/user/162-goldriver "View goldriver's Profile")  Replied by *[goldriver](/forum/user/162-goldriver "View goldriver's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2270 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Just upgraded to 1.3.7 and still have the same issue:

Fatal error: Call to a member function setQuery() on a non-object in /home/brisebo/public_html/halonacoaching.com/joomlatest/administrator/components/com_hikashop/views/discount/view.html.php on line 187 when trying to open/modify a coupon

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86285
- Thank you received: 14263
-
-

15 years 10 months ago [\#2272](#2272) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Coupon restriction on product not working](/forum/3-bug-report/2024-coupon-restriction-on-product-not-working#2272 "I'm trying to build a fixed amount coupon for a specific product, when comes time to select the product, I have a pup-up displayiong the products, I then choose the desired item and click &quot;OK&quot;, once...")*

Please edit that file and add just after the code Code:

function form(){

the code Code:

$database =&amp; JFactory::getDBO();

near line 165.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDI0LWNvdXBvbi1yZXN0cmljdGlvbi1vbi1wcm9kdWN0LW5vdC13b3JraW5nP3RtcGw9bWFya2Rvd24=) 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.480 seconds

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

[](#top)
