News:

Support the VirtueMart project and become a member

Main Menu

how to manage columns in administrator product list

Started by danilo58, February 07, 2017, 12:12:06 PM

Previous topic - Next topic

danilo58

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

AH

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 && $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>

Regards
A

Joomla 3.10.11
php 8.0

danilo58

Hi, thank for the information, but cannot find the route to the default.php archive

AH

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
Regards
A

Joomla 3.10.11
php 8.0