Skip to content

Move saving logic outside the View part #38

Closed
@stalniy

Description

@stalniy

It's necessary that saving logic should be in model or controller, not in block like this

class Mage_Checkout_Block_Onepage_Shipping_Method_Available extends Mage_Checkout_Block_Onepage_Abstract
{
................................................
    public function getShippingRates()
    {

        if (empty($this->_rates)) {
            $this->getAddress()->collectShippingRates()->save();
..........................................................

Because it's not clear (hidden) logic. Blocks should be used only for View part of MVC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions