Skip to content

Instantly share code, notes, and snippets.

View rintoug's full-sized avatar

Rinto George rintoug

View GitHub Profile
@rintoug
rintoug / magento.xml
Created March 25, 2017 16:03
Changing the position of store switcher to header magento
<reference name="header">
<!-- jumpToMenu added -->
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="core/template" name="jumpToMenu" template="page/html/jumptomenu.phtml"/>
</reference>
@rintoug
rintoug / magento.xml
Created March 25, 2017 16:10
Magento Merged CSS Cache Clear Not Working
<?xml version="1.0"?>
<!-- app/etc/modules/Magrin_Cachefilter.xml -->
<config>
<modules>
<Magrin_Cachefilter>
<active>true</active>
<codePool>local</codePool>
</Magrin_Cachefilter>
</modules>
</config>
@rintoug
rintoug / config.xml
Created March 25, 2017 16:11
Magento Merged CSS Cache Clear Not Working
<?xml version="1.0" encoding="UTF-8"?>
<!--app/code/local/Magrin/Cachefilter/etc/config.xml -->
<config>
<modules>
<Magrin_Cachefilter>
<version>0.1.1</version>
</Magrin_Cachefilter>
</modules>
<global>
@rintoug
rintoug / Package.php
Created March 25, 2017 16:14
Magento Merged CSS Cache Clear Not Working
<?php
// app/code/local/Magrin/Cachefilter/Model/Design/Package.php
class SW_Core_Model_Design_Package extends Mage_Core_Model_Design_Package
{
/**
* Get the configuration variable
*
* @return string
*/
@rintoug
rintoug / magento.xml
Created March 25, 2017 16:17
Magento Merged CSS Cache Clear Not Working
<?xml version="1.0"?>
<!--// app/code/local/Magrin/Cachefilter/etc/system.xml-->
<config>
<sections>
<dev translate="label">
<groups>
<magrin_cache translate="label">
<label>Cache Clear String</label>
<frontend_type>text</frontend_type>
<sort_order>100</sort_order>
@rintoug
rintoug / magento.php
Created March 25, 2017 17:24
Magento notification system
<?php
public function sendAction()
{
try
{
$mail = new Zend_Mail();
$mail->send();
}
catch (Exception $e)
{
@rintoug
rintoug / simpleproduct.php
Created March 25, 2017 17:31
Get simple products belonging to configurable products in magento
<?php
$productId = 200; //Its my product id
$product = Mage::getModel('catalog/product')->load($productId);
@rintoug
rintoug / simpleproduct.php
Created March 25, 2017 17:32
Get simple products belonging to configurable products in magento
<?php
if($product->getTypeId() == "configurable"):
echo "yes";
endif;
@rintoug
rintoug / simple.php
Last active June 4, 2017 08:03
Get simple products belonging to configurable products in magento
<?php
$configurable= Mage::getModel('catalog/product_type_configurable')->setProduct($product);
$simpleCollection = $configurable->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
@rintoug
rintoug / simple.php
Created March 25, 2017 17:33
Get simple products belonging to configurable products in magento
<?php
foreach($simpleCollection as $simpleProduct){
echo "name:".$simpleProduct->getName();
echo "<br>";
echo "price:".$simpleProduct->getPrice();
echo "<br>";
}