Importing regular, special, tier & group prices using ‘Mass Importer Pro: Price Importer’ Extension

July 1, 2012  |  4 Comments  |  by Raj (MagePsycho)  |  Latest, Magento

Recently, the MagePsycho team developed Mass Importer Pro: Price Importer Extension, the fastest price import tool for Magento. It provides for importing/updating different prices, such as regular, special, tier, and group prices. This article will serve as documentation for the Mass Importer Pro: Price Importer Extension.

1. INSTALLATION

0. Before installation, make sure that Cache(System > Cache Management) / Compilation(System > Tools > Compilation) is disabled.
1. After the purchase of the extension, you can immediately download the extension from www.magepsycho.com > My Account > My Downloadable Products.
2. Unzipping it, you will get ‘app’ & ‘var’ folders and ReadMe.txt file.
Upload the ‘app’ & ‘var’ folder to the root of your Magento installation.
Note that upload of ‘var’ folder is optional as it contains some sample csv files only.
4. Installation is done!
5. After installation, you can enable the Cache / Compilation if required.

2. CONFIGURATION

After installation, login to the admin. If you get 404 error page in the extension page then try to logout and re-login.
You will now see the top level menu called ‘Mass Importer Pro’ in the admin:

Mass Importer Pro Menu

Extension Activation

0. Go to ‘Mass Importer Pro’ > ‘Price Importer’ menu, you will see the following form (with disabled ‘Run Import’ button) which means you need to enable the extension and activate it with provided license key.

Disabled Run Import Button


1. Go to ‘Mass Importer Pro’ > ‘Manage Settings’ menu, you will see the following section for configuration:

Configuration Section for Mass Importer Pro: Price Importer


And configure as:
[General Settings]
Enabled = Yes
Domain Type = Production / Development
License Key = [will be provided in the email shortly after the purchase of the extension]

[Price Settings]
Tier Price Import Type = Merge / Replace (Group / All)
Group Price Import Type = Merge / Replace (Group / All)
Re-Index Product Price After Import = Yes / No
[This setting will be used as default for importing prices]
2. Go to ‘Mass Importer Pro’ > ‘Price Importer’ menu, You will see the activated ‘Run Import’ button which means you are ready to go with unlimited price imports.

Enabled / Activated Import Form


3. Configuration is done!

3. IMPORTING PRICES

After the extension gets installed and configured properly, you should be able to import prices using csv file. Before importing, you need to know the supported csv fields and valid data format required for the extension.

Preparing CSV Fields
You can refer to the [Sample CSV File] in order to find all the supported fields, which are:
“sku”,”store_id”,”cost”,”price”,”special_price”,”special_from_date”,”special_to_date”,”website_id”,”tier_price:_all_”
,”tier_price:Wholesale”,”tier_price:[Any-Customer-Group]”,”group_price:Wholesale”,”group_price:[Any-Customer-Group]”

FieldDescription
skuSKU of the product
store_idStore Id which can be found in ‘core_store’ table with ‘store_id’ field, If you want to update for all stores then simply use store_id = 0
costCost
priceRegular/Unit Price
special_priceSpecial Price, If ‘special_from_date’ & ‘special_to_date’ fields are left empty then price is special for unlimited time period
special_from_dateSpecial From Date, Date field should be in [YYYY-mm-dd] format. For example: 2012-06-15
special_to_dateSpecial To Date, Date field should be in [YYYY-mm-dd] format. For example: 2012-08-25
website_idWebsite Id, Used for Website wise tier / group pricing import.
tier_price:_all_Tier price for all groups, Values for tier_price should be in tierQty:tierPrice format separated by semi-colon(;). For example: 10:100;20:90;50:70
If you want to delete the tier price then you can mark it with value ‘x’. For example: 10:x;20:x;50:70
tier_price:[CustomerGroupName]If you want tier price for specific groups then you need to add new column in the csv with name = tier_price:[CustomerGroupName]
For example: tier_price:Wholesale if customer group is Wholesale, tier_price:Retailer if customer group is Retailer.
You can find the customer group name from backend: Customers > Customer Groups.
Values should be in same format as above field(tier_price:_all_).
group_price:[CustomerGroupName]Group Price is new feature available in Magento since 1.7.0.0 version. If you want customer group wise price then you need to add new column in the csv with name = group_price:[CustomerGroupName]
For example: group_price:Wholesale if customer group is Wholesale, group_price:Retailer if customer group is Retailer.
Field value should contain the price only.

Among above fields, only sku is the compulsory field.
You can use the other fields depending on your requirement. You can either leave the column value empty or remove the column itself if you don’t want to update that field.

EDIT
Mass Importer Pro: Price Importer (version > 1.1.0) now supports price export feature in CSV format which reduces the complexity of manual process of CSV fields preparation. Now you can easily export the required price types of the selected products using this extension. Refer the following snapshot for more:

Mass Importer Pro: Export Price Feature

Note: Currently Price Importer supports only the CSV file type, using a comma (,) as delimiter and double quotes(“) as enclosure. We recommend you to use OpenOffice tool for formatting CSV file.

When CSV file is ready, go to ‘Mass Importer Pro’ > ‘Price Updater’ menu and go ahead for importing with the following three steps:
1. Selecting CSV File:
Select the required CSV file from ‘Select File To Import’ dropdown. If required csv file is not in the dropdown list then you can either manually upload via FTP to path ./var/massimporterpro/price_updater/ OR via form using ‘Upload File’ button.

Step 1: Select CSV file to import


2. Configuring Settings:
You can configure the Price Settings from ‘Price Settings’ tab. If not configured the settings will be taken from System > Configuration.

Step 2: Configure Import Settings


3. Hit ‘Run Import’ button
After submitting the form, you will see the message mentioning how many rows were imported, how many rows were skipped etc.

Result Message After Import


To view more information about the import you can go to ‘Import History’ tab and can view the log data after clicking on the ‘View Log’ link, which will give you the data used during import operation and result of success, failure or skipped.

Import History Tab

Import Log Data in readable form

That’s all about installation, configuration & importing regarding Mass Importer Pro: Price Importer extension.
Once you have used the import operation you will find it to be one of the fastest of its type (as it imports/updates thousands of product prices within few seconds). This is not just a claim on my part, the plugin has proven itself.

Happy Importing with Mass Importer Pro: Price Importer!

Usage of Magento event: core_block_abstract_to_html_after

March 4, 2012  |  1 Comments  |  by Raj (MagePsycho)  |  Latest, Magento

Introduction

There are lots of events in Magento which are dispatched by default. Among them ‘core_block_abstract_to_html_after’ is the one.

Recently we have re-developed the Easy Template Path Hints extension using this event as the previous version of the extension has some confliction issues with other modules.

In this article we will demonstrate the implementation of ‘core_block_abstract_to_html_after’ event in Easy Template Path Hints Extension:

1. Register the ‘core_block_abstract_to_html_after’ event

app/code/local/MagePsycho/Easypathhints/etc/config.xml

...
<global>
...		
	<events>
		<core_block_abstract_to_html_after>
			<observers>
				<easypathhints_core_block_abstract_to_html_after>
					<class>easypathhints/observer</class>
					<method>setTemplatePathHints</method>
				</easypathhints_core_block_abstract_to_html_after>
			</observers>
		</core_block_abstract_to_html_after>
	</events>
...
</global>
...

2. Implementing the Observer

<?php
/**
 * @category   MagePsycho
 * @package    MagePsycho_Easypathhints
 * @author     magepsycho@gmail.com
 * @website    http://www.magepsycho.com
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
class MagePsycho_Easypathhints_Model_Observer {

	public function setTemplatePathHints(Varien_Event_Observer $observer) {

		/* @var $block Mage_Core_Block_Abstract */
		$block				= $observer->getBlock();
		$transport			= $observer->getTransport();

		$fileName			= $block->getTemplateFile();
		$thisClass			= get_class($block);
		if($fileName){
			$preHtml = '<div style="position:relative; border:1px dotted red; margin:6px 2px; padding:18px 2px 2px 2px; zoom:1;">
<div style="position:absolute; left:0; top:0; padding:2px 5px; background:red; color:white; font:normal 11px Arial;
text-align:left !important; z-index:998;" onmouseover="this.style.zIndex=\'999\'"
onmouseout="this.style.zIndex=\'998\'" title="'.$fileName.'">'.$fileName.'</div>';
			$preHtml .= '<div style="position:absolute; right:0; top:0; padding:2px 5px; background:red; color:blue; font:normal 11px Arial;
	text-align:left !important; z-index:998;" onmouseover="this.style.zIndex=\'999\'" onmouseout="this.style.zIndex=\'998\'"
	title="'.$thisClass.'">'.$thisClass.'</div>';

			$postHtml = '</div>';
		}else{
			$preHtml	= null;
			$postHtml	= null;
		}


		$html = $transport->getHtml();
		$html = $preHtml . $html . $postHtml;
		$transport->setHtml($html);
	}
}

Notes: From above code you can see that we can easily find the related $block object and $transport object which are very handy in order to find the block class, template file, modify the block output ($transport->setHtml()) etc.

Output of Easy Template Path Hints

Isn’t that cool way to modify the core code without touching it?
FYI, Event-Observer technique is always the best method for modifying core code.

Don’t forget to provide the feedback/comments if there’s any.
Happy E-commerce!!

Release of newer version of jQuery Lightboxes 1.2.0

February 28, 2012  |  3 Comments  |  by Raj (MagePsycho)  |  jQuery, Latest, Magento

Introduction

Magento community is showing great love towards the Magento Extension: jQuery Lightboxes (probably the #1 lightbox extension for Magento e-Commerce), as a result we are on the way to make it much better with lots of new features.
Just we have released a newer version of jQuery Lightboxes i.e. 1.2.0.

Changelog

Version 1.1.0 – 1.2.0
– Tested Compatibility with Magento Version 1.6.2.0
– Upgraded jQuery Version (local + Google CDN) to 1.7.1
– Added Option to include Main Image to lightbox gallery of More Views
– Added Option to change the label for ‘More Views’
– Upgraded FancyBox to version 1.3.4
– Changed the default settings of FancyBox so that it looks even more sexier
– Added new Lightbox Type: PiroBox Extended (advanced form of Pirobox)
– Added new Lightbox Type: prettyPhoto
– Code Refinement

You can download the latest version of it either from
1> Official Site
Or
2> Magento-Connect

Try once and let me know your feedback/suggestions if there’s any.
Thanks a lot for loving this extension!