Discount Restriction Dates not Saving

  • Posts: 174
  • Thank you received: 5
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
1 week 3 hours ago #310878

-- url of the page with the problem -- : aquacorals.com
-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.2.22
-- Browser(s) name and version -- : Firefox 69.0
-- Error-message(debug-mod must be tuned on) -- : None

I've created a discount of $10 on a certain item that needs to be available for a week. Whenever I try to enter a start date or end date, the dates disappear upon saving. I've checked the timezone and it matches between server and joomla installation.
What am I missing?

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

  • Posts: 66849
  • Thank you received: 9881
  • MODERATOR
6 days 21 hours ago #310879

Hi,

I don't see why this would happen. I'm not able to reproduce the problem on my end, so I'm not sure.
It could be a view override or a plugin or a change to the database structure but I don't see why you would do such thing.
Check the type of the columns in the hikashop_discount table via your PHPMyAdmin. The discount_start and discount_end columns should be of the type int (10). If they are something else, like datetime or date it could create such issue.
Besides that, we would need a backend access to check on the situation and maybe even a FTP access to do some debugging since we don't have the problem on our end.
You can provide that along with a link to this thread via our contact form so that we can look at it if you don't find any issue in the database:
www.hikashop.com/support/contact-us.html

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

  • Posts: 66849
  • Thank you received: 9881
  • MODERATOR
3 days 3 hours ago #311024

Hi,

I was able to reproduce the problem on your website. What's funny is that it depends on the date selected. Sometimes it worked fine and sometimes it didn't.
Reading online, it looks like it's because the format of dates in some languages (in English) of Joomla doesn't follow the format supported by PHP to read dates.
Changing the line:

if(!is_numeric($date)) $date = strtotime($date);
to:
if(!is_numeric($date)) $date = strtotime(str_replace('-','/', $date));
in the file administrator/components/com_hikashop/helpers/helper.php fixed the problem on your website. We'll include this change on our end to.

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

  • Posts: 174
  • Thank you received: 5
  • Hikamarket Frontedition Hikamarket Multivendor Hikaserial Standard Hikashop Business
2 days 16 hours ago #311032

Perfect Thanks! that did it!

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

Time to create page: 0.049 seconds
Powered by Kunena Forum