Thursday, 5 June 2014

How to configure tier pricing ?

In order to configure tier pricing please follow the steps below:
1. Log in to the Magento admin panel and open the product configuration page.
2. In the “Prices” tab you can see the “Tier Price” section. Tier prices are used for those customers who are willing to order multiple products and you want to reward them by giving a discount. Once you’ve added the tier price, you can select the customer group that the price will be valid for.

magento tier pricing 1 300x185 How to configure tier pricing ?

3. Set the website, the quantity of products and a new price.

How to display New products in Magento?

Hello Magento lovers!, have you ever wanted to display New products in your store by just setting the product “Set Product as New from Date” within the product configuration in your Admin-panel?. It simple, luckily Magento provides php functions to do almost anything you wish, in this case we’ll use the Mage::getResourceModel(‘catalog/product_collection’) features:
We’ll create a template file called: new_products.phtml
The content would be:


<?php
$todayDate  = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
 
$_productCollection=$this->getLoadedProductCollection();
$_productCollection = Mage::getResourceModel(‘catalog/product_collection’)
->addAttributeToSelect(‘*’)
->addAttributeToFilter(‘news_from_date’, array(‘date’ => true, ‘to’ => $todayDate))
->addAttributeToFilter(‘news_to_date’, array(‘or’=> array(
0 => array(‘date’ => true, ‘from’ => $todayDate),
1 => array(‘is’ => new Zend_Db_Expr(‘null’)))
), ‘left’);
 
$now = date(“Y-m-d”);
$newsFrom= substr($_productCollection->getData(‘news_from_date’),0,10);
$newsTo=  substr($_productCollection->getData(‘news_to_date’),0,10);
 
?>
 
<?php if(!$_productCollection->count()): ?>
<div>
<?php echo $this->__(‘There are no products matching the selection. Please provide a category ID.’) ?>
</div>
<?php else: ?>
 
Then you can call this template by adding a block call like this in your CMS content pages:
 
 
{{block type="catalog/product_list" template="catalog/product/new_products.phtml"}}

How to import products in Magento using CSV files?

It is rather inconvenient to manually add a large number of products at once to a Magento installation. Inserting products one by one will take a long time especially when you have hundreds or thousands of products.In such cases you need an automatic way to add all those products to your Magento online store. We will address all steps you need to take in order to achieve a successful import.
First, access your Magento administrator backend and go to Catalog -> Manage Categories.
magento tier pricing 11 300x160 How to import products in Magento using CSV files?

Create all product categories you will need. You can do so by filling the form displayed below:

magentoimportprod02 300x160 How to import products in Magento using CSV files?

When you fill the form with all the information you like click the Save Category button.

magentoimportprod03 300x160 How to import products in Magento using CSV files?

Bear in mind that at this point you should make note of the newly created category ids. It would be best to save them in a simple text file as you will need them for the import. The category ID will be displayed upon saving the category. It is recommended to make notes as shown below

magentoimportprod04 300x160 How to import products in Magento using CSV files?

If you plan to have additional attributes for the products you are importing you will need to create those via Catalog ->Attributes ->Manage Attributes -> Add new Attribute. You can use this functionality to add all custom attributes that are not present by default in a standard Magento installation. Note also that you can add additional attributes later at the moment you are creating a sample product. It is up to you whether to create the attributes before that or at the point you are creating the first product.
The next step is to manually add a product to your Magento installation. You will later export this product and use it as a template for importing the large batch. Make sure you include all attributes you will use for the products you are going to import in the sample product. You might want to delete all default products that might be present as you will not need them and then create the new product you will use as a template for the import.
Once you create the new product and save it it will appear in the products list for your Magento store.

magentoimportprod06 300x160 How to import products in Magento using CSV files?

You are now ready to make the sample export that you will use as a template. In the Magento administrator area go to System -> Import/Export -> Dataflow – Profiles -> Export All Products. Under Profile Information -> Store choose the desired store where you will be importing the products. This should also match the store where you have previously created a sample product. Under Data Transfer drop down menu choose Local/Remote Server. Under Data Format make sure CSV / Tab Separated is selected for type and click Save Profile. Then click export all products again and click Run Profile in Popup.

magentoimportprod07 300x160 How to import products in Magento using CSV files?

This will save a file named “export_all_products.csv” under the var/export/ directory for your Magento installation. The export success screen will look like this and will specify the file name where the products were exported.

magentoimportprod08 300x160 How to import products in Magento using CSV files?

magentoimportprod08 How to import products in Magento using CSV files?
Using an FTP client download this file to your local computer. The file will include columns for each of the attributes you have defined for your products. Open it in a spreadsheet program (MS Excel, Open Office Spreadsheet) and add the products you would like to import. Make sure you are copy/pasting the corresponding attributes in the correct columns. Also here is when you will have to add the category IDs. Use the IDs from the text file you saved earlier and put the corresponding category ID for the products you are adding.
Once you have accomplished the above go back to the Magento administrator area and choose System -> Import/Export -> Dataflow – Profiles -> Import All Products. Then choose Upload file and browse for the .csv file that you have updated with the products that need to be imported. Once you have uploaded it click Import All Products again, then Run Profile, select the .csv file you have just uploaded from the drop down menu and click Run Profile in Popup. A status screen will open and the products will start importing

