Magento – Stuck in one page checkout payment information

magento-1.7onepage-checkoutpayment-methods

My problem is in onepage checkout, here it is :

  • When I go to shipping method , checkout progress disappear and Error text appear .
  • In payment information , i cant move to next step , it stuck in there . I tried both of two method . In payment method , i enable all of them .
  • I open inspect element , in network tab , i see error : Failed to load resource: net::ERR_CACHE_MISS

It said error in my Block , "Links" is my block to add link to top link , its have only 1 method , here it is :

<?php
class Atom_Rewardpoint_Block_Links extends Mage_Core_Block_Template{
    public function addRewardpointLink()
    {
        $point=Mage::getModel("rewardpoint/customer")->load(Mage::getSingleton('customer/session')->getId())->getData('point_balance');
        $parentBlock = $this->getParentBlock();
        $text = 'My Points ( '.$point.' <img src= "'.$this->getSkinUrl("images/point.gif").'"/>'. ')';
        $position=1;

      // error line is method addLink  , i dont know what's wrong 

        $parentBlock->addLink(
                $text, 'rewardpoint/index/info', 'My Points',true,false,$position
            );

        return $this;
    }
}

enter image description here

Best Answer

The checkout progress is loaded via ajax calls, which means that only the specified blocks are loaded (and not the entire layout).

From the information you have supplied so far I can only understand that the Rewardpoint_Links block is loaded without a parent, and $this->getParentBlock(); returns a null object.

You can modify the block and check to see if parent exists:

<?php
class Atom_Rewardpoint_Block_Links extends Mage_Core_Block_Template{
    public function addRewardpointLink()
    {
        $point=Mage::getModel("rewardpoint/customer")->load(Mage::getSingleton('customer/session')->getId())->getData('point_balance');
        $parentBlock = $this->getParentBlock();
        $text = 'My Points ( '.$point.' <img src= "'.$this->getSkinUrl("images/point.gif").'"/>'. ')';
        $position=1;

      // error line is method addLink  , i dont know what's wrong 
        if($parentBlock) {
            $parentBlock->addLink(
                $text, 'rewardpoint/index/info', 'My Points', true, false, $position
            );
        }
        return $this;
    }
}