News:

Looking for documentation? Take a look on our wiki

Main Menu

VM 2.0.16 category view

Started by Doggiefield, December 27, 2012, 22:45:20 PM

Previous topic - Next topic

Doggiefield

In the category view I have the following code:

<?php
echo $product->product_in_stock_supplier
echo 
$product->product_in_stock?>



It used to work in VM 2.0.14 but now I have updated to VM 2.0.16 and $product->product_in_stock is showing but $product->product_in_stock_supplier doesn't show anymore.

Does anybody know what is wrong here?
Point of sale for Virtuemart
https://www.posforwebshops.com

Doggiefield

Maybe it needs some more explanation:

I use the stock of a supplier as well as our own stock. For the stock of the supplier I have added a new row in the products table.
In the last versions of VM I could call it in default.php (category view) as mentioned in the first post. Since I have updated VM to 2.0.16 it doesn't work anymore.

Does anybody have any ideas how to fix this?
Point of sale for Virtuemart
https://www.posforwebshops.com

jjk

The only idea I have is that your changes were overwritten with the update, unless you were using 'Joomla overrides' instead of changing the original file.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Doggiefield

Hi jjk,

Thanks for your reply.
I use my own templating, so nothing is overwritten in the original VM files.
I placed this function in /templates/my_template/html/com_virtuemart/category/default.php

This used to work in the vm versions 2.0.6 up to 2.0.14
But something has changed in 2.0.16 that is no longer possible to call on this db table colomn.

I tried to move this topic to "Bugs and Devellopment" because I think it might be better in place there. But the new topic is closed.
Point of sale for Virtuemart
https://www.posforwebshops.com

jjk

#4
Are you still using your adjusted 2.0.14 default.php in your override or did you adjust the 2.0.16 version and placed that one in your override folder? I don't see any code changes in SVN related to stock display after the release of 2.0.14.
(BTW - since your change is not a VM core bug, this forum section is the correct one)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Doggiefield

I still use the same template as before, but I saw no significant changes that will cause this problem.

We have added the column in the products table for a better stock control, but we don't use this for the actual stock.
The only thing is that it isn't possible anymore to display this specific data in the category view.
Point of sale for Virtuemart
https://www.posforwebshops.com

Doggiefield

Solved.
A friend of mine pointed out that there where changes in: /administrator/components/com_virtuemart/tables/product.php
the table "products" isn't load fully anymore

I have choosen to leave this file for what it is (I want no hacks in VM) and put the following in my category view

$this->db = JFactory::getDBO();
$this->db->setQuery('SELECT product_in_stock_supplier FROM `#__virtuemart_products` WHERE `virtuemart_product_id` ='.$product->virtuemart_product_id);
$product_in_stock_supplier = $this->db->loadResult();


Maybe this could help someone
Point of sale for Virtuemart
https://www.posforwebshops.com