How to show Magento’s configurable product inventory

Asked

Viewed 312 times

1

Good afternoon!

I’m picking up here to settle this matter. In my store, the configurable products even appear the stock, but the first item appears as "null". See the image below:

inserir a descrição da imagem aqui

My working version is 1.9.1.0.

This is the excerpt from my file, where the modification was made: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php

$simpleproduct = Mage::getModel('catalog/product')->load($productsIndex); 
$qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($simpleproduct)->getQty();

$info['options'][] = array(
'id'        => $value['value_index'],
'label'     => $value['label'],
'price'     => $configurablePrice,
'oldPrice'  => $this->_prepareOldPrice($value['pricing_value'], $value['is_percent']),
'products'  => $productsIndex,
'qty'       => $qty, // we are sending stock parameter so we can use it latter in drop down field
);

Any suggestions? I’ve done a lot of research on Google, several tests, but without success!

I thank you all!


To show the stock as in the image, follow this answer: https://stackoverflow.com/questions/33319680/show-stock-of-configurable-products-on-magento-1-9

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.