How to bring new products to the module without considering the number of stock?

Started by VopoloS, August 20, 2016, 06:15:49 AM

Previous topic - Next topic

VopoloS

How to bring new products to the module without considering the number of stock = 0?
The site uses a standard module mod_virtuemart_product. And uses the parent and child items. In the rest of the parental goods warehouse is always 0. This module does not display new items. How to get around this problem?
(VM 3.0.16)
Thank you in advance for your reply.

GJC Web Design

hmmm..
the module uses the std. products model and that query considers stock if that is your admin setting

if($isSite and !VmConfig::get('use_as_catalog',0)) {
if (VmConfig::get('stockhandle','none')=='disableit_children') {
$where[] = ' ( (p.`product_in_stock` - p.`product_ordered`) >"0" OR (children.`product_in_stock` - children.`product_ordered`) > "0") ';
$joinChildren = TRUE;
} else if (VmConfig::get('stockhandle','none')=='disableit') {
$where[] = ' p.`product_in_stock` - p.`product_ordered` >"0" ';
}
}


without a hack there unless u set the stock to be ignored I don't see a solution except to rewrite the module to get the latest etc directly
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

VopoloS

Thank you for your prompt response. But I don't quite understand, which file to insert this code, that would ignore the inventory balance. Could you help me to upgrade mod_virtuemart_product?

GJC Web Design

the code is the code that is already there in the products model...

it isn't simple because if u disable this check it will be global... 

you can try to see what results you get...  maybe the custom field don't show parent will prevent the parent showing

administrator\components\com_virtuemart\models\product.php    function sortSearchListQuery()

~ line 350
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