News:

Looking for documentation? Take a look on our wiki

Main Menu

Image "on stock" disapears when updating stock

Started by RensvN, June 12, 2017, 09:29:10 AM

Previous topic - Next topic

RensvN

Hi Guys,

I'm using Joomla 3.7.2 in combination with VirtueMart 3.2.2 for my webshop.
I have an question wich might be an bit complicated to explain but I'll try my very best.

I made an custom image to show that products are 'on stock' or 'out of stock'.
I'm editing these products images manual, that means when I'm selling my last product in stock I'll change the image.
It's a bit complicated because I'm also selling products on dropshipping base, that means the image shows they are 'on stock', but I don't have them 'on stock' myself.

Last week I was also adding my current stock into Virtuemart to make it easy for me to see my current stock.
Unfortunately I saw that all products wich are 'on stock' don't have this image anymore.
The products were no stock was added are still showing the image.

That means that all products wich are 'on stock' at my wholesaler are showing 'on stock' in my webshop.
The products wichou are 'out of stock' are showing the image 'out of stock'
But the products I have on stock are showing no image yet.

Any idea how to change this?

AH

VM supports stock handling and ordering based on stock levels/items on order

But there are some questions:-

Do you want to allow people to order out of stock items ?
Do you want to display the stock level for an item or show just an image that the item is in stock. 







Regards
A

Joomla 3.10.11
php 8.0

RensvN

Thank you for your answer:

Do you want to allow people to order out of stock items ?
Yes this must be possible, because I did only update the products wich I have in stock, so stock level for products on dropshipment base will stay at '0'
I already use the first option: Products Out of Stock are orderable, no special action

Do you want to display the stock level for an item or show just an image that the item is in stock.
I prefer to just show an image.

AH

So you could do an product view override

if (($product->product_in_stock - $product->product_ordered) < 1) {

<div class="availability">
<?php echo (file_exists(JPATH_BASE DS VmConfig::get('assets_general_path') . 'images/availability/' $product->product_availability)) ? JHtml::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' $product->product_availability$product->product_availability, array('class' => 'availability')) : vmText::_($product->product_availability); ?>
</div>

}


And you can create your own availability image and set that availability image in the admin configuration.


Regards
A

Joomla 3.10.11
php 8.0

RensvN

OKe thanks, were do I need to place this code?

AH

You will need to determine where best suits your need.

Regards
A

Joomla 3.10.11
php 8.0

RensvN

Thanks for your reply.
I prefer to place it on the same location were it already was before (see image):



As I mentioned before the picture just disapears when I'm entering the stock of an specific article.

AH

The code snippet was just an idea and not the final code

Depending on what you want to do and where you want to show this - then a number of things would need to be considered.

I am not trying to provide the solution for you - just letting you know that it is possible.
Regards
A

Joomla 3.10.11
php 8.0

RensvN

I see, thank you.

Unfortunately I don't know enought about Joomla/Virtuemart to modify this myself, that was why I was asking it at this forum.
I just want to get the image showed, no mather if there is stock or not.
I will change the image 'on stock' to 'out of stock' manually.

My problem is that no pictures were showing after I add stock to each product.