Availability date + time option missing in HikaShop 6 Business

  • Posts: 12
  • Thank you received: 1
  • Hikashop Business
1 week 4 days ago #368145

-- HikaShop version -- : 6.0.0 Business
-- Joomla version -- : 5.3.2
-- PHP version -- : 8,3,23
-- Browser(s) name and version -- : Chrome 138.0.7204.184

Hello,

I am using HikaShop 6 Business and want to display the product availability date including the time in the frontend.
From the documentation and older forum posts, I understand there should be a global setting like "Display availability date" with options such as:

  • No
  • Yes (date only)
  • Yes + Time

However, in my installation, I cannot find this setting anywhere in System → Configuration → Display → Product options or Default parameters for products.

What I have tried so far:

I entered a "Available from" date and time for a product (in Restrictions and dimensions tab).
Saved the product and checked the frontend → no availability date/time shown.
Checked all display configuration sections → the option does not appear.

I am sure I am using the Business edition (purchased specifically for the date+time feature).

Question:
  • Has the "Display availability date" setting been moved or removed in HikaShop 6?
  • How can I enable the time to be shown together with the availability date without doing a custom view override?

Thank you in advance!

Best regards,
Patrick

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
1 week 4 days ago #368146

Hi,

The available date will appear automatically on the product details page on the frontend once entered in the "available from" input for the product in the backend.
There is no option to not display it.
If you don't see it, either you've already have a view override (made on your end or by your template provider) which removes it, or you have a translation override of the text for it on the frontend which removes it, or you have custom CSS which removes it, or you have some page caching in place preventing you from seeing the change and you need to clear it.
The code to display it is in the view file product / quantity :

if($start_date > 0 && $start_date > $now) {
?>
	<span class="hikashop_product_sale_start"><?php
		echo JText::sprintf('ITEM_SOLD_ON_DATE', hikashop_getDate($start_date, $this->params->get('date_format', '%d %B %Y')));
	?></span>
<?php
}
So either that code is missing or there is a problem with the translation key ITEM_SOLD_ON_DATE

Last edit: 1 week 4 days ago by nicolas.
The following user(s) said Thank You: pkaeller

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

  • Posts: 12
  • Thank you received: 1
  • Hikashop Business
1 week 3 days ago #368166

Here’s what solved it for me on both the product details and the product listing views.

Problem observed:
The “available from” notice was shown, but only with the date (no hours/minutes). The reason was that the view used the date_format parameter (default %d %B %Y) which doesn’t include time.

Product details view
File adjusted (override): product/quantity.php
(That’s the file you referenced; I confirmed it on my setup.)

I kept the original condition and only made the format time-aware. If the chosen date_format doesn’t contain hours/minutes, I append %H:%M:

<!-- SALE START MESSAGE -->
<?php
// $start_date kommt aus der Detail-View
$startTs = is_numeric($start_date) ? (int)$start_date : strtotime((string)$start_date);

if ($startTs && $startTs > time()) :
    // Format aus Params holen; Uhrzeit ergänzen, falls nicht vorhanden
    $fmt = (string) $this->params->get('date_format', '%d %B %Y');
    if (strpos($fmt, '%H') === false && strpos($fmt, '%I') === false) {
        $fmt .= ' %H:%M';
    }
?>
    <span class="hikashop_product_sale_start">
        <?php echo JText::sprintf('ITEM_SOLD_ON_DATE', hikashop_getDate($startTs, $fmt)); ?>
    </span>
<?php endif; ?>
<!-- EO SALE START MESSAGE -->

Product listing view
On my site the text is rendered not in listing_* files but in:

File adjusted (override): product/add_to_cart_ajax.php
(That’s where the listing replaces the add-to-cart area with the “available from …” notice before the sale starts.)

Same idea—keep the logic, enforce a time-aware format:
<!-- SALE START MESSAGE -->
<?php
$startTs = is_numeric($start_date) ? (int)$start_date : strtotime((string)$start_date);

if ($startTs && $startTs > time()) :
    // Format holen; Uhrzeit anhängen, falls nicht vorhanden
    $fmt = (string) $this->params->get('date_format', '%d %B %Y');
    if (strpos($fmt, '%H') === false && strpos($fmt, '%I') === false) {
        $fmt .= ' %H:%M';
    }
    ?>
    <span class="hikashop_product_sale_start">
        <?php echo JText::sprintf('ITEM_SOLD_ON_DATE', hikashop_getDate($startTs, $fmt)); ?>
    </span>
<?php endif; ?>
<!-- EO SALE START MESSAGE -->

Notes / gotchas
If your product_sale_start is stored without a time component, you’ll see … 00:00. If you want a fixed time (e.g. 08:00) whenever hours/minutes are zero, you can add a small check and adjust the timestamp before formatting.

Make sure there is no translation override removing the %s in ITEM_SOLD_ON_DATE, and clear Joomla cache (and any optimizer/minifier cache) after changes.

With the above two edits, both the detail page and listing now display date + time reliably.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.066 seconds
Powered by Kunena Forum