Magento – get configurable product from simple product by id or sku

If you have SKU of simple product: view source code$product_id = "1"; $productId = Mage::getModel("catalog/product")->load( $product_id ); $parentIds = Mage::getResourceSingleton(‘catalog/product_type_configurable’) ->getParentIdsByChild($productId); $_product = Mage::getModel(‘catalog/product’)->load($parentIds[0]); print_r($_product->getData());$product_id = "1"; $productId = Mage::getModel("catalog/product")->load( $product_id ); $parentIds = Mage::getResourceSingleton(’catalog/product_type_configurable’) ->getParentIdsByChild($productId); $_product = Mage::getModel(’catalog/product’)->load($parentIds[0]); print_r($_product->getData());

Github – create new repository, checkout, branches, pull, push in branches / master

Hell Friends, I am using github last year to manage code of the application and just keep in mind to share about the github which any Software Engineer can easily learn git who interested. I know that you have used SVN before but github is very latest technology for code management. Then word “GitHub” comes Read the full article…

Pyramid shape of stars in PHP

view source codefor($i=0;$i<5;$i++){ for($j=0;$j<5;$j++){ if($j < $i ) { echo "*"; } } echo "*<br>"; } Result: * ** *** **** *****for($i=0;$i<5;$i++){ for($j=0;$j<5;$j++){ if($j < $i ) { echo "*"; } } echo "*<br>"; }   Result:   * ** *** **** *****

What is different of Pass by Reference in php4 and php5.

Hello Developer, This is very interesting question for any php developer who work on PHP4 and PHP5. First, we should understand that what is the Pass by Reference? Below the very simple example in PHP4 & PHP5. In PHP4, everything was passed by value, including objects. Whereas in PHP5, all objects are passed by reference. Read the full article…