Redirect to specific page after newsletter subscription

1/25/12 3:42 AM | Posted in Programming By Pavel Koltsov | 0 Comments

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.

Currency Sign and Fooman PDF Customiser Issue

1/4/12 2:35 PM | Posted in Snippets By Pavel Koltsov | 0 Comments

If you are using Fooman pdf customiser and have modified your currency tag according to our tutorial, probably you will have trouble on pdf printouts, as the price will be something like: <span>$</span>22.00
To fix that issue open: app\code\community\Fooman\PdfCustomiser\Model\Mypdf.php
Find public function OutputTotalPrice and replace it with this:

    public function OutputTotalPrice($price, $basePrice,$displayBoth,$order)
    {
        $priceForPrint = strip_tags($order->formatPriceTxt($price));
        
        if($displayBoth){
            $this->MultiCell(2.25*$this->getFontSizePt(), 0, $priceForPrint, 0, 'R', 0, 0);
        }
        $this->MultiCell(0, 0, $priceForPrint, 0, 'R', 0, 1);
    }

The key word is "strip_tags" which clears all html tags and gives us clean currency and price

 

Update Shopping Cart Button Fix for IE6

1/3/12 3:14 PM | Posted in Snippets By Pavel Koltsov | 0 Comments

There are still store owners who care about customers surfing with Internet Explorer (IE) 6. Recently I was working on IE6 compatibility issues and found the problem which was easy to fix. "Update Shopping Cart" button on shopping cart page doesn't work in IE6. To fix that issue open app\design\frontend\[yourpackage]\[yourtheme]\template\checkout\cart.phtml
Find:

<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
Change it to:
<form name="update_form" action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
Find:
<button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button>
Change it to:
<button onclick="document.getElementById('update_form').submit();" type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button>
Now the update cart button works in IE6.

Set quality of magento product images

8/11/11 2:37 AM | Posted in Snippets By Pavel Koltsov | 0 Comments

Set quality of magento catalog product images directly in template files.

There is no need to dublicate and edit core files or adapters. New method called setQuality has been implemented since Magento CE 1.4 and can be used directly in template files.

Read More

Today I had a real problem with category`s design. All I needed is to load category`s design outside of Mage_Catalog module. I have googled but did find any solution for it. So, here is my one.

Read More

Styling currency sign in Magento store

6/25/11 5:24 AM | Posted in Snippets By Pavel Koltsov | 2 Comments

If you want to style your currency sign there is no class or element by default you can hook and style with css. Here's how to wrap it in <span></span> tags to be able to style the currency via css.

Read More
Recent blog post: 

Redirect to specific page after newsletter subscription

Blog