Hi
OK, here is my solution to my situation with pre-order.
I added a Custom Field: pre_order
I added two language strings to /language/overrides/en-GB.override.ini:
ITEM_PRE_ORDER_DATE="<div class="hikashop_product_pre_order"><span>Pre-Order!</span> This item will be available on %s</div>"
PRE_ORDER_ADD_TO_CARD="Pre-Order and add to cart"
I made a View Override of quantity.php and added:
} elseif($start_date && $start_date > time() && empty($this->row->pre_order)) {
?>
<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
} elseif(!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || !empty($this->row->prices))) {
if($start_date && $start_date > time() && !empty($this->row->pre_order)) {
echo JText::sprintf('ITEM_PRE_ORDER_DATE', hikashop_getDate($start_date, $this->params->get('date_format','%d %B %Y')));
}
This will show $start_date if pre-order is not set and it will not show add-to-cart button. If pre-order is set then it will move on to normal hikashop flow. Here I then show the pre-order text.
For the add-to-cart button I check if it's pre-order or normal buy:
if($this->params->get('add_to_cart', 1) && $start_date && $start_date > time() && !empty($this->row->pre_order)) {
echo $this->cart->displayButton(JText::_('PRE_ORDER_ADD_TO_CARD'), 'add', $this->params, $url, $this->ajax, '', $max, $min);
} else {
echo $this->cart->displayButton(JText::_('ADD_TO_CART'), 'add', $this->params, $url, $this->ajax, '', $max, $min);
$btnType = 'wish';
}
Feel free to correct me if I missed something. But it seems to be working.
Regards,
Henrik
From commit: