Show Time of Day when Product Will become Available

  • Posts: 58
  • Thank you received: 2
6 years 3 months ago #285620

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3

Wondering what we can add to the product page to show the TIME of day that the product will come available. When creating a new product, we can specify the date and time when a product will be available using the advanced date picker. We would like to show both of these on the product pages.

Right now, the product page just says "Product will be available on 1-12-2018" but we would like it to show the TIME as well as the DATE. Is that an easy edit to the product page?

Thanks in advance.

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 3 months ago #285628

Hello,

You need to perform a view override modification to change the used date format so you can also include the time (and not just the date).
www.hikashop.com/support/documentation/1...-display.html#layout

Please note that you can use the setting "display view files" to help you locate which view you need to customize.
www.hikashop.com/support/documentation/5...g.html#advanced_main

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 58
  • Thank you received: 2
6 years 3 months ago #285683

Thanks. It looks like we need to edit the product/quantity.php file. In that file, we see the lines

$now = time();
$start_date = (@$this->row->product_sale_start || empty($this->element->main)) ? @$this->row->product_sale_start : $this->element->main->product_sale_start;
$end_date = (@$this->row->product_sale_end || empty($this->element->main)) ? @$this->row->product_sale_end : $this->element->main->product_sale_end;
$product_available = ($end_date <= 0 || $end_date >= $now) && ($start_date <= 0 || $start_date < $now);

But we aren't sure what to add in order to show the time of day. How do we figure out the code to add?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
6 years 3 months ago #285687

Hi,

You just want to add such code near the beginning of the file :
$this->params->set('date_format', '%d %B %Y %H:%M');

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

  • Posts: 58
  • Thank you received: 2
6 years 3 months ago #285741

Thanks, we'll try that.

And we love the "Display View Files" setting to show what files to edit, but it only seems to work with Hikashop files and doesn't show Hikamarket file info. Is there are way to show Hikamarket file info or is this something that could be added in future?

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 3 months ago #285746

Hello,

The patch will be include in the next HikaMarket release (and the same for HikaSerial).

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum