Archive » September 2015

Get the current store details like store code, name, status, currency etc.

Magento

You can use the following line to get the current store object.

// Get the current store
$store = Mage::app()->getStore();

Below is the sample code showing you how you can access the store data. Two ways have been provided below to access the same data, you can use any one of them.

//Get the current store id
$storeId = $store->getData('store_id');

$storeId = $store->getStoreId());

//Get the current store code
$storeCode = $store->getData('code');

$storeCode = $store->getCode();

Continue reading »

Child theme stylesheet loading before the parent theme stylesheet

Wordpress

I was creating a child theme for a wordpress theme. I created style.css file in child theme which overrided some of the parent theme styles and a functions.php file which included the parent style.css as below:


<?php
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
?>

Now when I activated the child theme from Wordpress admin, changes in the child theme were not reflecting. I checked the browser source code and found that the child style.css was included before the parent style.css.

Continue reading »

Back to top