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

VM2.6.14 - stock info not show when 1 product in stock

Started by stawebnice, January 28, 2015, 20:58:18 PM

Previous topic - Next topic

stawebnice

Hi,

please advise. We have a problem with this eshop in VM 2.6.14.
When we have only 1 piece in stock, no availability info is shown on product detail page.
When there are 2 or more pieces in stock, it shows "in stock (skladem)" : http://www.dmack-shop.cz/dmack-dmt-rc-195-50-r15-t5-rally-pneu
and when there is 0, it shows the availability image... http://www.dmack-shop.cz/maxxis-m-6011r-mt90-r16-74h-tl-moto-pneu

is this some by design feature or a bug,or can this be overriden by some settings?

we have these settings in VM:
http://imtp.me/8ybi02lj3.p

temporarily we have solved it by setting the number to 2  and making 1 reserved, but that is no solution for other products whose stock can get to 1 when products are sold...

GJC Web Design

AFAIK stock display is handled by the template

the stocklevel is available in the template as $this->product->product_in_stock

what u do with it is up to the code in the template - e.g. show different images or text etc depending in its value
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

stawebnice

Thank  you. I have located three files that include the text that you sent me, but  I   am not able to say which is responsible for the strange fact that stock-1 hides the availability...I am attaching them  in the zip. Would you be so kind and take a look at them and advised what should be changed,please?

GJC Web Design

I don't do house calls but as a one off this took 10 seconds to find

        <?php
if ($this->product->product_in_stock < 1) {
echo  "Dostupnost: Na dotaz";
} else {
if ($this->product->product_in_stock > 1) {
echo  "Dostupnost: Skladem";
}
} ?>

so less than 1 ->

then more than 1->

and when it is 1 ?????????????????????????????????

hmmmmm -- who's responsible for this code?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

stawebnice

a desperate friend of mine, who created the shop had other people fix things for him and now he asked me to clean the mess. Thank you! I owe you!