Discount Restriction Dates not Saving

  • Posts: 248
  • Thank you received: 7
  • Hikamarket Multivendor Hikashop Business
4 years 7 months 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: 81428
  • Thank you received: 13058
  • MODERATOR
4 years 7 months 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: 81428
  • Thank you received: 13058
  • MODERATOR
4 years 6 months 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: 248
  • Thank you received: 7
  • Hikamarket Multivendor Hikashop Business
4 years 6 months ago #311032

Perfect Thanks! that did it!

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

Time to create page: 0.059 seconds
Powered by Kunena Forum