Hi, I am new to this forum. No idea if this is the correct place to ask. I am not very good with PHP.
I am running 2.3.0.2, which has the show stock quantity on product page. I am trying to set the product page stock availability to show "In stock", in green text when the quantity is above 5. "Low Stock, 'quantity' Left", in orange, when the stock is below 5. "Out of stock", in red, when the stock is 0.
Somehow, I manage to get it to work as above 5, it shows "In Stock", below 5, it shows, "quantity", 0, it shows "Out of Stock". However, I am unable to add text to the quantity part, and also unable to change the text color.
What I had changed in catalog/controller/product/product.php is as follow:
From:
if ($product_info['quantity'] <= 0) {
$data['stock'] = $product_info['stock_status'];
} elseif ($this->config->get('config_stock_display')) {
$data['stock'] = $product_info['quantity'];
} else {
$data['stock'] = $this->language->get('text_instock');
}
To:
if ($product_info['quantity'] <= 5) {
$data['stock'] = $product_info['quantity'];
} elseif ($product_info['quantity'] <= 0) {
$data['stock'] = $product_info['stock_status'];
} else {
$data['stock'] = $this->language->get('text_instock');
}
The above changes was able to get the changes as I mention. But, I have trouble adding text and changing the color to it in HTML. Does anyone knows how to add text and also change the color?
Thanks in advanced.
Who is online
Users browsing this forum: No registered users and 69 guests