magentoimportprod09 300x160 How to import products in Magento using CSV files?
When the import completes you will get an export success message.

magentoimportprod091 300x160 How to import products in Magento using CSV files?

You can now go to the products section of the Magento administrator backend and check the imported products. They will be present there and assigned to the corresponding categories with the attributes you have added for them.

How to Use the Magento CMS Features?

In order to manage your web site pages you need to navigate to the CMS section in the Magento admin area. Click on the Manage Pages link in order to proceed with the pages modification.

23 300x160 How to Use the Magento CMS Features?

You can edit a page by clicking on it. The Edit Page will open the window below:

24 300x160 How to Use the Magento CMS Features?

You can modify this page to your preference. Static blocks is another useful option. For example, you can edit the footer block which contains the links located at the bottom of your main page:

25 300x160 How to Use the Magento CMS Features?

The Polls section allows you to create and edit polls:

26 300x160 How to Use the Magento CMS Features?

Actually, magento has a fully-featured CMS system integrated in it. Browse through the pages to see the different elements you can add to your site.

Magento Restricted CMS Pages:

Step1
First goto   “app\design\frontend\default\[your theme directory]\template\page”
make a copy of your template page it can be “1column.phtml” or “2columns-right.phtml”…. whatever you are using.
rename it to “restricted.phtml”  and paste the below code just after body tag starts.


&lt;?php <code>$login</code> <code>= Mage::getSingleton( </code><code>'customer/session'</code> <code>)-&gt;isLoggedIn(); </code><code>//Check if User is Logged In</code>
<div><code> </code><code>if</code><code>(!</code><code>$login</code><code>)</code></div>
<div><code> </code><code>{</code></div>
<div><code> </code><code>$msg</code> <code>= Mage::getSingleton(</code><code>'core/session'</code><code>)-&gt;addError(</code><code>$this</code><code>-&gt;__(</code><code>'Please Sign in / Register first to access this page.'</code><code>));</code></div>
<div><code> </code><code>header(</code><code>'Location: '</code><code>. Mage::getUrl(</code><code>'customer/account/login'</code><code>));</code></div>
<div><code> </code><code>exit</code><code>;</code></div>
<div><code> </code><code>}</code></div>
<div>?&gt;</div>
<div>
 
 
goto “\app\code\core\Mage\Page\etc”  and open “config.xml”
add this code just befor “</layouts>” tag


<div>
<div><code>&lt;</code><code>allowed_user</code> <code>module</code><code>=</code><code>"page"</code> <code>translate</code><code>=</code><code>"label"</code><code>&gt;</code></div>
<div><code> </code><code>&lt;</code><code>label</code><code>&gt;Only Registerd / Sign in users&lt;/</code><code>label</code><code>&gt;</code></div>
<div><code> </code><code>&lt;</code><code>template</code><code>&gt;page/restricted.phtml&lt;/</code><code>template</code><code>&gt;</code></div>
<div><code> </code><code>&lt;</code><code>layout_handle</code><code>&gt;page_allowed_user&lt;/</code><code>layout_handle</code><code>&gt;</code></div>
<div><code> </code><code>&lt;/</code><code>allowed_user</code><code>&gt;</code></div>
<div></div>
</div>
 
 
Now open you “admin” ,” cms”  and “add new page”
and you will find new select option under “design” tab in “Layout” option.
just select “Only Restricted/ sign in user”. Rest will be handelled by the code icon smile Magento Restricted CMS Pages
magento restricted page Magento Restricted CMS Pages
 
 


 
 

How do I remove the “Log In”-link in the top links area ?

I feel the “Log In”-link in the header is waste of space as the “My Account”-link on the left side in the same area does the trick pretty ok, but I havent figured out how to remove it from the loop in the code which generated those toplinks.
I would need to add a “Logout”-box in the “My Account” area if this was to be removed, or place a “Logout”-link somewhere else, but guess that wont be any problem.
You have to go to app/design/frontend/default/default/layout/customer.xml.
Remove the action method :

<action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>

How to add a Contact Us form in Magento ?

Magento includes contact form functionality by default. A link to a contact form can usually be found in the footer of your Magento installation.
Of course, you can add a contact form on any page. All you need to do is:
Log in to the administrator area.
Go to CMS > Pages.
Select the page you want to edit or create a new page.

Paste the following code using the HTML option of the WYSIWYG editor:
<!– CONTACT FORM CODE BEGIN–>
{{block type='core/template' name='contactForm' template='contacts/form.phtml'}}
<!– CONTACT FORM CODE END–>

Save the changes and the contact form will appear on the desired page.