Instock on page products should not be visible

25 April, 2016
GK User
Sun Jun 12, 2016 10:53 am
Hello,
Though Display stock level is not selected in virtuemart panel : Configuration/Shopfront/Product Listing, it is visible in the product pages with Box template.
If another template is selected, it is not present (this is completely normal).
Where is your mistake coding ? I would like to remove it.
instock.jpg

Regards,
Thanks,
Kris
User avatar
Expert Boarder

teitbite
Thu Jun 16, 2016 9:07 am
Hi

Please tell me the url to the exact page I'll be able to see this problem.
User avatar
Moderator

GK User
Thu Jun 16, 2016 9:16 am
Hi Teitbite,
of course.
http://cgla44.graphicom.fr/la-boutique/ ... etail.html
any product has the information.
User avatar
Expert Boarder

teitbite
Sun Jun 19, 2016 10:39 am
Hi

Please edit file /html/com_vieruemart/productdetails/default.php and remove line 222:

Code: Select all
<?php echo JText::_('TPL_GK_LANG_IN_STOCK') . ' ' . ($this->product->product_in_stock - $this->product->product_ordered); ?>
User avatar
Moderator

GK User
Sun Jun 19, 2016 9:31 pm
Thanks for that, that helps. But what if I want to see the stock one day. Normally there is no need to delete a line of code as it is an option in virtuemart to show the stock or not.
And what if I update the template ? This is not really clean don't you think ?
Regards
User avatar
Expert Boarder

teitbite
Tue Jun 21, 2016 11:08 am
Hi

This is how it was designed. This is why it's in template's override part to force it to show it and fill the idea designer had. You can always disable override, but that would remove the layout for this page that's why I'm advicing how to adjust the look.
User avatar
Moderator

GK User
Tue Jun 21, 2016 11:52 am
Hi Teitbite,
I think (and I am sure 99,9%) it is an error in the code of the template's override from the designer to have this line like that because it should normally react when the webmaster wants to show or hide the stock information. As it does with basic joomla templates.
This option is here : yoursite.com/administrator/index.php?option=com_virtuemart&view=config
tab Shopfront, Product Listing and the option is Display stock level
Don't you think ?
Regards.
Kris
User avatar
Expert Boarder

teitbite
Wed Jun 22, 2016 12:11 pm
Hi

All I know is that the hide/show condition was there and it was removed on purpose. So I think someone wanted it to be forced. from some reason. Unfortunately I do not have a direct access to designers to ask why.
User avatar
Moderator


cron