News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

add extra availability in product status

Started by tomsson, May 30, 2017, 12:02:28 PM

Previous topic - Next topic

tomsson

Hello

I'am using VM 3.0.18 + Joomla 3.7.2
I need extra "Availability" in product status.  It is possible ?

K&K media production

There is a hint on ? hover:

Availability OR select an Image to be displayed on the Details Page.
The images reside in the directory /components/com_virtuemart/assets/images/availability/

QuoteI'am using VM 3.0.18 + Joomla 3.7.2

You should update vm, because 3.0.18 is not completly compatible with J 3.7.2

tomsson

#2
I do not understand your answer.
I need to add adlist extra availability called "In stock"

dslove

tomsson, do you need something like what appears in the attached screenshot?

tomsson


dslove

Great! :)
If anyone else needs help with this, they can post here & I will be happy to share the code.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Evgen78

#7
Quote from: dslove on June 07, 2017, 23:01:39 PM
Great! :)
If anyone else needs help with this, they can post here & I will be happy to share the code.

Hi!

I do!

how is it done?

Studio 42

Evgen78, It depend the template and your Joomla release, the products layout need change.
But in productdetails view, you have a sample code to display stock.

dslove

This is how I did it:

1) In the sublayouts/products.php file (category view of product), inside the product container and right after the code for the thumbnail, I placed the following piece of code

<span class="label label-default vmicon vm2-<?php echo $product->stock->stock_level ?> small" title="<?php echo $product->stock->stock_tip ?>">Stock</span>

When the product is in stock, the HTML output will be:

<span class="label label-default vmicon vm2-normalstock small" title="We have plenty of stock for this product">Stock</span>

When product is out of stock, HTML output is:

<span class="label label-default vmicon vm2-nostock small" title="Sorry, we currently have no stock for this item">Stock</span>

2) Now, it's time to create the CSS styles for your HTML. Most of the above classes (.label .label-default .small) are standard Bootstrap classes (the framework I used for the specific template), but the finishing touch was done with Font Awesome (already included in the template, because it's neat and I love it):



.vm2-normalstock::after {
    margin-left: 6px;
    font-family: 'FontAwesome';
    content: '\f00c';
    font-size: 20px;
    color: #5cb85c;
}

.vm2-nostock::after {
    margin-left: 6px;
    font-family: 'FontAwesome';
    content: '\f00d';
    font-size: 20px;
    color: #FF0000;
}



Hope this helps :)