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

#   coupon error

##

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

Less More

- Posts: 8
- Thank you received: 0
-
-

11 years 4 weeks ago [\#217820](#217820) by [tellustek](/forum/user/37192-tellustek "View tellustek's Profile")  *[coupon error](/forum/27-checkout/879949-coupon-error#217820 "-- url of the page with the problem -- :   esportshop.loltube.cc/index.php/hikashop...cts-listing/checkout  -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.14 -- Browser(s) name and version -- : any -- Error-message(debug-mod must be tuned on) -- : Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  I create a coupon for this product   esportshop.loltube.cc/index.php/hikashop...oduct/1-pink-sandals  coupon code is testcoupon  when I checkout and input testcoupon it show 錯誤 Unknown code, but it still can discount, and when I want remove coupon , it show message  Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  but when user is logined  it can't remove coupon code  please help")* was created by *[tellustek](/forum/user/37192-tellustek "View tellustek's Profile")*

-- url of the page with the problem -- : [ esportshop.loltube.cc/index.php/hikashop...cts-listing/checkout](http://esportshop.loltube.cc/index.php/hikashop-menu-for-products-listing/checkout)
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.6.14
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com_hikaserial/classes/checkout.php on line 45

I create a coupon for this product
[ esportshop.loltube.cc/index.php/hikashop...oduct/1-pink-sandals](http://esportshop.loltube.cc/index.php/hikashop-menu-for-products-listing/product/1-pink-sandals)

coupon code is
testcoupon

when I checkout and input testcoupon
it show
錯誤
Unknown code,
but it still can discount,
and when I want remove coupon ,
it show message

Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com_hikaserial/classes/checkout.php on line 45

but when user is logined

it can't remove coupon code

please help

- [ ![pic&#95;2015-10-20&#95;17&#95;35&#95;31.jpg](/forum/attachment/27140) ](/forum/attachment/27140 "...0&#95;17&#95;35&#95;31.jpg") [ ](/forum/attachment/27140?download=1 "...0&#95;17&#95;35&#95;31.jpg")
- [ ![pic&#95;2015-10-20&#95;17&#95;36&#95;01.jpg](/forum/attachment/27141) ](/forum/attachment/27141 "...0&#95;17&#95;36&#95;01.jpg") [ ](/forum/attachment/27141?download=1 "...0&#95;17&#95;36&#95;01.jpg")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4080
-
- [](http://obsi.dev)
-

11 years 4 weeks ago [\#217827](#217827) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[coupon error](/forum/27-checkout/879949-coupon-error#217827 "-- url of the page with the problem -- :   esportshop.loltube.cc/index.php/hikashop...cts-listing/checkout  -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.14 -- Browser(s) name and version -- : any -- Error-message(debug-mod must be tuned on) -- : Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  I create a coupon for this product   esportshop.loltube.cc/index.php/hikashop...oduct/1-pink-sandals  coupon code is testcoupon  when I checkout and input testcoupon it show 錯誤 Unknown code, but it still can discount, and when I want remove coupon , it show message  Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  but when user is logined  it can't remove coupon code  please help")*

Hi,

About your warning message, please edit the HikaSerial checkout class and replace Code:

if(count($serials) == 1) { $serial = reset($serials); } else {

By Code:

if(count($serials) == 1) { $serial = reset($serials); } else if(!empty($serials)) {

It will fix the warning display.

The, replace the line Code:

if(empty($cart-&gt;coupon)) {

By Code:

if(empty($cart-&gt;coupon) &#124;&#124; ($coupon == 1 &amp;&amp; $qty == 0)) {

And it should re-allow you to remove a coupon.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

11 years 3 weeks ago -  11 years 3 weeks ago [\#218053](#218053) by [tellustek](/forum/user/37192-tellustek "View tellustek's Profile")  Replied by *[tellustek](/forum/user/37192-tellustek "View tellustek's Profile")* on topic *[coupon error](/forum/27-checkout/879949-coupon-error#218053 "-- url of the page with the problem -- :   esportshop.loltube.cc/index.php/hikashop...cts-listing/checkout  -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.14 -- Browser(s) name and version -- : any -- Error-message(debug-mod must be tuned on) -- : Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  I create a coupon for this product   esportshop.loltube.cc/index.php/hikashop...oduct/1-pink-sandals  coupon code is testcoupon  when I checkout and input testcoupon it show 錯誤 Unknown code, but it still can discount, and when I want remove coupon , it show message  Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  but when user is logined  it can't remove coupon code  please help")*

Hello,

thank you for your relay

I edited this file ,
administrator/components/com_hikaserial/classes/checkout.php

and then in login case it works fine

but in guest input couponcode and click apply,
it still show error message
--
錯誤
Unknown code
--
and couponcode apply it

please help how can i fix it .

or i have to edit this file?

components/com_hikaserial/controllers/serial.php

thank you so much

Last edit: 11 years 3 weeks ago by [tellustek](/forum/user/37192-tellustek "View tellustek's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4080
-
- [](http://obsi.dev)
-

11 years 3 weeks ago [\#218056](#218056) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[coupon error](/forum/27-checkout/879949-coupon-error#218056 "-- url of the page with the problem -- :   esportshop.loltube.cc/index.php/hikashop...cts-listing/checkout  -- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.14 -- Browser(s) name and version -- : any -- Error-message(debug-mod must be tuned on) -- : Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  I create a coupon for this product   esportshop.loltube.cc/index.php/hikashop...oduct/1-pink-sandals  coupon code is testcoupon  when I checkout and input testcoupon it show 錯誤 Unknown code, but it still can discount, and when I want remove coupon , it show message  Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com&#95;hikaserial/classes/checkout.php on line 45  but when user is logined  it can't remove coupon code  please help")*

Hi,

Do you need to insert HikaShop coupon codes or do you need to insert HikaSerial serials during the checkout ?
Depending the element which should be entered, using the HikaShop "coupon" block in your checkout workflow or the "HikaSerial coupon" will have different effects.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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