1

I have a method that is going to be called in multiple files in my module:

public function getStore(){
         $order = Mage::registry('current_order');        
         $store_id = $order->getdata("store_id");
         switch ($store_id){
             case "2":
                $store = "DE";
                break;
             case "3":
                $store = "US";
                break;
             case "9":
                $store = "HG";
                break;
             case "1":
                $store = "DK";
                break;
             default:
                $store = "ES";
                break;
         }
    return $store;
}

What is the magento way to deal with this methods?

Thanks!

1

1 Answer 1

2

In a helper is the normal place. Sometimes you see these kinds of methods in models as well (i.e. Mage_Core_Model_Date) but I tend to stick to just helpers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.