Ejemplo n.º 1
0
 public function testIsAllowedShippingMethod()
 {
     $mockedShippingMethods = "intraship_intraship";
     $this->store->setConfig('intraship/dhlonlineretoure/allowed_shipping_methods', $mockedShippingMethods);
     $this->assertTrue($this->config->isAllowedShippingMethod("intraship_intraship"));
     $this->assertFalse($this->config->isAllowedShippingMethod("flatrate_flatrate"));
 }
Ejemplo n.º 2
0
 public function setOrder(Mage_Sales_Model_Order $order)
 {
     $this->_order = $order;
     $shippingAddress = $order->getShippingAddress();
     /* @var $helper Dhl_Intraship_Helper_Data */
     $helper = Mage::helper('intraship/data');
     $senderName1 = $shippingAddress->getFirstname() . " " . $shippingAddress->getLastname();
     $senderName2 = "";
     if ($shippingAddress->getCompany()) {
         $senderName2 = $senderName1;
         $senderName1 = $shippingAddress->getCompany();
     }
     $street = $helper->splitStreet($shippingAddress->getStreetFull());
     $this->setDeliveryName($this->_config->getDeliveryNameByCountry($shippingAddress->getCountryId()))->setSenderName1($senderName1)->setSenderName2($senderName2)->setSenderStreet($street['street_name'])->setSenderStreetNumber($street['street_number'])->setSenderCareOfName($street['care_of'])->setSenderPostalCode($shippingAddress->getPostcode())->setSenderCity($shippingAddress->getCity())->setCustomerReference($this->_order->getIncrementId());
     return $this;
 }