News:

Looking for documentation? Take a look on our wiki

Main Menu

[SOLVED] How to show Products in Stock in Cart ?

Started by restodo, July 31, 2014, 20:04:41 PM

Previous topic - Next topic

restodo

Hi,

I want to know how to show product_in_stock in cart ?

I know how to show in category ($product->product_in_stock) & product details ($this->product->product_in_stock).


Greets!

GJC Web Design

assume would have to get the product model in the template and use one of the functions to return each prodid's parameters

They aren't there as standard - just the cart object

or a query on each prodid to get the stock
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

restodo

Quote from: GJC Web Design on July 31, 2014, 21:45:12 PM
assume would have to get the product model in the template and use one of the functions to return each prodid's parameters

They aren't there as standard - just the cart object

or a query on each prodid to get the stock

Thanks for your answer.

Yes I think you're right because cart object didn't gave me the correct value but I don't know how to get product model.


GJC Web Design

something like (haven't tried this)

$productModel = VmModel::getModel('Product');

then in the loop of the default_pricelist.php

$singleproduct = $productModel->getProductSingle ($virtuemart_product_id = $prow->cart_item_id, $front = TRUE, $quantity = 1,$customfields=TRUE,$virtuemart_shoppergroup_ids=0)

stock (maybe ) is   $singleproduct->product_in_stock;
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

restodo

Quote from: GJC Web Design on July 31, 2014, 22:39:25 PM
something like (haven't tried this)

$productModel = VmModel::getModel('Product');

then in the loop of the default_pricelist.php

$singleproduct = $productModel->getProductSingle ($virtuemart_product_id = $prow->cart_item_id, $front = TRUE, $quantity = 1,$customfields=TRUE,$virtuemart_shoppergroup_ids=0)

stock (maybe ) is   $singleproduct->product_in_stock;


Thanks for your help!! it works very good!!

Greets from Argentina.