0

I need to show informations of products in cart inside my shipping calculator, i've tried to do this calling the model Mage::getModel('checkout/session')->getQuote()->getAllItems(); and using foreach in my method, but don't works. The function is:

   protected function _appendShippingReturn($shipping_method, $shippingPrice = 0, $delivery = 0){
    if (strlen($shipping_method) == 4) {
        $shipping_method = (string)'0' . $shipping_method;
    }

    $method = Mage::getModel('shipping/rate_result_method');
    $method->setCarrier($this->_code);
    $method->setCarrierTitle($this->_title);
    $method->setMethod($shipping_method);

    $shippingCost = $shippingPrice;
    $shippingPrice = $shippingPrice + $this->_handlingFee;

    $methodTitle = $this->getConfigData('serv_' . $shipping_method . '/name');
    $methodTerm = $this->getConfigData('serv_' . $shipping_method . '/term');

    if ($custom_name = $this->getConfigData('custom_name_' . $shipping_method)) {
        $methodTitle = $custom_name;
    }

    if($shipping_method == $this->getConfigData('acobrar_code')){
        $methodTitle .= ' ( R$' . number_format($shippingPrice, 2, ',', '.') . ' )';
        $shippingPrice = 0;
    }

    if ($this->_showDelivery){
        if($delivery  > 0){
            $method->setMethodTitle(sprintf($this->getConfigData('msgprazo'), $methodTitle, (int)($delivery + $this->_addDeliveryDays))); //it shows the shipping methods
        } else {
            $method->setMethodTitle(sprintf($this->getConfigData('msgprazo'), $methodTitle, (int)($methodTerm + $this->_addDeliveryDays)));
        }
    } else {
        $method->setMethodTitle($methodTitle);
    }

    $method->setPrice($shippingPrice);
    $method->setCost($shippingCost);

    $this->_result->append($method);
}

I want to do this to show under the shipping methods the product images and a specific attribute (extra delivery time individual for some products).

How can I do this? Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.