Tuesday, 7 May 2013

How to setup special promotions in Magento Commerce.

This tutorial will show you how to manage special promotions in Magento Commerce, and assumes you're already logged in to Magento
1) To add a catalog promotion, go to Promotions... and select Catalog Price Rules

This page will show you all of the catalog price rules that have been added

2) To add a new rule, click this button

3) Enter a name for the new rule

4) Choose whether the status of the promotion is active or inactive

5) Hold down the control key and click to select the customer groups that this promotion will apply to

6) You can choose the start and end date of the promotion from the pop-up calendar

7) Click Conditions

8) Click the plus sign to add a condition

9) Choose a condition to add

10) Click the dots to finish the condition

11) Click to search for the product's SKU

12) Select the correct product

13) Click the checkmark to apply the changes

14) Go to Actions

15) Select what the rule should be applied to

16) Enter the discount amount

17) Click Save Rule

The rule has been saved but not applied

18) Click Apply Rules

The rule has now been applied

19) To add a shopping cart promotion, go to Promotions... and select Shopping Cart Price Rules

This page will show all the shopping cart promotions that have been created

20) To add a new rule, click this button

21) Enter a name for the rule

22) Choose whether the promotion status is active or inactive

23) Hold down the control key and click to select the customer groups this promotion will apply to

24) You can select the start and end dates for this promotion

25) Click Conditions

26) Click the plus sign to add a condition

27) Select a condition from the list

28) Click the dots to complete the condition

29) Type in a value

30) Go to Actions

31) Select what the new rule will apply to

32) Enter the discount amount

33) Click Save Rule

The new rule has been saved and applied

This is the end of the tutorial. You now know how to setup special promotions in Magento Commerce

WorldPay extension configuration.

After downloading and installing the WorldPay extension via Magento Connect visit worldpay.com and log into your merchant account.

Go to the installation menu and select your Select Junior installation for setup.

1. Enter the “Payment Response URL” like this: http://[yourdomain.com]/worldpay/processing/response/
2. Check “Payment Response enabled?”
3. Check “Enable the Shopper Response”
4. Choose an “Payment Response password” and confirm it.
5. Choose an “MD5 secret for transactions” and confirm it.
To configure dynamic payment response support for multi-store setups see Worldpay knowledge base documentation .

Go back to the Magento backend and switch to “System/Configuration/Sales/Payment Methods”. Enable the WorldPay module and enter the information from the WorldPay setup.

Go to the frontend and test the payment module in the checkout.

Sunday, 5 May 2013

Magento – Add breadcrumbs on customer account area pages.

Breadcrumbs are really good way to navigate through the site and provide links back to each previous page the user navigated through to get to the current page. Magento’s default themes does not offer breadcrums in the customer account area. Adding breadcrumbs in the account area may be an added advantage for the users and will help them in navigation. It will give an visual aid to the website as well. Breadcrumbs can be added easily in the customer account area using the local.xml file. Each layout is associated to a module and customer area have multiple modules linked, so in order to add breadcrumbs in all the pages in customer account section, we need add multiple layout updates in out local.xml file.
Magento themes are fully managed by the layout.xml files. Layouts are created per module basis. These files control the structure and behavior of the theme. Layout files resides under app/design/frontend/your_interface/your_theme/layout/. Look and feel of the theme can be easily changed by just modifying the layout.xml files even without touching the .phtml templates. And here comes the power of local.xml layout file. After preparing the layout configuration of all the layout files, its local.xml thats merged at the end of the layout configuration. Local.xml can be used to modify any of the layout section of modules.

Steps to add Breadcrumbs in the Customer Account Area

1. First of all create a local.xml file inside your themes, layout directory. The path of the local.xml will be app/design/frontend/your_interface/your_theme/layout/local.xml. If you already have a local.xml layout file in your layout directory than use the existing file. Alternatively download the Local.xml from here.
Local.xml have the standard layout tag under which all the layout modifications will be defined. Add the following in your empty local.xml file.
<?xml version="1.0"?>
<layout version="0.1.0">

</layout>
Default crumbs on every page in customer account
Now we are going to add default crumbs – Home and My Account which will be displayed on all the pages. Open the file app/design/frontend/your_interface/your_theme/layout/local.xml
Now inside <layout version="0.1.0"> tag add the below given code. Local.xml will look like this now.
<?xml version="1.0"?>
<layout version="0.1.0">

    <!--
    add default crumbs to display in all the customer account pages
    this will add Home / My Account crubms.
    -->
    <customer_account translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Home</crumbName><crumbInfo><label>Home</label><title>Home</title><link>/home</link></crumbInfo></action>
              <action method="addCrumb"><crumbName>My Account</crumbName><crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account/</link></crumbInfo></action>
        </reference>
    </customer_account>

