-- url of the page with the problem -- :
www.genusskanzlei.at/
-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.2.12
-- Browser(s) name and version -- : Chrome
Hi
I have once programmed a condition that when we set the quantity to "-2", with the help of a new constant 'IN_STORE,' the front-end will display "Available at the Store" (Erhältlich im Geschäft) instead of "out of stock."
After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.
For example, when I look at the following category:
www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche
all the products display the standard 'NO_STOCK' --> "Out of Stock" ("Nicht vorrätig")
However, when I view the product page, I do get the 'IN_STORE' message but also the "add to cart"; which in this case shouldn't be displayed since they can only be ordered directly.
I edited the 'com_hikashop/product/quantity.php' and changed:
$stock_class = ($stock != 0) ? "" : " hikashop_product_no_stock";
?>
<span class="hikashop_product_stock_count<?php echo $stock_class; ?>">
<?php
if(!empty($this->row->product_stock_message))
echo JText::_($this->row->product_stock_message);
elseif($stock > 0)
echo (($stock == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $stock) : JText::sprintf('X_ITEMS_IN_STOCK', $stock));
elseif(!$in_stock)
echo JText::_('NO_STOCK');
?>
</span>
<?php
to
$stock_class = ($stock != 0) ? "" : " hikashop_product_no_stock";
?>
<span class="hikashop_product_stock_count<?php echo $stock_class; ?>">
<?php
if($this->row->product_quantity == -2)
echo JText::_('IN_STORE');
elseif(!empty($this->row->product_stock_message))
echo JText::_($this->row->product_stock_message);
elseif($stock > 0)
echo (($stock == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $stock) : JText::sprintf('X_ITEMS_IN_STOCK', $stock));
elseif(!$in_stock)
echo JText::_('NO_STOCK');
?>
</span>
<?php
I want the 'IN_STORE' message to display in the "listing views" and that the "add to cart" options, does not show for this condition. How can I edit the code to achieve these results?
I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.
Thanks a lot in advance!