How to determine Store ID for multi-type Magento site

Share
Posted on May 7th, 2013 | Posted by admin

Here is a quick reference for you, if you run Magento under Multi-language, Multi-Currency or Multi-Domain (Multi-Website).

Sometime you need pick up the Store ID do some (IF…ELSE…) work. Here is the code:

1
<?php $store_id = $this->helper('core')->getStoreId(); echo $store_id; ?>

How to Obtain Custom Attribute Values in Magento

Share
Posted on April 3rd, 2013 | Posted by admin

Today let’s talk about Magento and custom attributes. With Magento you can create as many custom attributes for your products as you like, and there are different attribute types such as:

  • Text Field
  • Text Area
  • Date
  • Yes/No
  • Multiple Select
  • Dropdown
  • Price
  • Gallery
  • Media Image
  • Fixed Product Tax

Magento: How to get all attribute codes by product object or attribute set ID

Share
Posted on April 1st, 2013 | Posted by admin

I’m writing an script for exporting Magento products to an XML file. In my PHP script, I have decided to create an class for holding the data of Magento product. In that class which defines all attributes from a product like the editing product screen from back-end

how to show tier price in order view page

Share
Posted on January 25th, 2013 | Posted by admin

I have used the following code for showing tier price in order view page in Magento

$tier_prices = Mage::getModel(“catalog/product”)->load($_item->getProductId())->tier_price ;
if(!empty($tier_prices)) {
foreach($tier_prices as $tier_price){
if($tier_price['all_groups']==1){
print  “All – Groups “.number_format($tier_price['price']).” <br> ” ;
}else{
$group = Mage::getModel(“customer/group”)->load($tier_price['cust_group']) ;
echo $group->customer_group_code.” – “.number_format($tier_price['price']).” <br> ” ;
}
}
}

How to get ordered Items and their detail for an order ID in Magento?

Share
Posted on December 29th, 2012 | Posted by admin

How to get ordered Items and their detail for an order ID in Magento?

I tried to wrote this code when I was working on a cron file for all orders. My client wants a cron file that get all orders information including all ordered item and their detail.

First, I searched on google but I didn’t found any exact solution then I tried below code:

By below code I got all orders on site:

Page 1 of 2112345»1020...Last »