</layout>
Refresh the magento cache. This code will add the default breadcrumbs “Home / My Account” on every page in customer account area.
Add “Home / My Account / Dashboard” crumb on Account Dasboard page.
Open the file app/design/frontend/your_interface/your_theme/layout/local.xml and after the </customer_account> and add this code.
    <!--Add Dashboard crumb on My Dashboard page-->
    <customer_account_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Dashboard</crumbName><crumbInfo><label>Dashboard</label><title>Dashboard</title></crumbInfo></action>
        </reference>
    </customer_account_index>
Here we only added a single crumb Dashboard which will automatically be added with the default breadcrumbs.
Complete Local.xml file for Customer Account Breadcrumbs
As you have seen, we need to add layout updates for every page one by one. So rather illustrating each layout update individually, i am giving the complete code of the local.xml. Just copy the whole code as is and put in your local.xml file. Refresh the magento cache and its ready. Download the ready to go Local.xml file.
<?xml version="1.0"?>
<layout version="0.1.0">

    <!--
    ///////////////////////////////////////////////////////
    ///////  BREADCRUMBS IN CUSTOMER ACCOUNT AREA  ////////
    ///////////////////////////////////////////////////////
    add default crumbs to display in all the customer account pages
    this will add Home / My Account crubms.
    -->
    <customer_account translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Home</crumbName><crumbInfo><label>Home</label><title>Home</title><link>/home</link></crumbInfo></action>
              <action method="addCrumb"><crumbName>My Account</crumbName><crumbInfo><label>My Account</label><title>My Account</title><link>/customer/account/</link></crumbInfo></action>
        </reference>
    </customer_account>

    <!-- ACCOUNT SECTIONS -->
    <!--Add Dashboard crumb on My Dashboard page-->
    <customer_account_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Dashboard</crumbName><crumbInfo><label>Dashboard</label><title>Dashboard</title></crumbInfo></action>
        </reference>
    </customer_account_index>

    <!--Add Account Information crumb on Account Information page-->
    <customer_account_edit translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Account Information</crumbName><crumbInfo><label>Account Information</label><title>Account Information</title></crumbInfo></action>
        </reference>
    </customer_account_edit>

    <!-- ADDRESS BOOK -->
    <customer_address_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Address Book</crumbName><crumbInfo><label>Address Book</label><title>Address Book</title></crumbInfo></action>
        </reference>
    </customer_address_index>

    <customer_address_form translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Address Book</crumbName><crumbInfo><label>Address Book</label><title>Address Book</title><link>/customer/address/</link></crumbInfo></action>
            <action method="addCrumb"><crumbName>Add/Edit Address</crumbName><crumbInfo><label>Add/Edit Address</label><title>Add/Edit Address</title></crumbInfo></action>
        </reference>
    </customer_address_form>

    <!-- MY ORDERS -->
    <sales_order_history translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>My Orders</crumbName><crumbInfo><label>My Orders</label><title>My Orders</title></crumbInfo></action>
        </reference>
    </sales_order_history>

    <sales_order_view translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>My Orders</crumbName><crumbInfo><label>My Orders</label><title>My Orders</title><link>/sales/order/history/</link></crumbInfo></action>
            <action method="addCrumb"><crumbName>Order View</crumbName><crumbInfo><label>Order View</label><title>Order View</title></crumbInfo></action>
        </reference>
    </sales_order_view>

    <!-- BILING AGREEMENT -->
    <sales_billing_agreement_index>
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Billing Agreements</crumbName><crumbInfo><label>Billing Agreements</label><title>Billing Agreements</title></crumbInfo></action>
        </reference>
    </sales_billing_agreement_index>

    <sales_recurring_profile_index>
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Recurring Profiles</crumbName><crumbInfo><label>Recurring Profiles</label><title>Recurring Profiles</title></crumbInfo></action>
        </reference>
    </sales_recurring_profile_index>

    <!-- PRODUCT REVIEW -->
    <review_customer_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>My Product Reviews</crumbName><crumbInfo><label>My Product Reviews</label><title>My Product Reviews</title></crumbInfo></action>
        </reference>
    </review_customer_index>

    <!-- MY TAGS -->
    <tag_customer_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>My Tags</crumbName><crumbInfo><label>My Tags</label><title>My Tags</title></crumbInfo></action>
        </reference>
    </tag_customer_index>

    <wishlist_index_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>My Wishlist</crumbName><crumbInfo><label>My Wishlist</label><title>My Wishlist</title></crumbInfo></action>
        </reference>
    </wishlist_index_index>

    <downloadable_customer_products translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Downloadable Customer Products</crumbName><crumbInfo><label>Downloadable Customer Products</label><title>Downloadable Customer Products</title></crumbInfo></action>
        </reference>
    </downloadable_customer_products>

    <newsletter_manage_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb"><crumbName>Newsletter Manage</crumbName><crumbInfo><label>Newsletter Manage</label><title>Newsletter Manage</title></crumbInfo></action>
        </reference>
    </newsletter_manage_index>
</layout>
As you have notices that after adding default crumbs “Home / My Account“, its all just common code used to create the current active crumb. Url of the page can indicates which module tag need to be updated. For example url http://www.sitename.com/newsletter/manage/ indicates that <newsletter_manage_index translate="label"> tag will be updated.

Magento 1.7 Configurable Product Export Fix.

There is a known issue affecting both the Magento Community and Enterprise Edition export system. I have personally tested this fix on Magento Community v1.7.0.2 and Magento Enterprise v1.12.0.2, but I'm sure it will work on any version that is having the same symptoms.
The issue is with the core Import/Export functionality found in System > Import/Export > Export menu item in the Magento backend. If you have configurable products that are configurable by only 1 attribute, you won't experience difficulities. However, if you have a configurable product with multiple configurable attributes (i.e. a T-Shirt configurable by both size and color) then you will notice that your export file only contains data about one configurable attribute. This data can be found in the _super_attribute_code and _super_attribute_option columns. As in the case of my T-Shirt example, these columns would only contain data about the size attribute options, and nothing about color.
To fix this issue we must override one of Magento's core class files, at least until they come out with a newer patched version. We never touch core Magento files, so what we are going to do is replicate this file in the local code pool and make our changes there. From your root Magento install directory, copy the file
app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php
to
app/code/local/Mage/Catalog/Model/Resource/Product/Type/Configurable.php
Now, open up the Configurable.php file you just copied to the local code pool and navigate to line 223. This line should read
$attributesOptionsData[$superAttribute->getAttributeId()] = $this->_getReadAdapter()->fetchAssoc($select);
You need to change this line to read
$attributesOptionsData[$superAttribute->getAttributeId()] = $this->_getReadAdapter()->fetchAll($select);
Now, clear your cache and try the export again. You should see all your configurable attribute data in the file now. And now, my T-Shirts have both the size and color attribute associations in the export file. Once Magento fixes this issue in a later release, just remember to delete your local copy of Configurable.php.

How to show billing and shipping details on order review page.

Hi All,
I happy to assist you people.
please follow below steps to get progress bar on ‘order review’ block.
replace following (checkout.xml)::::::::::
<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
</block>
with:::::::::::
<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml">
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>

<block type="page/html_wrapper" name="checkout.progress.wrapper" as="checkout_progress">
<action method="setElementId"><value>checkout-progress-wrapper</value></action>
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml"/>
</block>
</block>
and call this block on checkout/onepage/review.phtml::::::::::::::::::::::::::::::::::
<?php echo $this->getChildHtml('checkout_progress') ?>
Thats it.
Magento had default textbox for Quantity but some time we require to add the qty box  with increment value without entering the value in textbox.We can add the followimg code in cart or view page



1) Add the one new file called jquery.qty.js and enter the following code

jQuery(document).ready(function(){
jQuery("div.quantity").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');
        jQuery(".plus").click(function()
        {
            var currentVal = parseInt(jQuery(this).prev(".qty").val());
            if (!currentVal || currentVal=="" || currentVal == "NaN") currentVal = 1;
          jQuery(this).prev(".qty").val(currentVal + 1);
 
        });
        jQuery(".minus").click(function()
       {
            var currentVal = parseInt(jQuery(this).next(".qty").val());
            if (currentVal == "NaN") currentVal = 1;
            if (currentVal > 1)
            {
                jQuery(this).next(".qty").val(currentVal - 1);
            }
        });
  
        });
 
and place as per your theme folder structure

2)Add the Following
If you want in cart page open app/design/frontend/default/yourtheme/template/catalog/prdouct/view/addtocart.phtml search for qty code and place div like this
 
<div class="quantity">    
        <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="2" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" />
</div>
 
IF u want in view page open app/design/frontend/default/yourtheme/template/checkout/cart/item/default.phtml search for qty code and place div like this
 
<div class="quantity">
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
</div>
 
Just check you will get the incerement box in cart and view page

Hope this will help you!
 
 
 

Redirect to specific page after newsletter subscription.


If you wish to redirect customers to specific page after newsletter subscription, here's how.
Copy
app\code\core\Mage\Newsletter\controllers\SubscriberController.php
to
app\code\local\Mage\Newsletter\controllers\SubscriberController.php
Open the created local file. Find in two places:

$this->_redirectReferer();
Change it to:

$this->_redirectUrl(Mage::getBaseUrl());
That will redirect user to the home page after newsletter subscription. If you wish to redirect to specific page, use this:

$this->_redirectUrl(Mage::getBaseUrl().'cms-page-identifier');
Thats it. Now you control the page the user is redirected after newsletter subscription in magento.