Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - FashionMart (SKU# FLEX-00008)

TOPIC: Colored stock level in Product details view?

Colored stock level in Product details view? 11 years 3 months ago #1585

Is it possibe to get

In stock: (0) ..................................... (in red)
In stock: (1) (and higher) .............(in green)
<?php if (VmConfig::get ( 'display_stock', 1 )) { ?><div class="FlexibleInStockLevel"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP'); ?>: (<?php echo $this->product->product_in_stock; ?>)</div> <?php } ?>

As far as I can see, the file to edit is: html\com_virtuemart\productdetails\default_addtocart.php
Or not?

I have some knowledge on how to edit these files, but I know my limitation... ;)

:)
The topic has been locked.

Colored stock level in Product details view? 11 years 3 months ago #1597

Hi,

Since this is a customization question, i shouldn't supposed to provide you a solution, but since it is a simple one; here you go ;)

By default, when the product is out of stock;
It display this:
<span class="ProductDetailsoutofstock">	
 <?php echo JText::_('COM_VIRTUEMART_CART_PRODUCT_OUT_OF_STOCK'); ?>
 </span>

(look at the 71st line in html\com_virtuemart\productdetails\default_addtocart.php)

and change it with this:
<span class="ProductDetailsoutofstock">	
In stock(0)
 </span>

It will be shown as : In Stock (0)
This class name: ProductDetailsoutofstock is already set font-color:#ff0000 (red), so you will get what you want.

If the product is in stock and if the "show stock level" option is set to YES (through VM Configuration)

Attachment PastedImage121212103AM.gif not found



It display this:
<div class="FlexibleInStock"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_IN_STOCK'); ?></div>
         <?php if (VmConfig::get ( 'display_stock', 1 )) { ?><div class="FlexibleInStockLevel"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP'); ?>: (<?php echo $this->product->product_in_stock; ?>)</div> <?php } ?>

Since the class name: FlexibleInStock is already set to font-color: green, this text will be shown as: In Stock (1) or In Stock (11)

So you will get what you want.

Regards.
Forum Support.
Last Edit: 11 years 3 months ago by Support.
The topic has been locked.

Colored stock level in Product details view? 11 years 2 months ago #1831

Thanks for trying, but I didn't get it to work..
Actually, nothing I do in that default_addtocart.php file matters. No change....

Am I in the wrong file?
The topic has been locked.

Colored stock level in Product details view? 11 years 2 months ago #1835

Hi,

It is a simple one but probably you were missing something.
Provide me your FTP credentials to This email address is being protected from spambots. You need JavaScript enabled to view it. and let me take care of this for you.

Regards.
The topic has been locked.

Colored stock level in Product details view? 11 years 2 months ago #1851

Thank you, and you've got mail! ;)


:)
The topic has been locked.

Colored stock level in Product details view? 11 years 2 months ago #1854

Hi,

This problem has been fixed through emailing.

Case Solved. Topic is closed.
The topic has been locked.
Time to create page: 0.182 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo