Monthly Archives: April 2015

  1. Magento: Calling block programmatically in magento

    Magento: Calling block programmatically in magento

    Here is the code for calling block in Magento:-
    Module page
    [php]
    <?php echo $this->getLayout()->createBlock('newmodule/newblock')->setTemplate('newmodule/newblock.phtml')->toHtml();...

    Read more »
  2. Magento: Getting Associated products of bundle products or displaying simple products of bundle products

    Magento: Getting Associated products of bundle products or displaying simple products of bundle products

    [php]
    $product_id=48;
    $bundled_product = new Mage_Catalog_Model_Product();
    $bundled_product->load($product_id);
    $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(...

    Read more »
  3. Magento: Convert price from default currency to some other currency

    To convert the price to some other currency we need to select that currency in allowed currency and import currency rates from System->Manage currency ->Rates .
    The...

    Read more »
  4. Magento: Get simple products of a configurable product

    [php]
    $productId = 7; //product id of configurable product

    $_Product = Mage::getModel('catalog/product')->load($productId);
    $simpleProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);...

    Read more »