coupons no longer work

  • Posts: 10
  • Thank you received: 0
4 years 3 months ago #323105

-- HikaShop version -- : 4.3.0
-- Joomla version -- : current
-- PHP version -- : 7.3.19
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : mod_fcgid: stderr: PHP Warning: trim() expects parameter 1 to be string, array given in /var/www/vhosts/XXXX.XX/httpdocs/administrator/components/com_hikashop/classes/discount.php on line 156

I added a coupon code with a - in the name so coupon-code
after testing it did not do what I wanted and i opend the coupons list again to find it was gone.
I added another coupon
Then i got the error about the array.

mod_fcgid: stderr: PHP Warning: trim() expects parameter 1 to be string, array given in /var/www/vhosts/xxxx.xx/httpdocs/administrator/components/com_hikashop/classes/discount.php on line 156

I removed all existing coupons, hoping it would fix it.
I reurned back to the list of coupon code to find all coupon code not deleted, incuding the one with the - in the name which was the first to be missing.
Deleted all again. but did not fix the issue.

Browsed the forum, found message about a bug in 2014 and a new version that fixed it but mine is newer.
Other post said to disable error reporting. That helped to keep the website functional.

Added a new coupon and tried to test it. But now no coupon code is being accepted.
In the server log I also see this 404 error a lot GET /media/com_hikashop/webfonts/fa-solid-900.woff2 HTTP/1.0
but I doubt it's related.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 3 months ago #323135

Hi,

On which page (URL) did you get that error message ?
I tried to reproduce the issues you describe but it all worked fine for me.
Also, what you're describing with the listing being empty could be explained like this:
In HikaShop, you have an Orders>Discounts menu and an Orders>Coupons menu.
Each lists only the discounts and only the coupons respectively.
But when you create/edit a discount/coupon you can change the type of the element. And so if you click on the "new" button of the discounts listing and change the type to "coupon" before saving (with the save & close button), you won't see the new coupon on the discounts listing.
I also checked the code where the error happens and I don't see why that code would be called in the backend when saving a discount/coupon as that code is only for when a coupon is loaded by the cart on the frontend.

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

  • Posts: 10
  • Thank you received: 0
4 years 3 months ago #323138

Nicolas,
I got the error after adding anything to cart, but now there is something funny...
I enabled error reporting (basic) in order to give you a page url with the error.
And now suddenly the problem is gone. I can add product to cart and apply a coupon code. without problems.
Only thing different is that it's 12 hours later now.

While I have your attention. I put a product in a category "promo" and I configured the coupon code for the "promo" category.
I was hoping that if I buy 5 products that i would see a discount for every of the 5 products. However I only see one discount no matter how many products I buy. Is there another way to do this?

Also what can we do about the font error message?

regards,
John

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

  • Posts: 12953
  • Thank you received: 1778
4 years 3 months ago #323141

Hello John,

I was hoping that if I buy 5 products that i would see a discount for every of the 5 products. However I only see one discount no matter how many products I buy. Is there another way to do this?

Can you show us screenshots of how you configured that discount so that we can understand your issue ? Thank you.

Also what can we do about the font error message?

The fact that the error message is gone can eventually be related to a cache issue, without any step by step instructions on how to reproduce it we won't be able to debug it.

Kind regards,
Mohamed.

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

  • Posts: 10
  • Thank you received: 0
4 years 3 months ago #323171

Hi Mohamed,
Screenshot attached. With that configuration I get 5 euro discount no matter how many products I buy.
I would like to see 10 euro discount if I buy two products.


With the font error I was referring to this 404 error GET /media/com_hikashop/webfonts/fa-solid-900.woff2 HTTP/1.0

regards,
John

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 3 months ago #323180

Hi,

The coupon is for the whole cart. Once one product of the "promo" category is in the cart, the coupon can be used and it will get the 5€ you configured regardless of how much products are in the cart.
You can use the "percentage" setting if you want the value of the coupon to be based on the products in the cart.
And you can activate the "coupon percentage only for products in category" setting if you want to restrict that to only the products of the category you selected to be taken into account.

If you want to have 5€ per products in that category, that would require either:
- the use of AWOCoupon pro which has more advanced rules for coupons you can use on the Hikashop checkout
- the development of a custom plugin to dynamically calculate the value of the coupon

Regarding your webfont issue, it seems that the file has been deleted for some reason on your website. download the HikaShop install package and in the folder media/webfonts/ of the package you'll find all the webfonts of HikaShop that you can extract from the zip and upload via FTP to the /media/com_hikashop/webfonts/ folder of your website and it will fix the problem.

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

  • Posts: 10
  • Thank you received: 0
4 years 3 months ago #323194

Hi Nicolas,

The font is in the path specified and has the same date as the other font files in that folder.
Stackoverflow has a lot of reports about this error but I don't understand how to use the answers.

regards,
John

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 3 months ago #323209

Hi,

If the file is there, then it means that it's an issue with the setup of the server which doesn't allow the access of files with the extension woff2.
I wouild first recommend to open your htaccess file and check if you have file extension restrictions in it. If so, you'll have to adapt the the htaccess to allow for woff2 files.
If not, then the issue is at the apache setup level. In that case, I would recommend to check with your hosting support what to do as it can depend greatly based on how your server is setup.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum