• Call me on: +31 (0)6-44082344
  • Send us Mail
  • Subscribe to our RSS Feed
  • Search Site

SanderSluis.com

  • HomeIntroduction
  • ResumeMy skills
  • ProjectsMy work
  • BlogMy opinion
  • ContactGet in touch with me

You are here: SanderSluis.com / Blog

Loading (multiple) products by tag name in Magento

09 Dec 2011 / 0 Comments / in Magento/by Sander Sluis

I’m currently working on a Magento WordPress integration. One of the requirements is to display a list of products in a WordPress post, based on the tags in WordPress. Since Magento also supports tagging, I decided to ab(use) that functionality.

The build-in functionality of Magento’s tagging, allows to display a list of product only by giving the tag’s corresponding id. That leaves me with two problems:

  • How to display Magento products for multiple tags?
  • How to display Magento products for a given tag name?

Read more →

Changing the page template in a Magento controller

11 Nov 2011 / 6 Comments / in Magento/by Sander Sluis

I made this little snippet, that you can use to change the page template within a Magento controller:

1
2
3
4
5
6
7
8
    public function indexAction() {
        $this->loadLayout();
        if((bool) $this->getRequest()->getParam('ajax')){ // ?ajax=true
            $this->getLayout()->getBlock('root')->setTemplate('page/ajax.phtml');  //changes the root template
        }
        $this->renderLayout();
        return $this;
    }

This particular example changes the template to ‘page/axjax.phtml’ if the ‘ajax’ get parameter is set to true (?ajax=true).

Hello world!

09 Oct 2011 / 7 Comments / in Uncategorized/by Sander Sluis

This is my first post. I’ll start blogging soon.

Pages

  • Blog
  • Contact
  • Home
  • Projects
  • Resume

Social

Pages

  • Blog
  • Contact
  • Home
  • Projects
  • Resume

Recent Posts

  • Loading (multiple) products by tag name in Magento
  • Changing the page template in a Magento controller
  • Hello world!

Categories

  • Magento
  • Uncategorized

Hire me!

Call me on: +31 (0)6-44082344
© Copyright - SanderSluis.com - Wordpress Theme by Kriesi.at
  • scroll to top
  • Send us Mail
  • Subscribe to our RSS Feed