Example #1
0
 protected function _toHtml()
 {
     $totals = $this->getTotals();
     $total = $totals['grand_total']->getValue();
     $address = $totals['grand_total']->getAddress();
     $subtotal = $totals['subtotal']->getValue();
     if ($this->getQuote()->getSubtotal() < Mage::helper('fastcheckout')->confDefaultMinPrice()) {
         $obj = Mage::getModel('sales/quote_address_total');
         $obj->setCode('shipping');
         $obj->setTitle('Доставка');
         $obj->setValue(Mage::helper('fastcheckout')->confTax());
         $obj->setAddress($address);
         $address->setShippingAmount(Mage::helper('fastcheckout')->confTax());
         $totals['shipping'] = $obj;
         $total = $totals['grand_total']->getValue();
         $totals['grand_total']->setValue($total + Mage::helper('fastcheckout')->confTax());
         $total = $total + Mage::helper('fastcheckout')->confTax();
     }
     $obj = Mage::getModel('sales/quote_address_total');
     $obj->setCode('other_total');
     $obj->setTitle('Итоговая сумма:');
     $obj->setValue($subtotal);
     $obj->setArea('other_footer');
     $obj->setAddress($address);
     $totals['other_total'] = $obj;
     $this->setMyTotals($totals);
     Mage::helper('fastcheckout')->setPrice($subtotal . ' руб.');
     return parent::_toHtml();
 }
Example #2
0
 public function getCheckoutUrl()
 {
     if (!$this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()) {
         return parent::getCheckoutUrl();
     }
     return $this->getUrl('onestepcheckout', array('_secure' => true));
 }
Example #3
0
 public function getItems()
 {
     if (!Mage::helper('udsplit')->isActive()) {
         return parent::getItems();
     }
     $q = $this->getQuote();
     $a = $q->getShippingAddress();
     $methods = array();
     $details = $a->getUdropshipShippingDetails();
     if ($details) {
         $details = Zend_Json::decode($details);
         $methods = isset($details['methods']) ? $details['methods'] : array();
     }
     $quoteItems = $q->getAllVisibleItems();
     Mage::helper('udropship/protected')->prepareQuoteItems($a->getAllItems());
     $vendorItems = array();
     foreach ($quoteItems as $item) {
         $vendorItems[$item->getUdropshipVendor()][] = $item;
     }
     $rates = array();
     $qRates = $a->getGroupedAllShippingRates();
     foreach ($qRates as $cCode => $cRates) {
         foreach ($cRates as $rate) {
             $vId = $rate->getUdropshipVendor();
             if (!$vId) {
                 continue;
             }
             $rates[$vId][$cCode][] = $rate;
         }
     }
     $items = array();
     $dummyProduct = Mage::getModel('catalog/product');
     foreach ($vendorItems as $vId => $vItems) {
         if (!Mage::getStoreConfigFlag('carriers/udsplit/hide_vendor_name')) {
             $items[] = Mage::getModel('udsplit/cart_vendor')->setPart('header')->setQuote1($q)->setData('product', $dummyProduct)->setVendor(Mage::helper('udropship')->getVendor($vId));
         }
         foreach ($vItems as $item) {
             $items[] = $item;
         }
         $errorsOnly = false;
         if (!empty($rates[$vId])) {
             $errorsOnly = true;
             foreach ($rates[$vId] as $cCode => $rs) {
                 //                    $hasRates = false;
                 foreach ($rs as $r) {
                     if (!$r->getErrorMessage()) {
                         //                            $hasRates = true;
                         $errorsOnly = false;
                     }
                 }
                 //                    if (!$hasRates) {
                 //                        unset($rates[$vId][$cCode]);
                 //                    }
             }
         }
         $items[] = Mage::getModel('udsplit/cart_vendor')->setPart('footer')->setData('product', $dummyProduct)->setVendor(Mage::helper('udropship')->getVendor($vId))->setEstimateRates(isset($rates[$vId]) ? $rates[$vId] : array())->setErrorsOnly($errorsOnly)->setShippingMethod(isset($methods[$vId]) ? $methods[$vId] : null)->setItems($vItems)->setQuote1($q);
     }
     return $items;
 }
Example #4
0
 public function getEstimateCountryId()
 {
     if ($this->getShippingAddress()) {
         return $this->getShippingAddress()->getCountry();
     } else {
         return parent::getEstimateCountryId();
     }
 }
 public function getItems()
 {
     if ($this->getCustomItems()) {
         return $this->getCustomItems();
     }
     $items = parent::getItems();
     if (!Mage::getStoreConfigFlag('uniquequoteitem/display/separate_line_items')) {
         Mage::helper('uniquequoteitem')->joinLineItems($items);
     }
     return $items;
 }
 /**
  * Get item row html
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @return string
  */
 public function getItemHtml(Mage_Sales_Model_Quote_Item $item)
 {
     /** @var $renderer Mage_Checkout_Block_Cart_Item_Renderer */
     $renderer = $this->getItemRenderer($item->getProductType())->setQtyMode(false);
     if ($item->getProductType() == 'undefined') {
         $renderer->overrideProductThumbnail($this->helper('catalog/image')->init($item, 'thumbnail'));
         $renderer->setProductName('');
     }
     $renderer->setDeleteUrl($this->getUrl('checkout/cart/removeFailed', array('sku' => Mage::helper('core/url')->urlEncode($item->getSku()))));
     $renderer->setIgnoreProductUrl(!$this->showItemLink($item));
     // Don't display subtotal column
     $item->setNoSubtotal(true);
     return parent::getItemHtml($item);
 }
Example #7
0
 /**
  * Before rendering html, but after trying to load cache
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _beforeToHtml()
 {
     $this->loadSliderSettings();
     return parent::_beforeToHtml();
 }
Example #8
0
 public function _construct()
 {
     parent::_construct();
     $this->setTemplate('giftwrap/cart_page.phtml');
 }
Example #9
0
 /**
  * Items for prescription payment
  * @return array Items that can be paid via prescription
  */
 public function getItems()
 {
     $itemsOld = parent::getItems();
     $items = Mage::getSingleton('prescriptionpayment/prescriptionpayment')->getReducedItems($itemsOld);
     return $items;
 }
 public function __construct()
 {
     parent::__construct();
 }