I want to add the stock column in the administrator product list, replacing other column, its that possible? Joomla 3.6.5. virtuemart last version
Yes - just do an override
\administrator\templates\isis\html\com_virtuemart\product\default.php
Here is a piece of code that may help you easily see the stock position in relation to stock and low stock notification
You can add the relevant CSS in the admin tenplate to set the color of the text for various status of stock.
<td>
<!--Stock details-->
<?php
if ($product->published) {
$available = $product->product_in_stock - $product->product_ordered;
if ($available < 1){
echo "<div class='stockout'>";
echo "Out ". $available;
} elseif ($available > 1 && $available < $product->low_stock_notification ) {
echo "<div class='stocklow'>";
echo "Low ". $available;
} else {
echo "<div class='stockok'>";
echo "In ". $available;
}
echo "</div>";
echo 'Stk: '.$product->product_in_stock;
}
?>
</td>
Hi, thank for the information, but cannot find the route to the default.php archive
The original file is :-
administrator\components\com_virtuemart\views\product\tmpl\default.php
Copy this file to the directory where overrides for the admin will function
\administrator\templates\YOUR-ADMIN-TEMPLATE\html\com_virtuemart\product\default.php
ok, thanks!