VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: danilo58 on February 07, 2017, 12:12:06 PM

Title: how to manage columns in administrator product list
Post by: danilo58 on February 07, 2017, 12:12:06 PM
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
Title: Re: how to manage columns in administrator product list
Post by: AH on February 07, 2017, 12:57:31 PM
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>

Title: Re: how to manage columns in administrator product list
Post by: danilo58 on February 07, 2017, 13:03:25 PM
Hi, thank for the information, but cannot find the route to the default.php archive
Title: Re: how to manage columns in administrator product list
Post by: AH on February 07, 2017, 13:07:49 PM
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
Title: Re: how to manage columns in administrator product list
Post by: danilo58 on February 07, 2017, 13:09:16 PM
ok, thanks!