public function postage($params, $content, $template, &$repeat)
    {
        if (!$repeat) {
            return (null !== $this->countryId) ? $content : "";
        }

        $customer = $this->getCurrentRequest()->getSession()->getCustomerUser();
        /** @var Address $address */
        /** @var Country $country */
        list($address, $country, $state) = $this->getDeliveryInformation($customer);

        if (null !== $country) {
            $this->countryId = $country->getId();
            // try to get the cheapest delivery for this country
            $this->getCheapestDelivery($address, $country);
        }

        $template->assign('country_id', $this->countryId);
        $template->assign('delivery_id', $this->deliveryId);
        $template->assign('postage', $this->postage ?: 0.0);
        $template->assign('postage_tax', $this->postageTax ?: 0.0);
        $template->assign('postage_title', $this->postageTaxRuleTitle ?: 0.0);
        $template->assign('is_customizable', $this->isCustomizable);
    }
public function postage($params, $content, $template, &$repeat)
    {
        if (!$repeat) {
            return (null !== $this->countryId) ? $content : "";
        }

        $customer = $this->getCurrentRequest()->getSession()->getCustomerUser();
        /** @var Address $address */
        /** @var Country $country */
        list($address, $country, $state) = $this->getDeliveryInformation($customer);

        if (null !== $country) {
            $this->countryId = $country->getId();
            // try to get the cheapest delivery for this country
            $this->getCheapestDelivery($address, $country);
        }

        $template->assign('country_id', $this->countryId);
        $template->assign('delivery_id', $this->deliveryId);
        $template->assign('postage', $this->postage ?: 0.0);
        $template->assign('postage_tax', $this->postageTax ?: 0.0);
        $template->assign('postage_title', $this->postageTaxRuleTitle ?: 0.0);
        $template->assign('is_customizable', $this->isCustomizable);
    }
public function postage ( $ params , $ content , $ template , & $ repeat ) { if ( ! $ repeat ) { return ( null !== $ this -> countryId ) ? $ content : "" ; } $ customer = $ this -> getCurrentRequest ( ) -> getSession ( ) -> getCustomerUser ( ) ; /** @var Address $address */ /** @var Country $country */ list ( $ address , $ country , $ state ) = $ this -> getDeliveryInformation ( $ customer ) ; if ( null !== $ country ) { $ this -> countryId = $ country -> getId ( ) ; // try to get the cheapest delivery for this country $ this -> getCheapestDelivery ( $ address , $ country ) ; } $ template -> assign ( 'country_id' , $ this -> countryId ) ; $ template -> assign ( 'delivery_id' , $ this -> deliveryId ) ; $ template -> assign ( 'postage' , $ this -> postage ? : 0.0 ) ; $ template -> assign ( 'postage_tax' , $ this -> postageTax ? : 0.0 ) ; $ template -> assign ( 'postage_title' , $ this -> postageTaxRuleTitle ? : 0.0 ) ; $ template -> assign ( 'is_customizable' , $ this -> isCustomizable ) ; }
Get postage amount for cart

@param array $params Block parameters
@param mixed $content Block content
@param \Smarty_Internal_Template $template Template
@param bool $repeat Control how many times
the block is displayed

@return mixed
Get postage amount for cart