Version Notes
Adding support for vConnect.
Fixing problem with unshipped items.
Fixing problems when no quote was yet created.
Download this release
Release Info
Developer | Smart Send ApS |
Extension | Smartsend_Logistics |
Version | 7.1.3 |
Comparing to | |
See all releases |
Code changes from version 7.1.0 to 7.1.3
- app/code/community/Smartsend/Logistics/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Block/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Block/Adminhtml/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/{Model/System → Block/Adminhtml/Sales}/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Block/Adminhtml/Sales/Order/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/{etc → Block/Adminhtml/Sales/Order/View}/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Block/Adminhtml/System/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Block/Bring.php +5 -2
- app/code/community/Smartsend/Logistics/Block/Gls.php +19 -16
- app/code/community/Smartsend/Logistics/Block/Postdanmark.php +15 -7
- app/code/community/Smartsend/Logistics/Block/Posten.php +5 -2
- app/code/community/Smartsend/Logistics/Model/.DS_Store +0 -0
- app/code/community/Smartsend/Logistics/Model/Label.php +82 -45
- app/code/community/Smartsend/Logistics/Model/Labelmagento.php +62 -25
- app/code/community/Smartsend/Logistics/Model/Observer.php +45 -4
- app/code/community/Smartsend/Logistics/Model/Order.php +64 -50
- app/code/community/Smartsend/Logistics/Model/Ordermagento.php +78 -53
- app/code/community/Smartsend/Logistics/Model/Rewrite/Sales/Total/Quote/Shipping.php +10 -1
- app/code/community/Smartsend/Logistics/Model/Rewrite/Sales/Total/Quote/Tax.php +8 -2
- app/code/community/Smartsend/Logistics/Model/System/Validateuser.php +0 -31
- app/code/community/Smartsend/Logistics/controllers/LogisticsController.php +1 -1
- app/code/community/Smartsend/Logistics/etc/config.xml +2 -2
- app/code/community/Smartsend/Logistics/etc/system.xml +1 -1
- app/design/adminhtml/default/default/layout/logistics.xml +38 -4
- app/design/adminhtml/default/default/template/logistics/array_dropdown.phtml +1 -4
- app/design/adminhtml/default/default/template/logistics/pickup.phtml +126 -0
- app/design/adminhtml/default/default/template/logistics/sales/order/create/shipping/method/form.phtml +320 -0
- app/design/frontend/base/default/template/logistics/.DS_Store +0 -0
- app/design/frontend/base/default/template/logistics/checkout/.DS_Store +0 -0
- app/design/frontend/base/default/template/logistics/checkout/onepage/.DS_Store +0 -0
- app/design/frontend/base/default/template/logistics/magestoreOnestepcheckout/shipping_method.phtml +2 -3
- app/design/frontend/base/default/template/logistics/pickup.phtml +5 -11
- app/locale/da_DK/Smartsend_Logistics.csv +10 -5
- js/logistics/jquery.session.js +132 -0
- package.xml +10 -62
app/code/community/Smartsend/Logistics/.DS_Store
CHANGED
Binary file
|
app/code/community/Smartsend/Logistics/Block/.DS_Store
CHANGED
Binary file
|
app/code/community/Smartsend/Logistics/Block/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/community/Smartsend/Logistics/{Model/System → Block/Adminhtml/Sales}/.DS_Store
RENAMED
Binary file
|
app/code/community/Smartsend/Logistics/Block/Adminhtml/Sales/Order/.DS_Store
ADDED
Binary file
|
app/code/community/Smartsend/Logistics/{etc → Block/Adminhtml/Sales/Order/View}/.DS_Store
RENAMED
Binary file
|
app/code/community/Smartsend/Logistics/Block/Adminhtml/System/.DS_Store
ADDED
Binary file
|
app/code/community/Smartsend/Logistics/Block/Bring.php
CHANGED
@@ -30,8 +30,11 @@ class Smartsend_Logistics_Block_Bring extends Mage_Checkout_Block_Onepage_Shippi
|
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
$street = $checkOut->getStreet();
|
36 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
37 |
$city = $checkOut->getCity();
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
34 |
+
$checkOut = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress(); //getting shipping address from admin checkout quote
|
35 |
+
} else {
|
36 |
+
$checkOut = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress(); //getting shipping address from frontend checkout quote
|
37 |
+
}
|
38 |
$street = $checkOut->getStreet();
|
39 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
40 |
$city = $checkOut->getCity();
|
app/code/community/Smartsend/Logistics/Block/Gls.php
CHANGED
@@ -28,26 +28,29 @@ class Smartsend_Logistics_Block_Gls extends Mage_Checkout_Block_Onepage_Shipping
|
|
28 |
public function __construct() {
|
29 |
$this->setTemplate('logistics/pickup.phtml'); // pickup points for gls
|
30 |
}
|
31 |
-
|
32 |
public function getPickupData() {
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
$
|
39 |
-
$
|
40 |
-
$
|
|
|
|
|
|
|
41 |
|
42 |
$pickup = Mage::getModel('logistics/api_pickups');
|
43 |
-
|
44 |
-
$pickup->_post($street, $city, $postcode, $country,$carriers); // get the pickup points for the postdanmark carrier
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
51 |
}
|
52 |
|
53 |
}
|
28 |
public function __construct() {
|
29 |
$this->setTemplate('logistics/pickup.phtml'); // pickup points for gls
|
30 |
}
|
31 |
+
|
32 |
public function getPickupData() {
|
33 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
34 |
+
$checkOut = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress(); //getting shipping address from admin checkout quote
|
35 |
+
} else {
|
36 |
+
$checkOut = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress(); //getting shipping address from frontend checkout quote
|
37 |
+
}
|
38 |
+
$street = $checkOut->getStreet();
|
39 |
+
$street = implode(' ', $street); // splitting the street by " "(space)
|
40 |
+
$city = $checkOut->getCity();
|
41 |
+
$postcode = $checkOut->getPostcode();
|
42 |
+
$country = $checkOut->getCountry();
|
43 |
+
$carriers = 'gls';
|
44 |
|
45 |
$pickup = Mage::getModel('logistics/api_pickups');
|
|
|
|
|
46 |
|
47 |
+
$pickup->_post($street, $city, $postcode, $country, $carriers); // get the pickup points for the postdanmark carrier
|
48 |
+
|
49 |
+
if ($pickup->getPickupPoints() != false) {
|
50 |
+
return $pickup->getPickupPoints();
|
51 |
+
} else {
|
52 |
+
return false;
|
53 |
+
}
|
54 |
}
|
55 |
|
56 |
}
|
app/code/community/Smartsend/Logistics/Block/Postdanmark.php
CHANGED
@@ -30,8 +30,11 @@ class Smartsend_Logistics_Block_Postdanmark extends Mage_Checkout_Block_Onepage_
|
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
$street = $checkOut->getStreet();
|
36 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
37 |
$city = $checkOut->getCity();
|
@@ -53,11 +56,16 @@ class Smartsend_Logistics_Block_Postdanmark extends Mage_Checkout_Block_Onepage_
|
|
53 |
public function getFlexData($carrier) {
|
54 |
|
55 |
$array = array(
|
56 |
-
$this->__('By the
|
57 |
-
$this->__('By the
|
58 |
-
$this->__('
|
59 |
-
$this->__('
|
60 |
-
$this->__('
|
|
|
|
|
|
|
|
|
|
|
61 |
);
|
62 |
$array2 = array();
|
63 |
$flexShippingMethods = Mage::getStoreConfig('carriers/smartsendpostdanmark/flexdelivery');
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
34 |
+
$checkOut = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress(); //getting shipping address from admin checkout quote
|
35 |
+
} else {
|
36 |
+
$checkOut = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress(); //getting shipping address from frontend checkout quote
|
37 |
+
}
|
38 |
$street = $checkOut->getStreet();
|
39 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
40 |
$city = $checkOut->getCity();
|
56 |
public function getFlexData($carrier) {
|
57 |
|
58 |
$array = array(
|
59 |
+
$this->__('By the front door') => $this->__('By the front door'),
|
60 |
+
$this->__('By the back door') => $this->__('By the back door'),
|
61 |
+
$this->__('One the porch') => $this->__('One the porch'),
|
62 |
+
$this->__('In the greenhouse') => $this->__('In the greenhouse'),
|
63 |
+
$this->__('In the garage/carport') => $this->__('In the garage/carport'),
|
64 |
+
$this->__('In the tool shed') => $this->__('In the tool shed'),
|
65 |
+
$this->__('In the playhouse') => $this->__('In the playhouse'),
|
66 |
+
$this->__('Under the roof of the porch')=> $this->__('Under the roof of the porch'),
|
67 |
+
$this->__('I have Modtagerflex') => $this->__('I have Modtagerflex'),
|
68 |
+
$this->__('Can be left unattended') => $this->__('Can be left unattended'),
|
69 |
);
|
70 |
$array2 = array();
|
71 |
$flexShippingMethods = Mage::getStoreConfig('carriers/smartsendpostdanmark/flexdelivery');
|
app/code/community/Smartsend/Logistics/Block/Posten.php
CHANGED
@@ -30,8 +30,11 @@ class Smartsend_Logistics_Block_Posten extends Mage_Checkout_Block_Onepage_Shipp
|
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
$street = $checkOut->getStreet();
|
36 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
37 |
$city = $checkOut->getCity();
|
30 |
}
|
31 |
|
32 |
public function getPickupData() {
|
33 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
34 |
+
$checkOut = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress(); //getting shipping address from admin checkout quote
|
35 |
+
} else {
|
36 |
+
$checkOut = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress(); //getting shipping address from frontend checkout quote
|
37 |
+
}
|
38 |
$street = $checkOut->getStreet();
|
39 |
$street = implode(' ', $street); // splitting the street by " "(space)
|
40 |
$city = $checkOut->getCity();
|
app/code/community/Smartsend/Logistics/Model/.DS_Store
ADDED
Binary file
|
app/code/community/Smartsend/Logistics/Model/Label.php
CHANGED
@@ -1,20 +1,36 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
-
* Label class
|
5 |
-
*
|
6 |
-
* The label class is used to handle requests and responses from the Smart Send Logistics API
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
*
|
15 |
-
*
|
16 |
-
* @
|
17 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
*/
|
19 |
|
20 |
/*
|
@@ -59,7 +75,8 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
59 |
|
60 |
protected $messages=array();
|
61 |
|
62 |
-
protected $
|
|
|
63 |
|
64 |
public function __construct() {
|
65 |
}
|
@@ -143,12 +160,21 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
143 |
}
|
144 |
|
145 |
/**
|
146 |
-
* This method returns whether or not to show the individual order succes
|
147 |
*
|
148 |
* @return boolean
|
149 |
*/
|
150 |
-
protected function
|
151 |
-
return $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
}
|
153 |
|
154 |
|
@@ -270,12 +296,16 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
270 |
*
|
271 |
* @return void
|
272 |
*/
|
273 |
-
|
274 |
$this->response_code = $response_code;
|
275 |
}
|
276 |
|
277 |
-
|
278 |
-
$this->
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
|
281 |
/**
|
@@ -376,10 +406,17 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
376 |
}
|
377 |
}
|
378 |
|
379 |
-
|
380 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
} else {
|
382 |
-
$this->
|
383 |
}
|
384 |
|
385 |
if(isset($response['orders']) && is_array($response['orders'])) {
|
@@ -394,15 +431,14 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
394 |
}
|
395 |
}
|
396 |
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
}
|
406 |
}
|
407 |
} elseif(isset($response['orderno'])) {
|
408 |
$this->handleOrderResponse($response);
|
@@ -435,7 +471,7 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
435 |
if(isset($order_response['pdflink'])) {
|
436 |
$order_comment .= '<br><a href="' . $order_response['pdflink'] . '" target="_blank">' . $this->getMessageString(2103) . '</a>';
|
437 |
}
|
438 |
-
if(is_array($order_response['parcels'])) {
|
439 |
// This array will be used to send shipment emails
|
440 |
$parcels_succes_array = array();
|
441 |
|
@@ -475,16 +511,17 @@ class Smartsend_Logistics_Model_Label extends Mage_Core_Model_Abstract {
|
|
475 |
}
|
476 |
|
477 |
// Show succes message with label link or pdf link
|
478 |
-
if($this->
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
|
|
488 |
}
|
489 |
|
490 |
} else {
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* Smartsend_Logistics Label class
|
5 |
+
*
|
6 |
+
* The label class is used to handle requests and responses from the Smart Send Logistics API
|
7 |
+
*
|
8 |
+
* LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the GNU General Public License v3.0
|
11 |
+
* that is bundled with this package in the file license.txt.
|
12 |
+
* It is also available through the world-wide-web at this URL:
|
13 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
14 |
+
* If you did not receive a copy of the license and are unable to
|
15 |
+
* obtain it through the world-wide-web, please send an email
|
16 |
+
* to license@smartsend.dk so we can send you a copy immediately.
|
17 |
+
*
|
18 |
+
* DISCLAIMER
|
19 |
+
*
|
20 |
+
* Do not edit or add to this file if you wish to upgrade the plugin to newer
|
21 |
+
* versions in the future. If you wish to customize the plugin for your
|
22 |
+
* needs please refer to http://www.smartsend.dk
|
23 |
+
*
|
24 |
+
* @class Smartsend_Logistics_Model_Label
|
25 |
+
* @folder /app/code/community/Smartsend/Logistics/Model/Label.php
|
26 |
+
* @category Smart Send
|
27 |
+
* @package Smartsend_Logistics
|
28 |
+
* @author Smart Send ApS
|
29 |
+
* @url http://smartsend.dk/
|
30 |
+
* @copyright Copyright (c) Smart Send ApS (http://www.smartsend.dk)
|
31 |
+
* @license http://smartsend.dk/license
|
32 |
+
* @since Class available since Release 7.1.0
|
33 |
+
* @version Release: 7.1.3
|
34 |
*/
|
35 |
|
36 |
/*
|
75 |
|
76 |
protected $messages=array();
|
77 |
|
78 |
+
protected $show_order_succes_pdf = true;
|
79 |
+
protected $show_order_succes_link = true;
|
80 |
|
81 |
public function __construct() {
|
82 |
}
|
160 |
}
|
161 |
|
162 |
/**
|
163 |
+
* This method returns whether or not to show the individual order succes for PDF
|
164 |
*
|
165 |
* @return boolean
|
166 |
*/
|
167 |
+
protected function getShowOrderSuccesPdf() {
|
168 |
+
return $this->show_order_succes_pdf;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* This method returns whether or not to show the individual order succes for link
|
173 |
+
*
|
174 |
+
* @return boolean
|
175 |
+
*/
|
176 |
+
protected function getShowOrderSuccesLink() {
|
177 |
+
return $this->show_order_succes_link;
|
178 |
}
|
179 |
|
180 |
|
296 |
*
|
297 |
* @return void
|
298 |
*/
|
299 |
+
protected function setResponseCode($response_code) {
|
300 |
$this->response_code = $response_code;
|
301 |
}
|
302 |
|
303 |
+
protected function setShowOrderSuccesPdf($boolean) {
|
304 |
+
$this->show_order_succes_pdf = $boolean;
|
305 |
+
}
|
306 |
+
|
307 |
+
protected function setShowOrderSuccesLink($boolean) {
|
308 |
+
$this->show_order_succes_link = $boolean;
|
309 |
}
|
310 |
|
311 |
/**
|
406 |
}
|
407 |
}
|
408 |
|
409 |
+
//Set whether or not to show individual PDF files
|
410 |
+
if( isset($response['combine_pdf']) && $response['combine_pdf'] != '' && $settings['combine_pdf_labels']){
|
411 |
+
$this->setShowOrderSuccesPdf(false);
|
412 |
+
} else {
|
413 |
+
$this->setShowOrderSuccesPdf(true);
|
414 |
+
}
|
415 |
+
//Set whether or not to show individual label links
|
416 |
+
if( isset($response['combine_link']) && $response['combine_link'] != '' && $settings['combine_pdf_labels']){
|
417 |
+
$this->setShowOrderSuccesLink(false);
|
418 |
} else {
|
419 |
+
$this->setShowOrderSuccesLink(true);
|
420 |
}
|
421 |
|
422 |
if(isset($response['orders']) && is_array($response['orders'])) {
|
431 |
}
|
432 |
}
|
433 |
|
434 |
+
// Add link to combined PDF label
|
435 |
+
if( !$this->getShowOrderSuccesPdf() ) {
|
436 |
+
$this->addSuccessMessage('<a href="' . $response['combine_pdf'] . '" target="_blank">' . $this->getMessageString(2101) . '</a>' );
|
437 |
+
}
|
438 |
+
|
439 |
+
// Add link to combined label print
|
440 |
+
if( !$this->getShowOrderSuccesLink() ) {
|
441 |
+
$this->addSuccessMessage('<a href="' . $response['combine_link'] . '" target="_blank">' . $this->getMessageString(2102) . '</a>' );
|
|
|
442 |
}
|
443 |
} elseif(isset($response['orderno'])) {
|
444 |
$this->handleOrderResponse($response);
|
471 |
if(isset($order_response['pdflink'])) {
|
472 |
$order_comment .= '<br><a href="' . $order_response['pdflink'] . '" target="_blank">' . $this->getMessageString(2103) . '</a>';
|
473 |
}
|
474 |
+
if(isset($order_response['parcels']) && is_array($order_response['parcels'])) {
|
475 |
// This array will be used to send shipment emails
|
476 |
$parcels_succes_array = array();
|
477 |
|
511 |
}
|
512 |
|
513 |
// Show succes message with label link or pdf link
|
514 |
+
if($this->getShowOrderSuccesPdf() && isset($order_response['pdflink']) && $order_response['pdflink'] != '') {
|
515 |
+
// Add link to PDF label
|
516 |
+
$this->addSuccessMessage( $this->getMessageString(2000) . ' '. $smartsendorder->getOrderReference() .': <a href="' . $order_response['pdflink'] . '" target="_blank">' . $this->getMessageString(2103) . '</a>' );
|
517 |
+
} elseif($this->getShowOrderSuccesLink() && isset($order_response['link']) && $order_response['link'] != '') {
|
518 |
+
// Add link to label
|
519 |
+
$this->addSuccessMessage( $this->getMessageString(2000) . ' '. $smartsendorder->getOrderReference() .': <a href="' . $order_response['link'] . '" target="_blank">' . $this->getMessageString(2104) . '</a>' );
|
520 |
+
} elseif( ( $this->getShowOrderSuccesLink() || $this->getShowOrderSuccesLink() ) && ( isset($order_response['pdflink']) && $order_response['pdflink'] != '') && (isset($order_response['link']) && $order_response['link'] != '') ) {
|
521 |
+
//There should be shown either a PDF or a link, but non is there!
|
522 |
+
throw new Exception( $this->getMessageString(2207) );
|
523 |
+
} else {
|
524 |
+
//Do nothing as there is shown a combined PDF link or print link
|
525 |
}
|
526 |
|
527 |
} else {
|
app/code/community/Smartsend/Logistics/Model/Labelmagento.php
CHANGED
@@ -1,21 +1,36 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* Label class
|
5 |
*
|
6 |
* The label class is used to handle requests and responses from the Smart Send Logistics API
|
7 |
-
* These are the CMS dependent functions that is used by the parent label class.
|
8 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
* @folder /app/code/community/Smartsend/Logistics/Model/Labelmagento.php
|
10 |
* @category Smart Send
|
11 |
* @package Smartsend_Logistics
|
12 |
-
* @
|
|
|
13 |
* @copyright Copyright (c) Smart Send ApS (http://www.smartsend.dk)
|
14 |
* @license http://smartsend.dk/license
|
15 |
-
* @version Release: 7.1.0
|
16 |
-
* @author Smart Send ApS
|
17 |
-
* @link http://smartsend.dk/download/generec
|
18 |
* @since Class available since Release 7.1.0
|
|
|
19 |
*/
|
20 |
|
21 |
class Smartsend_Logistics_Model_Labelmagento extends Smartsend_Logistics_Model_Label {
|
@@ -197,7 +212,16 @@ class Smartsend_Logistics_Model_Labelmagento extends Smartsend_Logistics_Model_L
|
|
197 |
protected function sendShipmentEmail($order_number,$parcels_succes_array,$customer_email_comments=null) {
|
198 |
if(is_array($parcels_succes_array)) {
|
199 |
foreach($parcels_succes_array as $parcel) {
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
if($shipment->getId() != '') {
|
202 |
// Only send email if it has not been send already
|
203 |
if($shipment->getEmailSent() == false ) {
|
@@ -249,34 +273,47 @@ class Smartsend_Logistics_Model_Labelmagento extends Smartsend_Logistics_Model_L
|
|
249 |
}
|
250 |
|
251 |
/*
|
252 |
-
* Add a trace code to the parcel
|
|
|
253 |
*
|
254 |
* @param string $order_number is the id of the order
|
255 |
* @param string $shipment_number is the id of the shipment
|
256 |
-
* @param string $
|
257 |
* @param string $tracelink is the linked used to crack the parcel
|
258 |
*
|
259 |
* @return void
|
260 |
*/
|
261 |
-
protected function addTracecodeToParcel($order_number,$shipment_number,$
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
|
|
|
269 |
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
->setData('number', $tracking_numder)
|
274 |
-
->setData('carrier_code', $carrier_code)
|
275 |
-
->setData('order_id', $shipment->getData('order_id'))
|
276 |
-
->save();
|
277 |
} else {
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
|
|
280 |
}
|
281 |
|
282 |
/*
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Smartsend_Logistics Label Magento class
|
5 |
*
|
6 |
* The label class is used to handle requests and responses from the Smart Send Logistics API
|
|
|
7 |
*
|
8 |
+
* LICENSE
|
9 |
+
*
|
10 |
+
* This source file is subject to the GNU General Public License v3.0
|
11 |
+
* that is bundled with this package in the file license.txt.
|
12 |
+
* It is also available through the world-wide-web at this URL:
|
13 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
14 |
+
* If you did not receive a copy of the license and are unable to
|
15 |
+
* obtain it through the world-wide-web, please send an email
|
16 |
+
* to license@smartsend.dk so we can send you a copy immediately.
|
17 |
+
*
|
18 |
+
* DISCLAIMER
|
19 |
+
*
|
20 |
+
* Do not edit or add to this file if you wish to upgrade the plugin to newer
|
21 |
+
* versions in the future. If you wish to customize the plugin for your
|
22 |
+
* needs please refer to http://www.smartsend.dk
|
23 |
+
*
|
24 |
+
* @class Smartsend_Logistics_Model_Labelmagento
|
25 |
* @folder /app/code/community/Smartsend/Logistics/Model/Labelmagento.php
|
26 |
* @category Smart Send
|
27 |
* @package Smartsend_Logistics
|
28 |
+
* @author Smart Send ApS
|
29 |
+
* @url http://smartsend.dk/
|
30 |
* @copyright Copyright (c) Smart Send ApS (http://www.smartsend.dk)
|
31 |
* @license http://smartsend.dk/license
|
|
|
|
|
|
|
32 |
* @since Class available since Release 7.1.0
|
33 |
+
* @version Release: 7.1.3.0
|
34 |
*/
|
35 |
|
36 |
class Smartsend_Logistics_Model_Labelmagento extends Smartsend_Logistics_Model_Label {
|
212 |
protected function sendShipmentEmail($order_number,$parcels_succes_array,$customer_email_comments=null) {
|
213 |
if(is_array($parcels_succes_array)) {
|
214 |
foreach($parcels_succes_array as $parcel) {
|
215 |
+
|
216 |
+
if($parcel['reference'] == $order_number && count($parcels_succes_array) == 1) {
|
217 |
+
//The shipment is created with all unshipped items
|
218 |
+
$order = Mage::getModel('sales/order')->load($order_number);
|
219 |
+
$shipment = $order->getShipmentsCollection()->getFirstItem();
|
220 |
+
} else {
|
221 |
+
//The shipment was created by the user
|
222 |
+
$shipment = Mage::getModel('sales/order_shipment')->load($parcel['reference']);
|
223 |
+
}
|
224 |
+
|
225 |
if($shipment->getId() != '') {
|
226 |
// Only send email if it has not been send already
|
227 |
if($shipment->getEmailSent() == false ) {
|
273 |
}
|
274 |
|
275 |
/*
|
276 |
+
* Add a trace code to the parcel.
|
277 |
+
* If order has no parcels, create a parcel with alll unshipped items
|
278 |
*
|
279 |
* @param string $order_number is the id of the order
|
280 |
* @param string $shipment_number is the id of the shipment
|
281 |
+
* @param string $tracking_number is the tracking number to add
|
282 |
* @param string $tracelink is the linked used to crack the parcel
|
283 |
*
|
284 |
* @return void
|
285 |
*/
|
286 |
+
protected function addTracecodeToParcel($order_number,$shipment_number,$tracking_number,$tracelink) {
|
287 |
+
|
288 |
+
$order = Mage::getModel('sales/order')->load($order_number);
|
289 |
+
$smartsendorder = Mage::getModel('logistics/ordermagento');
|
290 |
+
$smartsendorder->setOrderObject($order);
|
291 |
+
|
292 |
+
$carrier_code = 'smartsend'.$smartsendorder->getShippingCarrier();
|
293 |
+
|
294 |
+
//Get all shipments for the order
|
295 |
+
$shipments = $smartsendorder->getShipments();
|
296 |
|
297 |
+
if(empty($shipments)) {
|
298 |
+
// Create a shipment
|
299 |
+
$smartsendorder->createShipment($tracking_number);
|
|
|
|
|
|
|
|
|
300 |
} else {
|
301 |
+
$shipment = Mage::getModel('sales/order_shipment')->load($shipment_number);
|
302 |
+
|
303 |
+
if($shipment->getId() != '') {
|
304 |
+
$track = Mage::getModel('sales/order_shipment_track')
|
305 |
+
->setShipment($shipment)
|
306 |
+
->setData('title', $order->getShippingDescription())
|
307 |
+
->setData('number', $tracking_number)
|
308 |
+
->setData('carrier_code', $carrier_code)
|
309 |
+
->setData('order_id', $shipment->getData('order_id'))
|
310 |
+
->save();
|
311 |
+
} else {
|
312 |
+
throw new Exception( $this->getMessageString(2208) );
|
313 |
+
}
|
314 |
+
|
315 |
}
|
316 |
+
|
317 |
}
|
318 |
|
319 |
/*
|
app/code/community/Smartsend/Logistics/Model/Observer.php
CHANGED
@@ -63,6 +63,40 @@ class Smartsend_Logistics_Model_Observer extends Varien_Object {
|
|
63 |
}
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
/**
|
67 |
*
|
68 |
* This function is called after order gets saved to database.
|
@@ -72,14 +106,21 @@ class Smartsend_Logistics_Model_Observer extends Varien_Object {
|
|
72 |
* @param $evt
|
73 |
*/
|
74 |
public function saveOrderAfter($evt) {
|
|
|
75 |
$order = $evt->getOrder(); //getting order
|
76 |
$quote = $evt->getQuote();
|
77 |
$quote_id = $quote->getId();
|
78 |
$shippingMethod = $quote->getShippingAddress()->getShippingMethod(); //getting shipping method
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
if (isset($pickup[$quote_id])) {
|
84 |
|
85 |
$temp = $pickup[$quote_id];
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
public function getPickupFlex($quote_id,$shippingMethod,$flex_param,$pickup_param) {
|
67 |
+
$carrier = explode('_', $shippingMethod);
|
68 |
+
$carrier = $carrier[0];
|
69 |
+
|
70 |
+
/* Save data about pickup point */
|
71 |
+
$pickup = array();
|
72 |
+
$pickup_t = $pickup_param;
|
73 |
+
if ($shippingMethod == 'smartsendpostdanmark_pickup') {
|
74 |
+
$pickup['store'] = $pickup_t['store']['smartsendpostdanmark_pickup'];
|
75 |
+
} elseif ($shippingMethod == 'smartsendposten_pickup') {
|
76 |
+
$pickup['store'] = $pickup_t['store']['smartsendposten_pickup'];
|
77 |
+
} elseif ($shippingMethod == 'smartsendgls_pickup') {
|
78 |
+
$pickup['store'] = $pickup_t['store']['smartsendgls_pickup'];
|
79 |
+
} elseif ($shippingMethod == 'smartsendbring_pickup') {
|
80 |
+
$pickup['store'] = $pickup_t['store']['smartsendbring_pickup'];
|
81 |
+
}
|
82 |
+
|
83 |
+
if ($pickup) {
|
84 |
+
$data = array($quote_id => $pickup);
|
85 |
+
Mage::getSingleton('checkout/session')->setPickup($data);
|
86 |
+
}
|
87 |
+
|
88 |
+
/* Save data about flex delivery */
|
89 |
+
if ($carrier == 'smartsendpostdanmark' || $carrier == 'smartsendposten') {
|
90 |
+
$flex = array();
|
91 |
+
$flex_t = $flex_param;
|
92 |
+
$flex['store'] = $flex_t['store'][$shippingMethod];
|
93 |
+
if ($flex) {
|
94 |
+
$data_flex = array($quote_id => $flex);
|
95 |
+
Mage::getSingleton('checkout/session')->setFlex($data_flex);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
/**
|
101 |
*
|
102 |
* This function is called after order gets saved to database.
|
106 |
* @param $evt
|
107 |
*/
|
108 |
public function saveOrderAfter($evt) {
|
109 |
+
|
110 |
$order = $evt->getOrder(); //getting order
|
111 |
$quote = $evt->getQuote();
|
112 |
$quote_id = $quote->getId();
|
113 |
$shippingMethod = $quote->getShippingAddress()->getShippingMethod(); //getting shipping method
|
114 |
+
|
115 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
116 |
+
$pickup_param= Mage::app()->getRequest()->getParam('shipping_pickup');
|
117 |
+
$flex_param= Mage::app()->getRequest()->getParam('shipping_flex');
|
118 |
+
$this->getPickupFlex($quote_id,$shippingMethod,$flex_param,$pickup_param);
|
119 |
+
}
|
120 |
+
|
121 |
+
$pickup = Mage::getSingleton('checkout/session')->getPickup(); //getting picup
|
122 |
+
$flex = Mage::getSingleton('checkout/session')->getFlex(); //getting flex
|
123 |
+
|
124 |
if (isset($pickup[$quote_id])) {
|
125 |
|
126 |
$temp = $pickup[$quote_id];
|
app/code/community/Smartsend/Logistics/Model/Order.php
CHANGED
@@ -23,11 +23,14 @@
|
|
23 |
*
|
24 |
* @class Smartsend_Logistics_Model_Order
|
25 |
* @folder /app/code/community/Smartsend/Logistics/Model/Order.php
|
26 |
-
* @category
|
27 |
* @package Smartsend_Logistics
|
28 |
-
* @author
|
29 |
-
* @url
|
30 |
-
* @
|
|
|
|
|
|
|
31 |
*
|
32 |
* // Overall functions
|
33 |
* public function _construct()
|
@@ -191,13 +194,17 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
191 |
* @return boolean
|
192 |
*/
|
193 |
public function isSmartsend() {
|
|
|
|
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
201 |
return false;
|
202 |
}
|
203 |
|
@@ -210,14 +217,18 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
210 |
*/
|
211 |
public function isVconnect() {
|
212 |
|
213 |
-
|
|
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
221 |
return false;
|
222 |
}
|
223 |
|
@@ -229,17 +240,20 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
229 |
* @return boolean
|
230 |
*/
|
231 |
public function isPickupSmartsend() {
|
|
|
|
|
|
|
232 |
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
} else {
|
240 |
return false;
|
241 |
}
|
242 |
-
}
|
243 |
return false;
|
244 |
}
|
245 |
|
@@ -252,16 +266,21 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
252 |
*/
|
253 |
public function isPickupVconnect() {
|
254 |
|
255 |
-
|
256 |
-
$
|
|
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
261 |
} else {
|
262 |
return false;
|
263 |
}
|
264 |
-
|
|
|
265 |
return false;
|
266 |
}
|
267 |
}
|
@@ -358,42 +377,37 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
358 |
$shipping_string = strtolower($shipping_string);
|
359 |
|
360 |
// Smart Send shipping methods
|
361 |
-
if(
|
362 |
-
$carrier = $this->getPickupCarrier();
|
363 |
-
if(!isset($carrier) || $carrier == '') {
|
364 |
-
throw new Exception($this->_errors[2304]);
|
365 |
-
}
|
366 |
-
} elseif(substr($shipping_string, 0, strlen('smartsendbring')) === 'smartsendbring' || substr($shipping_string, 0, strlen('smartsend_bring')) === 'smartsend_bring') {
|
367 |
$carrier = 'bring';
|
368 |
-
} elseif(
|
369 |
$carrier = 'gls';
|
370 |
-
} elseif(
|
371 |
$carrier = 'postdanmark';
|
372 |
-
} elseif(
|
373 |
$carrier = 'posten';
|
374 |
|
375 |
// vConnect All-in-1 module shipping methods
|
376 |
-
} elseif(
|
377 |
$carrier = 'postdanmark';
|
378 |
-
} elseif(
|
379 |
$carrier = 'posten';
|
380 |
-
} elseif(
|
381 |
$carrier = 'postnordnorway';
|
382 |
-
} elseif(
|
383 |
$carrier = 'postnordfinland';
|
384 |
|
385 |
// Old vConnect shipping methods
|
386 |
-
} elseif(
|
387 |
$carrier = 'postdanmark';
|
388 |
-
} elseif(
|
389 |
$carrier = 'posten';
|
390 |
-
} elseif(
|
391 |
$carrier = 'postdanmark';
|
392 |
-
} elseif(
|
393 |
$carrier = 'gls';
|
394 |
-
} elseif(
|
395 |
$carrier = 'bring';
|
396 |
-
} elseif(
|
397 |
$carrier = 'postdanmark';
|
398 |
|
399 |
// If the shipping method is unknown throw an error
|
@@ -726,7 +740,7 @@ class Smartsend_Logistics_Model_Order extends Mage_Core_Model_Abstract {
|
|
726 |
}
|
727 |
} else {
|
728 |
if($this->getUnshippedItems() != null) {
|
729 |
-
$this->
|
730 |
} else {
|
731 |
throw new Exception( $this->_errors[2402] );
|
732 |
}
|
23 |
*
|
24 |
* @class Smartsend_Logistics_Model_Order
|
25 |
* @folder /app/code/community/Smartsend/Logistics/Model/Order.php
|
26 |
+
* @category Smart Send
|
27 |
* @package Smartsend_Logistics
|
28 |
+
* @author Smart Send ApS
|
29 |
+
* @url http://smartsend.dk/
|
30 |
+
* @copyright Copyright (c) Smart Send ApS (http://www.smartsend.dk)
|
31 |
+
* @license http://smartsend.dk/license
|
32 |
+
* @since Class available since Release 7.1.0
|
33 |
+
* @version Release: 7.1.2
|
34 |
*
|
35 |
* // Overall functions
|
36 |
* public function _construct()
|
194 |
* @return boolean
|
195 |
*/
|
196 |
public function isSmartsend() {
|
197 |
+
|
198 |
+
try {
|
199 |
+
$method = strtolower($this->getShippingId());
|
200 |
|
201 |
+
//Check if shipping methode starts with 'smartsend'
|
202 |
+
if(strpos($method, 'smartsend') !== false) {
|
203 |
+
return true;
|
204 |
+
} else {
|
205 |
+
return false;
|
206 |
+
}
|
207 |
+
} catch(Exception $e) {
|
208 |
return false;
|
209 |
}
|
210 |
|
217 |
*/
|
218 |
public function isVconnect() {
|
219 |
|
220 |
+
try{
|
221 |
+
$method = strtolower($this->getShippingId());
|
222 |
|
223 |
+
//Check if shipping methode starts with 'vconnect' or 'vc'
|
224 |
+
if(strpos($method, 'vconnect') !== false) {
|
225 |
+
return true;
|
226 |
+
} elseif(strpos($method, 'vc') !== false) {
|
227 |
+
return true;
|
228 |
+
} else {
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
} catch(Exception $e) {
|
232 |
return false;
|
233 |
}
|
234 |
|
240 |
* @return boolean
|
241 |
*/
|
242 |
public function isPickupSmartsend() {
|
243 |
+
try{
|
244 |
+
if($this->isSmartsend() == true) {
|
245 |
+
$method = $this->getShippingMethod();
|
246 |
|
247 |
+
//Check if shipping methode ends with 'pickup'
|
248 |
+
if(substr($method, -strlen('pickup')) === 'pickup') {
|
249 |
+
return true;
|
250 |
+
} else {
|
251 |
+
return false;
|
252 |
+
}
|
253 |
} else {
|
254 |
return false;
|
255 |
}
|
256 |
+
} catch(Exception $e) {
|
257 |
return false;
|
258 |
}
|
259 |
|
266 |
*/
|
267 |
public function isPickupVconnect() {
|
268 |
|
269 |
+
try{
|
270 |
+
if($this->isVconnect() == true) {
|
271 |
+
$method = $this->getShippingMethod();
|
272 |
|
273 |
+
//Check if shipping methode ends with 'pickup'
|
274 |
+
if(substr($method, -strlen('pickup')) === 'pickup') {
|
275 |
+
return true;
|
276 |
+
} else {
|
277 |
+
return false;
|
278 |
+
}
|
279 |
} else {
|
280 |
return false;
|
281 |
}
|
282 |
+
|
283 |
+
} catch(Exception $e) {
|
284 |
return false;
|
285 |
}
|
286 |
}
|
377 |
$shipping_string = strtolower($shipping_string);
|
378 |
|
379 |
// Smart Send shipping methods
|
380 |
+
if(strpos($shipping_string,'smartsendbring') !== false || strpos($shipping_string,'smartsend_bring') !== false) {
|
|
|
|
|
|
|
|
|
|
|
381 |
$carrier = 'bring';
|
382 |
+
} elseif(strpos($shipping_string,'smartsendgls') !== false || strpos($shipping_string,'smartsend_gls') !== false) {
|
383 |
$carrier = 'gls';
|
384 |
+
} elseif(strpos($shipping_string,'smartsendpostdanmark') !== false || strpos($shipping_string,'smartsend_postdanmark') !== false) {
|
385 |
$carrier = 'postdanmark';
|
386 |
+
} elseif(strpos($shipping_string,'smartsendposten') !== false || strpos($shipping_string,'smartsend_posten') !== false) {
|
387 |
$carrier = 'posten';
|
388 |
|
389 |
// vConnect All-in-1 module shipping methods
|
390 |
+
} elseif(strpos($shipping_string,'vconnect_postnord_dk') !== false) {
|
391 |
$carrier = 'postdanmark';
|
392 |
+
} elseif(strpos($shipping_string,'vconnect_postnord_se') !== false) {
|
393 |
$carrier = 'posten';
|
394 |
+
} elseif(strpos($shipping_string,'vconnect_postnord_no') !== false) {
|
395 |
$carrier = 'postnordnorway';
|
396 |
+
} elseif(strpos($shipping_string,'vconnect_postnord_fi') !== false) {
|
397 |
$carrier = 'postnordfinland';
|
398 |
|
399 |
// Old vConnect shipping methods
|
400 |
+
} elseif(strpos($shipping_string,'vconnect_postdanmark') !== false || strpos($shipping_string,'vc_postdanmark') !== false || strpos($shipping_string,'vc_allinone_vconnectpostdanmark') !== false) {
|
401 |
$carrier = 'postdanmark';
|
402 |
+
} elseif(strpos($shipping_string,'vconnect_posten') !== false || strpos($shipping_string,'vc_posten') !== false || strpos($shipping_string,'vc_allinone_vconnectposten') !== false) {
|
403 |
$carrier = 'posten';
|
404 |
+
} elseif(strpos($shipping_string,'vconnect_postnord') !== false || strpos($shipping_string,'vc_postnord') !== false || strpos($shipping_string,'vc_allinone_vconnectpostnord') !== false) {
|
405 |
$carrier = 'postdanmark';
|
406 |
+
} elseif(strpos($shipping_string,'vconnect_gls') !== false || strpos($shipping_string,'vc_gls') !== false) {
|
407 |
$carrier = 'gls';
|
408 |
+
} elseif(strpos($shipping_string,'vconnect_bring') !== false || strpos($shipping_string,'vc_bring') === false) {
|
409 |
$carrier = 'bring';
|
410 |
+
} elseif(strpos($shipping_string,'vconnect_pdkalpha') !== false) {
|
411 |
$carrier = 'postdanmark';
|
412 |
|
413 |
// If the shipping method is unknown throw an error
|
740 |
}
|
741 |
} else {
|
742 |
if($this->getUnshippedItems() != null) {
|
743 |
+
$this->addParcelWithUnshippedItems();
|
744 |
} else {
|
745 |
throw new Exception( $this->_errors[2402] );
|
746 |
}
|
app/code/community/Smartsend/Logistics/Model/Ordermagento.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* Smartsend_Logistics Order class
|
5 |
*
|
6 |
* Create order objects that is included in the final Smart Send label API callout.
|
7 |
-
* These are the CMS dependent functions that is used by the order class.
|
8 |
*
|
9 |
* LICENSE
|
10 |
*
|
@@ -22,18 +21,19 @@
|
|
22 |
* versions in the future. If you wish to customize the plugin for your
|
23 |
* needs please refer to http://www.smartsend.dk
|
24 |
*
|
25 |
-
*
|
26 |
* @class Smartsend_Logistics_Model_Ordermagento
|
27 |
* @folder /app/code/community/Smartsend/Logistics/Model/Ordermagento.php
|
28 |
-
* @category
|
29 |
* @package Smartsend_Logistics
|
30 |
-
* @author
|
31 |
-
* @url
|
32 |
-
* @
|
|
|
|
|
|
|
33 |
*
|
34 |
* // Order
|
35 |
* public function getShippingId()
|
36 |
-
* public function getPickupCarrier()
|
37 |
* public function getOrderId()
|
38 |
* public function getOrderReference()
|
39 |
* public function getOrderPriceTotal()
|
@@ -58,8 +58,9 @@
|
|
58 |
* public function getShipmentTrace($shipment)
|
59 |
* public function getShipmentWeight($shipment)
|
60 |
* protected function getUnshippedItems()
|
61 |
-
*
|
62 |
* protected function addShipment($shipment)
|
|
|
63 |
* protected function addItem($item)
|
64 |
*
|
65 |
*/
|
@@ -109,25 +110,6 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
109 |
return $shipMethod_id; //return unique id of shipping method
|
110 |
|
111 |
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
*
|
115 |
-
* Get carrier name based on the pickup information.
|
116 |
-
* Used if the shipping method is 'closest pickup point'
|
117 |
-
* @return string
|
118 |
-
* ## Depricted function ##
|
119 |
-
*/
|
120 |
-
public function getPickupCarrier() {
|
121 |
-
/*
|
122 |
-
$pickupModel = Mage::getModel('logistics/pickup');
|
123 |
-
$pickupData = $pickupModel->getCollection()->addFieldToFilter('order_id', $this->_order->getOrderId() )->getFirstItem(); //pickup data
|
124 |
-
if ($pickupData->getData()) {
|
125 |
-
$carrier = $pickupData->getCarrier();
|
126 |
-
} else {
|
127 |
-
$carrier = null;
|
128 |
-
}
|
129 |
-
*/
|
130 |
-
}
|
131 |
|
132 |
/**
|
133 |
*
|
@@ -588,7 +570,11 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
588 |
- $eachOrderItem->getQtyRefunded()
|
589 |
- $eachOrderItem->getQtyCanceled();
|
590 |
if($Itemqty > 0) {
|
591 |
-
$items[
|
|
|
|
|
|
|
|
|
592 |
}
|
593 |
}
|
594 |
|
@@ -605,10 +591,20 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
605 |
* Create a parcel containing all unshipped items.
|
606 |
* Add the parcel to the request.
|
607 |
*/
|
608 |
-
|
609 |
|
610 |
$order = $this->_order;
|
611 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
|
613 |
/* check order shipment is prossiable or not */
|
614 |
|
@@ -617,14 +613,28 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
617 |
$comment = "";
|
618 |
|
619 |
if ($order->canShip()) {
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
|
626 |
-
|
627 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
|
629 |
// Set the order status as 'Processing'
|
630 |
$order->setIsInProcess($email);
|
@@ -632,30 +642,15 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
632 |
|
633 |
try {
|
634 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
635 |
-
->addObject($shipment)
|
636 |
->addObject($order)
|
637 |
->save();
|
638 |
|
639 |
-
//Email the customer that the order is sent
|
640 |
-
$shipment->sendEmail($email, ($includeComment ? $comment : ''));
|
641 |
-
|
642 |
-
//Set order status as complete
|
643 |
-
//$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
|
644 |
-
//$order->setData('status', Mage_Sales_Model_Order::STATE_COMPLETE);
|
645 |
-
//$order->save();
|
646 |
-
|
647 |
-
//var_dump($qty); exit();
|
648 |
} catch (Mage_Core_Exception $e) {
|
649 |
throw new Exception($this->_errors[2402].': '.$e);
|
650 |
}
|
651 |
}
|
652 |
}
|
653 |
|
654 |
-
if ($shipment) {
|
655 |
-
//Lastly add the shipment to the order array.
|
656 |
-
$this->addShipment($shipment);
|
657 |
-
}
|
658 |
-
|
659 |
}
|
660 |
|
661 |
/**
|
@@ -684,6 +679,36 @@ class Smartsend_Logistics_Model_Ordermagento extends Smartsend_Logistics_Model_O
|
|
684 |
$this->_parcels[] = $parcel;
|
685 |
|
686 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
|
688 |
/**
|
689 |
*
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Smartsend_Logistics Order Magento class
|
5 |
*
|
6 |
* Create order objects that is included in the final Smart Send label API callout.
|
|
|
7 |
*
|
8 |
* LICENSE
|
9 |
*
|
21 |
* versions in the future. If you wish to customize the plugin for your
|
22 |
* needs please refer to http://www.smartsend.dk
|
23 |
*
|
|
|
24 |
* @class Smartsend_Logistics_Model_Ordermagento
|
25 |
* @folder /app/code/community/Smartsend/Logistics/Model/Ordermagento.php
|
26 |
+
* @category Smart Send
|
27 |
* @package Smartsend_Logistics
|
28 |
+
* @author Smart Send ApS
|
29 |
+
* @url http://smartsend.dk/
|
30 |
+
* @copyright Copyright (c) Smart Send ApS (http://www.smartsend.dk)
|
31 |
+
* @license http://smartsend.dk/license
|
32 |
+
* @since Class available since Release 7.1.0
|
33 |
+
* @version Release: 7.1.3.0
|
34 |
*
|
35 |
* // Order
|
36 |
* public function getShippingId()
|
|
|
37 |
* public function getOrderId()
|
38 |
* public function getOrderReference()
|
39 |
* public function getOrderPriceTotal()
|
58 |
* public function getShipmentTrace($shipment)
|
59 |
* public function getShipmentWeight($shipment)
|
60 |
* protected function getUnshippedItems()
|
61 |
+
* public function createShipment($tracking_number)
|
62 |
* protected function addShipment($shipment)
|
63 |
+
* protected function addParcelWithUnshippedItems()
|
64 |
* protected function addItem($item)
|
65 |
*
|
66 |
*/
|
110 |
return $shipMethod_id; //return unique id of shipping method
|
111 |
|
112 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
/**
|
115 |
*
|
570 |
- $eachOrderItem->getQtyRefunded()
|
571 |
- $eachOrderItem->getQtyCanceled();
|
572 |
if($Itemqty > 0) {
|
573 |
+
$items[] = array(
|
574 |
+
'id' => $eachOrderItem->getId(),
|
575 |
+
'productid' => $eachOrderItem->getProductId(),
|
576 |
+
'quantity' => $Itemqty
|
577 |
+
);
|
578 |
}
|
579 |
}
|
580 |
|
591 |
* Create a parcel containing all unshipped items.
|
592 |
* Add the parcel to the request.
|
593 |
*/
|
594 |
+
public function createShipment($tracking_number=null) {
|
595 |
|
596 |
$order = $this->_order;
|
597 |
+
$unshipped_items = $this->getUnshippedItems();
|
598 |
+
|
599 |
+
// Create array with id's and quantities of unshipped items
|
600 |
+
if(is_array($itemsarray)) {
|
601 |
+
$itemsarray = array();
|
602 |
+
foreach($unshipped_items as $item) {
|
603 |
+
$itemsarray[$item['id']] = $item['quantity'];
|
604 |
+
}
|
605 |
+
} else {
|
606 |
+
$itemsarray = null;
|
607 |
+
}
|
608 |
|
609 |
/* check order shipment is prossiable or not */
|
610 |
|
613 |
$comment = "";
|
614 |
|
615 |
if ($order->canShip()) {
|
616 |
+
|
617 |
+
$shipmentId = Mage::getModel('sales/order_shipment_api')->create(
|
618 |
+
$order->getIncrementId(), //(string) orderIncrementId - Order increment ID
|
619 |
+
$itemsarray, //(array) itemsQty - Array of orderItemIdQty (optional)
|
620 |
+
$comment, //(string) comment - Shipment comment (optional)
|
621 |
+
$email, //(int) email - Send email flag (optional)
|
622 |
+
$includeComment //(int) includeComment - Include comment in email flag (optional)
|
623 |
+
);
|
624 |
+
|
625 |
+
if($shipmentId) {
|
626 |
+
//Add a tracecode if one is provided
|
627 |
+
if($tracking_number && $shipmentId) {
|
628 |
+
$carrier_code = 'smartsend'.$this->getShippingCarrier();
|
629 |
|
630 |
+
$trackmodel = Mage::getModel('sales/order_shipment_api')
|
631 |
+
->addTrack(
|
632 |
+
$shipmentId, //(string) shipmentIncrementId - Shipment increment ID
|
633 |
+
$carrier_code, //(string) carrier - Carrier code (smartsendpostdanmark, smartsendgls)
|
634 |
+
$order->getShippingDescription(), //(string) title - Tracking title
|
635 |
+
$tracking_number //(string) trackNumber - Tracking number
|
636 |
+
);
|
637 |
+
}
|
638 |
|
639 |
// Set the order status as 'Processing'
|
640 |
$order->setIsInProcess($email);
|
642 |
|
643 |
try {
|
644 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
|
|
645 |
->addObject($order)
|
646 |
->save();
|
647 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
} catch (Mage_Core_Exception $e) {
|
649 |
throw new Exception($this->_errors[2402].': '.$e);
|
650 |
}
|
651 |
}
|
652 |
}
|
653 |
|
|
|
|
|
|
|
|
|
|
|
654 |
}
|
655 |
|
656 |
/**
|
679 |
$this->_parcels[] = $parcel;
|
680 |
|
681 |
}
|
682 |
+
|
683 |
+
/*
|
684 |
+
* Add a parcel to the request
|
685 |
+
* The parcel contains all unshipped items
|
686 |
+
*/
|
687 |
+
protected function addParcelWithUnshippedItems() {
|
688 |
+
$unshipped_items = $this->getUnshippedItems();
|
689 |
+
|
690 |
+
$parcel = array(
|
691 |
+
'shipdate' => null,
|
692 |
+
'reference' => $this->getOrderId(),
|
693 |
+
'weight' => 0,
|
694 |
+
'height' => null,
|
695 |
+
'width' => null,
|
696 |
+
'length' => null,
|
697 |
+
'size' => null,
|
698 |
+
'freetext1' => $this->getFreetext(),
|
699 |
+
'items' => array(),
|
700 |
+
);
|
701 |
+
|
702 |
+
foreach($unshipped_items as $item) {
|
703 |
+
$product = Mage::getModel('catalog/product')->load($item['productid']);
|
704 |
+
if( $product->getId() ) {
|
705 |
+
$parcel['weight'] =+ $item['quantity']*$product->getWeight();
|
706 |
+
$parcel['items'][] = $this->addItem($product);
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
$this->_parcels[] = $parcel;
|
711 |
+
}
|
712 |
|
713 |
/**
|
714 |
*
|
app/code/community/Smartsend/Logistics/Model/Rewrite/Sales/Total/Quote/Shipping.php
CHANGED
@@ -28,6 +28,11 @@ class Smartsend_Logistics_Model_Rewrite_Sales_Total_Quote_Shipping extends Mage_
|
|
28 |
public function collect(Mage_Sales_Model_Quote_Address $address) {
|
29 |
|
30 |
$this->_setAddress($address);
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* Reset amounts
|
33 |
*/
|
@@ -51,7 +56,11 @@ class Smartsend_Logistics_Model_Rewrite_Sales_Total_Quote_Shipping extends Mage_
|
|
51 |
|
52 |
$smartsend_exclude = false;
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
|
56 |
if (substr($shipping_method, 0, strlen('smartsend')) === 'smartsend') {
|
57 |
$carrier = explode('_', $shipping_method);
|
28 |
public function collect(Mage_Sales_Model_Quote_Address $address) {
|
29 |
|
30 |
$this->_setAddress($address);
|
31 |
+
|
32 |
+
//Exit if no quote
|
33 |
+
if( !$address->hasQuote() ) {
|
34 |
+
$this;
|
35 |
+
}
|
36 |
/**
|
37 |
* Reset amounts
|
38 |
*/
|
56 |
|
57 |
$smartsend_exclude = false;
|
58 |
|
59 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
60 |
+
$shipping_method = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress()->getShippingMethod(); //getting shipping method from admin checkout quote
|
61 |
+
} else {
|
62 |
+
$shipping_method = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod(); //getting shipping method from frontend checkout quote
|
63 |
+
}
|
64 |
|
65 |
if (substr($shipping_method, 0, strlen('smartsend')) === 'smartsend') {
|
66 |
$carrier = explode('_', $shipping_method);
|
app/code/community/Smartsend/Logistics/Model/Rewrite/Sales/Total/Quote/Tax.php
CHANGED
@@ -33,8 +33,14 @@ class Smartsend_Logistics_Model_Rewrite_Sales_Total_Quote_Tax extends Mage_Tax_
|
|
33 |
$taxRateRequest->setProductClassId($this->_config->getShippingTaxClass($this->_store));
|
34 |
|
35 |
|
36 |
-
//Smart Send custom code - start
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
if(substr($shipping_method, 0, strlen('smartsend')) === 'smartsend') {
|
40 |
|
33 |
$taxRateRequest->setProductClassId($this->_config->getShippingTaxClass($this->_store));
|
34 |
|
35 |
|
36 |
+
//Smart Send custom code - start
|
37 |
+
if (Mage::app()->getStore()->isAdmin() && Mage::getSingleton('adminhtml/session_quote')->hasQuote()) {
|
38 |
+
$shipping_method = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress()->getShippingMethod(); //getting shipping method from admin checkout quote
|
39 |
+
} elseif( Mage::getSingleton('checkout/session')->hasQuote() ) {
|
40 |
+
$shipping_method = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod(); //getting shipping method from frontend checkout quote
|
41 |
+
} else {
|
42 |
+
$shipping_method = '';
|
43 |
+
}
|
44 |
|
45 |
if(substr($shipping_method, 0, strlen('smartsend')) === 'smartsend') {
|
46 |
|
app/code/community/Smartsend/Logistics/Model/System/Validateuser.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* GoMage LightCheckout Extension
|
4 |
-
*
|
5 |
-
* @category Extension
|
6 |
-
* @copyright Copyright (c) 2010-2015 GoMage (http://www.gomage.com)
|
7 |
-
* @author GoMage
|
8 |
-
* @license http://www.gomage.com/license-agreement/ Single domain license
|
9 |
-
* @terms of use http://www.gomage.com/terms-of-use
|
10 |
-
* @version Release: 5.9
|
11 |
-
* @since Class available since Release 2.0
|
12 |
-
*/
|
13 |
-
|
14 |
-
class Smartsend_Logistics_Model_System_Validateuser extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
15 |
-
|
16 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
17 |
-
{
|
18 |
-
|
19 |
-
$r = Mage::getStoreConfig('gomage_activation/lightcheckout/ar');
|
20 |
-
|
21 |
-
$validation = false;
|
22 |
-
|
23 |
-
if($validation) {
|
24 |
-
return sprintf('<strong class="required">%s</strong>', $this->__('User account verified'));
|
25 |
-
|
26 |
-
} else {
|
27 |
-
return sprintf('<strong class="required">%s</strong>', $this->__('Please enter a valid key'));
|
28 |
-
}
|
29 |
-
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Smartsend/Logistics/controllers/LogisticsController.php
CHANGED
@@ -169,7 +169,7 @@ class Smartsend_Logistics_LogisticsController extends Mage_Adminhtml_Controller_
|
|
169 |
if( $label->hasRequestOrders() ) {
|
170 |
try{
|
171 |
$label->sendRequest();
|
172 |
-
$label->handleApiReponse(
|
173 |
} catch(Exception $e) {
|
174 |
$label->addErrorMessage( $e->getMessage() );
|
175 |
}
|
169 |
if( $label->hasRequestOrders() ) {
|
170 |
try{
|
171 |
$label->sendRequest();
|
172 |
+
$label->handleApiReponse();
|
173 |
} catch(Exception $e) {
|
174 |
$label->addErrorMessage( $e->getMessage() );
|
175 |
}
|
app/code/community/Smartsend/Logistics/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Smartsend_Logistics>
|
5 |
-
<version>7.1.
|
6 |
</Smartsend_Logistics>
|
7 |
</modules>
|
8 |
<frontend>
|
@@ -240,7 +240,7 @@
|
|
240 |
<smartsend>
|
241 |
<username></username>
|
242 |
<licencekey></licencekey>
|
243 |
-
<validation
|
244 |
<combinepdf>1</combinepdf>
|
245 |
<listformat>1</listformat> <!-- is listtype #Company, #Street, #Zipcode #City-->
|
246 |
<status></status> <!-- order status -->
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Smartsend_Logistics>
|
5 |
+
<version>7.1.3</version>
|
6 |
</Smartsend_Logistics>
|
7 |
</modules>
|
8 |
<frontend>
|
240 |
<smartsend>
|
241 |
<username></username>
|
242 |
<licencekey></licencekey>
|
243 |
+
<validation></validation>
|
244 |
<combinepdf>1</combinepdf>
|
245 |
<listformat>1</listformat> <!-- is listtype #Company, #Street, #Zipcode #City-->
|
246 |
<status></status> <!-- order status -->
|
app/code/community/Smartsend/Logistics/etc/system.xml
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
<frontend_type>text</frontend_type>
|
18 |
<sort_order>110</sort_order>
|
19 |
<show_in_default>1</show_in_default>
|
20 |
-
<show_in_website>1</show_in_website>
|
21 |
<show_in_store>1</show_in_store>
|
22 |
</username>
|
23 |
<licensekey translate="label">
|
17 |
<frontend_type>text</frontend_type>
|
18 |
<sort_order>110</sort_order>
|
19 |
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
<show_in_store>1</show_in_store>
|
22 |
</username>
|
23 |
<licensekey translate="label">
|
app/design/adminhtml/default/default/layout/logistics.xml
CHANGED
@@ -64,11 +64,45 @@
|
|
64 |
</action>
|
65 |
</reference>
|
66 |
<reference name="sales_order_tabs">
|
67 |
-
|
68 |
<action method="addTab">
|
69 |
-
|
70 |
-
|
71 |
</action>
|
72 |
</reference>
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
</layout>
|
64 |
</action>
|
65 |
</reference>
|
66 |
<reference name="sales_order_tabs">
|
67 |
+
<block type="logistics/adminhtml_sales_order_view_tab_info" name="logistics_order_view_info_tab" template="logistics/sales/order/view/tab/info.phtml" ></block>
|
68 |
<action method="addTab">
|
69 |
+
<name>smart_send_pickup</name>
|
70 |
+
<block>logistics_order_view_info_tab</block>
|
71 |
</action>
|
72 |
</reference>
|
73 |
+
</adminhtml_sales_order_view>
|
74 |
+
|
75 |
+
<adminhtml_sales_order_create_index>
|
76 |
+
<reference name="head">
|
77 |
+
<action method="addItem">
|
78 |
+
<type>js</type>
|
79 |
+
<name>logistics/jquery-1.6.4.min.js</name>
|
80 |
+
</action>
|
81 |
+
<action method="addItem">
|
82 |
+
<type>js</type>
|
83 |
+
<name>logistics/noconflict.js</name>
|
84 |
+
</action>
|
85 |
+
<action method="addItem">
|
86 |
+
<type>js</type>
|
87 |
+
<name>logistics/jquery.session.js</name>
|
88 |
+
</action>
|
89 |
+
</reference>
|
90 |
+
<reference name='shipping_method'>
|
91 |
+
<block type="adminhtml/sales_order_create_shipping_method_form" template="logistics/sales/order/create/shipping/method/form.phtml" name="form" />
|
92 |
+
</reference>
|
93 |
+
</adminhtml_sales_order_create_index>
|
94 |
+
<adminhtml_sales_order_create_load_block_data>
|
95 |
+
<reference name="form">
|
96 |
+
<action method="setTemplate">
|
97 |
+
<template>logistics/sales/order/create/shipping/method/form.phtml</template>
|
98 |
+
</action>
|
99 |
+
</reference>
|
100 |
+
</adminhtml_sales_order_create_load_block_data>
|
101 |
+
<adminhtml_sales_order_create_load_block_shipping_method>
|
102 |
+
<reference name="form">
|
103 |
+
<action method="setTemplate">
|
104 |
+
<template>logistics/sales/order/create/shipping/method/form.phtml</template>
|
105 |
+
</action>
|
106 |
+
</reference>
|
107 |
+
</adminhtml_sales_order_create_load_block_shipping_method>
|
108 |
</layout>
|
app/design/adminhtml/default/default/template/logistics/array_dropdown.phtml
CHANGED
@@ -192,7 +192,7 @@ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
|
|
192 |
</style>
|
193 |
<script type="text/javascript">
|
194 |
document.getElementById('carriers_smartsend_validation').disabled=true;
|
195 |
-
if(document.getElementById('carriers_smartsend_validation').value
|
196 |
document.getElementById('carriers_smartsend_validation').value = '<?php echo Mage::helper('logistics')->__( 'Please enter valid user information' ); ?>';
|
197 |
document.getElementById('carriers_smartsend_validation').style.color = "red";
|
198 |
} else if(document.getElementById('carriers_smartsend_validation').value != '<?php echo Mage::helper('logistics')->__( 'Please enter valid user information' ); ?>'
|
@@ -210,8 +210,5 @@ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
|
|
210 |
document.getElementById('carriers_smartsend_validation').value = '<?php echo Mage::helper('logistics')->__( 'Save settings to validate' ); ?>';
|
211 |
document.getElementById('carriers_smartsend_validation').style.color = "orange";
|
212 |
}
|
213 |
-
} else {
|
214 |
-
document.getElementById('carriers_smartsend_validation').value = '<?php echo Mage::helper('logistics')->__( 'Please enter valid user information' ); ?>';
|
215 |
-
document.getElementById('carriers_smartsend_validation').style.color = "red";
|
216 |
}
|
217 |
</script>
|
192 |
</style>
|
193 |
<script type="text/javascript">
|
194 |
document.getElementById('carriers_smartsend_validation').disabled=true;
|
195 |
+
if(document.getElementById('carriers_smartsend_validation').value == 0 || document.getElementById('carriers_smartsend_validation').value == '0' || document.getElementById('carriers_smartsend_validation').value == '') {
|
196 |
document.getElementById('carriers_smartsend_validation').value = '<?php echo Mage::helper('logistics')->__( 'Please enter valid user information' ); ?>';
|
197 |
document.getElementById('carriers_smartsend_validation').style.color = "red";
|
198 |
} else if(document.getElementById('carriers_smartsend_validation').value != '<?php echo Mage::helper('logistics')->__( 'Please enter valid user information' ); ?>'
|
210 |
document.getElementById('carriers_smartsend_validation').value = '<?php echo Mage::helper('logistics')->__( 'Save settings to validate' ); ?>';
|
211 |
document.getElementById('carriers_smartsend_validation').style.color = "orange";
|
212 |
}
|
|
|
|
|
|
|
213 |
}
|
214 |
</script>
|
app/design/adminhtml/default/default/template/logistics/pickup.phtml
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Smartsend_Logistics
|
4 |
+
*
|
5 |
+
* This source file is subject to the GNU General Public License v3.0
|
6 |
+
* that is bundled with this package in the file license.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
+
* If you did not receive a copy of the license and are unable to
|
10 |
+
* obtain it through the world-wide-web, please send an email
|
11 |
+
* to license@smartsend.dk so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade the plugin to newer
|
16 |
+
* versions in the future. If you wish to customize the plugin for your
|
17 |
+
* needs please refer to http://www.smartsend.dk
|
18 |
+
*
|
19 |
+
* @folder /app/design/adminhtml/default/default/template/logistics/pickup.phtml
|
20 |
+
* @category Smartsend
|
21 |
+
* @package Smartsend_Logistics
|
22 |
+
* @author Anders Bilfeldt
|
23 |
+
* @url www.smartsend.dk
|
24 |
+
*/
|
25 |
+
$_rate = $this->getRate(); //shipping method rate
|
26 |
+
$method = $_rate->getMethod(); //shipping method
|
27 |
+
if ($method == 'pickup') { //if shipping method is pickup then the pickup points will show
|
28 |
+
$_code = $this->getMethodCode(); //shipping method code
|
29 |
+
$carrier = $this->getMethodInstance();
|
30 |
+
$pickupData = $this->getQuote()->getPickupData(); //shipping method pickup
|
31 |
+
$result = $this->getPickupData(); //shipping method pickup data
|
32 |
+
|
33 |
+
if (!isset($pickupData['store'])) {
|
34 |
+
$pickupData['store'] = -1;
|
35 |
+
}
|
36 |
+
if (!isset($pickupData['name'])) {
|
37 |
+
$pickupData['name'] = '';
|
38 |
+
}
|
39 |
+
?>
|
40 |
+
<ul class="form-list" id="shipping_form_<?php echo $_rate->getCode() ?>" style="display:none;">
|
41 |
+
<li>
|
42 |
+
<?php
|
43 |
+
if (count($result) <= 0 || $result == FALSE) { //if no pickup data available
|
44 |
+
?>
|
45 |
+
<span id="no_record_<?php echo $_rate->getCode() ?>"><?php echo $this->__('Shipping to closest pick-up point'); ?></span>
|
46 |
+
<!-- <script type="text/javascript">
|
47 |
+
jQuery(document).ready(function() {
|
48 |
+
var rm = jQuery("#no_record_<?php //echo $_rate->getCode() ?>").parent('li').parent('ul').parent('li').parent('ul').parent('dd');
|
49 |
+
jQuery(rm).prev('dt').remove();
|
50 |
+
jQuery(rm).remove();
|
51 |
+
/* hack for onepagecheckout */
|
52 |
+
var op = jQuery("#shipping_form_<?php //echo $_rate->getCode() ?>").parent("dt");
|
53 |
+
jQuery(op).prev("dd").remove();
|
54 |
+
jQuery(op).remove();
|
55 |
+
/* hack for onepagecheckout */
|
56 |
+
});
|
57 |
+
</script> -->
|
58 |
+
<?php
|
59 |
+
} else { //displaying pickup data
|
60 |
+
?>
|
61 |
+
<label for="<?php echo $_code ?>_store" class=""><?php echo $this->__('Select a pick-up point').':'; ?></label>
|
62 |
+
<span class="input-box">
|
63 |
+
<select onchange="pickupSelect(this)" style="max-width:280px" class="pickup-delivery required-entry" name="shipping_pickup[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
64 |
+
<option value=''><?php echo $this->__('Select a pick-up point'); ?></option>
|
65 |
+
<?php
|
66 |
+
foreach ($result as $key => $value) {
|
67 |
+
$s = '';
|
68 |
+
foreach ($value as $k => $val) {
|
69 |
+
if ($k == 'zip_code') {
|
70 |
+
$s .= $val . " ";
|
71 |
+
} else {
|
72 |
+
$s .= $val . ", ";
|
73 |
+
}
|
74 |
+
}
|
75 |
+
?>
|
76 |
+
<option value='<?php echo $key ?>'><?php echo substr($s, 0, -2) ?></option>
|
77 |
+
<?php
|
78 |
+
}
|
79 |
+
?>
|
80 |
+
</select>
|
81 |
+
</span>
|
82 |
+
<?php } ?>
|
83 |
+
</li>
|
84 |
+
</ul>
|
85 |
+
<?php } ?>
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
<?php
|
90 |
+
$carrier = explode('_', $_rate->getCode()); //shipping method carrier
|
91 |
+
|
92 |
+
if ($carrier[0] == 'smartsendpostdanmark' || $carrier[0] == 'smartsendposten') { //if shipping method is smartsendposten or smartsendpostdanmark, then the Flex points will show
|
93 |
+
$_code = $this->getMethodCode(); //shipping method code
|
94 |
+
|
95 |
+
$carrier = $_rate->getCode();
|
96 |
+
$result = $this->getFlexData($carrier); //shipping method flex data
|
97 |
+
?>
|
98 |
+
<ul class="form-list" id="shipping_form_<?php echo $_rate->getCode() ?>" style="display:none;">
|
99 |
+
<li>
|
100 |
+
<?php
|
101 |
+
if (count($result) > 0 || $result == true) {
|
102 |
+
//displaying flex data
|
103 |
+
?>
|
104 |
+
<label for="<?php echo $_code ?>_store" class=""><?php echo $this->__('Select a flexdelivery option').':'; ?></label>
|
105 |
+
<span class="input-box">
|
106 |
+
<select onchange="flexSelect(this)" class="flex-delivery required-entry" style="max-width:280px" name="shipping_flex[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
107 |
+
<option value=''><?php echo $this->__('Select a flexdelivery option'); ?></option>
|
108 |
+
<?php
|
109 |
+
foreach ($result as $key => $value) {
|
110 |
+
$s = '';
|
111 |
+
if ($value == 'zip_code') {
|
112 |
+
$s .= $value . " ";
|
113 |
+
} else {
|
114 |
+
$s .= $value . ", ";
|
115 |
+
}
|
116 |
+
?>
|
117 |
+
<option value='<?php echo $key ?>'><?php echo substr($s, 0, -2) ?></option>
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
?>
|
121 |
+
</select>
|
122 |
+
</span>
|
123 |
+
<?php } ?>
|
124 |
+
</li>
|
125 |
+
</ul>
|
126 |
+
<?php } ?>
|
app/design/adminhtml/default/default/template/logistics/sales/order/create/shipping/method/form.phtml
ADDED
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Smartsend_Logistics
|
4 |
+
*
|
5 |
+
* This source file is subject to the GNU General Public License v3.0
|
6 |
+
* that is bundled with this package in the file license.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
+
* If you did not receive a copy of the license and are unable to
|
10 |
+
* obtain it through the world-wide-web, please send an email
|
11 |
+
* to license@smartsend.dk so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade the plugin to newer
|
16 |
+
* versions in the future. If you wish to customize the plugin for your
|
17 |
+
* needs please refer to http://www.smartsend.dk
|
18 |
+
*
|
19 |
+
* @folder /app/design/adminhtml/default/default/template/logistics/sales/order/create/shipping/method/form.phtml
|
20 |
+
* @category Smartsend
|
21 |
+
* @package Smartsend_Logistics
|
22 |
+
* @author Anders Bilfeldt
|
23 |
+
* @url www.smartsend.dk
|
24 |
+
*/ ?>
|
25 |
+
<script type="text/javascript">
|
26 |
+
jQuery(document).ready(function() {
|
27 |
+
|
28 |
+
hideShippingAll();
|
29 |
+
jQuery('input[type="radio"][name="order[shipping_method]"][class="smartsend"]').click(function() {
|
30 |
+
jQuery.session.set('pickup','');
|
31 |
+
jQuery.session.set('flex','');
|
32 |
+
hideShippingAll();
|
33 |
+
var code = jQuery(this).val();
|
34 |
+
if (jQuery(this).is(':checked')) {
|
35 |
+
if(jQuery("[id='" + 'shipping_form_' + code + "']").length != 0){
|
36 |
+
showShipping(code);
|
37 |
+
}else{
|
38 |
+
order.setShippingMethod(jQuery(this).val())
|
39 |
+
}
|
40 |
+
}
|
41 |
+
});
|
42 |
+
jQuery('input[type="radio"][name="order[shipping_method]"][class="smartsend"]').each(function() {
|
43 |
+
var code = jQuery(this).val();
|
44 |
+
if (jQuery(this).is(":checked")) {
|
45 |
+
showShipping(code);
|
46 |
+
}
|
47 |
+
});
|
48 |
+
|
49 |
+
jQuery("input[name='order[shipping_method]']").last().addClass('validate-one-required-by-name');
|
50 |
+
});
|
51 |
+
|
52 |
+
function pickupSelect(pickup){
|
53 |
+
if(jQuery(pickup).is(':visible')){
|
54 |
+
str=pickup.name;
|
55 |
+
var flex = str.replace("shipping_pickup", "shipping_flex");
|
56 |
+
$is_selected=false;
|
57 |
+
if(jQuery('[name="'+flex+'"]').length ){
|
58 |
+
|
59 |
+
if(jQuery('[name="'+flex+'"]').val() && pickup.value){
|
60 |
+
|
61 |
+
jQuery.session.set('pickup',pickup.name+"?--?"+pickup.value);
|
62 |
+
jQuery.session.set('flex',flex+"?--?"+jQuery('[name="'+flex+'"]').val());
|
63 |
+
|
64 |
+
order.setShippingMethod(jQuery('select[name="'+pickup.name+'"]').parents('ul').parents('li').find('input[name="order[shipping_method]"]').val());
|
65 |
+
}
|
66 |
+
$is_selected=true;
|
67 |
+
}else{
|
68 |
+
if(pickup.value){
|
69 |
+
|
70 |
+
jQuery.session.set('pickup',pickup.name+"?--?"+pickup.value);
|
71 |
+
|
72 |
+
order.setShippingMethod(jQuery('select[name="'+pickup.name+'"]').parents('ul').parents('li').find('input[name="order[shipping_method]"]').val());
|
73 |
+
}
|
74 |
+
$is_selected=true;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
function flexSelect(flex){
|
80 |
+
if(jQuery(flex).is(':visible')){
|
81 |
+
|
82 |
+
str=flex.name;
|
83 |
+
var pickup = str.replace("shipping_flex", "shipping_pickup");
|
84 |
+
$is_selected=false;
|
85 |
+
if(jQuery('[name="'+pickup+'"]').length){
|
86 |
+
if(jQuery('[name="'+pickup+'"]').val() && flex.value ){
|
87 |
+
jQuery.session.set('flex',flex.name+"?--?"+flex.value);
|
88 |
+
jQuery.session.set('pickup',pickup+"?--?"+jQuery('[name="'+pickup+'"]').val());
|
89 |
+
|
90 |
+
order.setShippingMethod(jQuery('select[name="'+flex.name+'"]').parents('ul').parents('li').find('input[name="order[shipping_method]"]').val());
|
91 |
+
}
|
92 |
+
$is_selected=true;
|
93 |
+
}else{
|
94 |
+
if(flex.value){
|
95 |
+
jQuery.session.set('flex',flex.name+"?--?"+flex.value);
|
96 |
+
|
97 |
+
|
98 |
+
order.setShippingMethod(jQuery('select[name="'+flex.name+'"]').parents('ul').parents('li').find('input[name="order[shipping_method]"]').val());
|
99 |
+
}
|
100 |
+
$is_selected=true;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
function showShipping(code) {
|
107 |
+
if (jQuery("[id='" + 'shipping_form_' + code + "']").length != 0) {
|
108 |
+
jQuery("[id='" + 'shipping_form_' + code + "']").show();
|
109 |
+
jQuery(this).find('.required-entry').attr('disabled', 'false');
|
110 |
+
jQuery("[id='" + 'shipping_form_' + code + "']").parent('li').find('.flex-delivery').addClass('required-entry');
|
111 |
+
jQuery("[id='" + 'shipping_form_' + code + "']").parent('li').find('.pickup-delivery').addClass('required-entry');
|
112 |
+
|
113 |
+
}
|
114 |
+
}
|
115 |
+
function hideShippingAll() {
|
116 |
+
jQuery('input[type="radio"][name="order[shipping_method]"]').each(function() {
|
117 |
+
var code = jQuery(this).val();
|
118 |
+
jQuery("[id='" + 'shipping_form_' + code + "']").hide();
|
119 |
+
jQuery(this).find('.required-entry').attr('disabled', 'true');
|
120 |
+
jQuery(this).parent('li').find('.required-entry').removeClass('required-entry');
|
121 |
+
jQuery(this).parent('li').find('.validation-advice').remove();
|
122 |
+
});
|
123 |
+
}
|
124 |
+
</script>
|
125 |
+
<?php /** @var $this Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form */ ?>
|
126 |
+
<?php $_shippingRateGroups = $this->getShippingRates(); ?>
|
127 |
+
<?php if ($_shippingRateGroups): ?>
|
128 |
+
<div id="order-shipping-method-choose" style="display:none">
|
129 |
+
<dl class="shipment-methods">
|
130 |
+
<?php foreach ($_shippingRateGroups as $code => $_rates): ?>
|
131 |
+
<dt><strong><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></strong></dt>
|
132 |
+
<dd>
|
133 |
+
<ul>
|
134 |
+
<?php foreach ($_rates as $_rate): ?>
|
135 |
+
<?php $_code = $_rate->getCode() ?>
|
136 |
+
<li>
|
137 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
138 |
+
<ul class="messages">
|
139 |
+
<li class="error-msg"><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li>
|
140 |
+
</ul>
|
141 |
+
<?php else: ?>
|
142 |
+
<?php
|
143 |
+
if (preg_match('/smartsend/i', $_code)) {
|
144 |
+
?>
|
145 |
+
<?php $_radioProperty = 'name="order[shipping_method]" type="radio" ' ?>
|
146 |
+
|
147 |
+
<?php $_checked = $this->isMethodActive($_code) ? 'checked="checked"' : '' ?>
|
148 |
+
<input <?php echo $_radioProperty ?> value="<?php echo $_code ?>" id="s_method_<?php echo $_code ?>" <?php echo $_checked ?> class="smartsend"/>
|
149 |
+
<label class="normal" for="s_method_<?php echo $_code ?>">
|
150 |
+
<?php echo $this->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
|
151 |
+
<strong>
|
152 |
+
<?php $shipping_method = $_rate->getCode();
|
153 |
+
$carrier = explode('_', $shipping_method);
|
154 |
+
$smartsend_carrier = $carrier['0'];
|
155 |
+
$excludedMethod = Mage::getModel('logistics/shippingMethods')->excludedTax($shipping_method);
|
156 |
+
|
157 |
+
if (substr($shipping_method, 0, strlen('smartsend')) === 'smartsend' && Mage::getStoreConfig("carriers/" . $smartsend_carrier . "/excludetax") && $excludedMethod) {
|
158 |
+
?>
|
159 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), 0); ?> <!-- get shipping price excluding tax if shipping method does not contains tax -->
|
160 |
+
<?php echo $_excl; ?>
|
161 |
+
|
162 |
+
|
163 |
+
<?php }else{ ?>
|
164 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
165 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
166 |
+
|
167 |
+
<?php echo $_excl; ?>
|
168 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
169 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
170 |
+
<?php endif; ?>
|
171 |
+
<?php
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
</strong>
|
175 |
+
</label><?php
|
176 |
+
$block = $this->getLayout()->createBlock('logistics/' . strtolower(str_replace(' ', '', $_rate->getCarrier_title())))->setData('rate', $_rate)->setTemplate('logistics/pickup.phtml');
|
177 |
+
echo $block->toHtml();
|
178 |
+
}else {
|
179 |
+
?>
|
180 |
+
<?php $_radioProperty = 'name="order[shipping_method]" type="radio" onclick="order.setShippingMethod(this.value)"' ?>
|
181 |
+
|
182 |
+
<?php $_checked = $this->isMethodActive($_code) ? 'checked="checked"' : '' ?>
|
183 |
+
<input <?php echo $_radioProperty ?> value="<?php echo $_code ?>" id="s_method_<?php echo $_code ?>" <?php echo $_checked ?>/>
|
184 |
+
<label class="normal" for="s_method_<?php echo $_code ?>">
|
185 |
+
<?php echo $this->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
|
186 |
+
<strong>
|
187 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
188 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
189 |
+
|
190 |
+
<?php echo $_excl; ?>
|
191 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
192 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
193 |
+
<?php endif; ?>
|
194 |
+
</strong>
|
195 |
+
</label>
|
196 |
+
<?php } ?>
|
197 |
+
<?php endif ?>
|
198 |
+
</li>
|
199 |
+
<?php endforeach; ?>
|
200 |
+
</ul>
|
201 |
+
</dd>
|
202 |
+
<?php endforeach; ?>
|
203 |
+
</dl>
|
204 |
+
</div>
|
205 |
+
<?php if ($_rate = $this->getActiveMethodRate()): ?>
|
206 |
+
<div id="order-shipping-method-info">
|
207 |
+
<strong><?php echo $this->escapeHtml($this->getCarrierName($_rate->getCarrier())) ?></strong><br/>
|
208 |
+
<?php echo $this->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
|
209 |
+
<strong>
|
210 |
+
<?php $shipping_method = $_rate->getCode();
|
211 |
+
$carrier = explode('_', $shipping_method);
|
212 |
+
$smartsend_carrier = $carrier['0'];
|
213 |
+
$excludedMethod = Mage::getModel('logistics/shippingMethods')->excludedTax($shipping_method);
|
214 |
+
|
215 |
+
if (substr($shipping_method, 0, strlen('smartsend')) === 'smartsend' && Mage::getStoreConfig("carriers/" . $smartsend_carrier . "/excludetax") && $excludedMethod) {
|
216 |
+
?>
|
217 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), 0); ?> <!-- get shipping price excluding tax if shipping method does not contains tax -->
|
218 |
+
<?php echo $_excl; ?>
|
219 |
+
|
220 |
+
|
221 |
+
<?php }else{ ?>
|
222 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
223 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
224 |
+
|
225 |
+
<?php echo $_excl; ?>
|
226 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
227 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
228 |
+
<?php endif; ?>
|
229 |
+
<?php } ?>
|
230 |
+
</strong>
|
231 |
+
<!--input type="text" class="input-text" style="width:70px"/-->
|
232 |
+
<br/>
|
233 |
+
|
234 |
+
<?php
|
235 |
+
$_code = $_rate->getCode();
|
236 |
+
if (preg_match('/smartsend/i', $_code)) {
|
237 |
+
echo "<div class='pickup' style='display:none;margin-bottom:5px;'><span class='value' style='word-wrap: break-word;'></span> </div>";
|
238 |
+
echo "<div class='flex' style='display:none;margin-bottom:5px;'> Flex delivery: <span class='value' style='word-wrap: break-word;'></span> </div>";
|
239 |
+
?>
|
240 |
+
<script type="text/javascript">
|
241 |
+
// Add support for .contains for chrome
|
242 |
+
if (!String.prototype.contains) {
|
243 |
+
String.prototype.contains = function(s) {
|
244 |
+
return this.indexOf(s) > -1
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
if(jQuery.session.get('flex')){
|
249 |
+
flexresult= jQuery.session.get('flex').split('?--?');
|
250 |
+
if(flexresult[0].contains("<?php echo $_rate->getMethod()."]"; ?>")){
|
251 |
+
jQuery('.flex .value').html(flexresult[1]);
|
252 |
+
jQuery("select[name='"+flexresult[0]+"']").val(flexresult[1]).change();
|
253 |
+
jQuery('.flex').show();
|
254 |
+
}
|
255 |
+
}
|
256 |
+
if(jQuery.session.get('pickup')){
|
257 |
+
pickupresult= jQuery.session.get('pickup').split('?--?');
|
258 |
+
if(pickupresult[0].contains("<?php echo $_rate->getMethod()."]"; ?>")){
|
259 |
+
comm=1;
|
260 |
+
str=[''];
|
261 |
+
i=0;
|
262 |
+
jQuery.each(pickupresult[1], function (ind, c) {
|
263 |
+
if(c=='"'){
|
264 |
+
comm=comm+1;
|
265 |
+
if (comm % 2 !== 0) {
|
266 |
+
i=i+1;
|
267 |
+
str[i]='';
|
268 |
+
}
|
269 |
+
}
|
270 |
+
if (comm % 2 === 0 && c!='"') {
|
271 |
+
str[i]=str[i]+c;
|
272 |
+
}
|
273 |
+
});
|
274 |
+
pickup_array={};
|
275 |
+
jQuery.each(str, function (k, v) {
|
276 |
+
|
277 |
+
if (k % 2 != 0 ) {
|
278 |
+
pickup_array[str[k-1]] =v;
|
279 |
+
}
|
280 |
+
});
|
281 |
+
pickup_html="<br>"+pickup_array['company']+"<br>"+pickup_array['street']+"<br>"+pickup_array['zipcode']+" "+pickup_array['city']+"<br>Pickup point id: "+pickup_array['pick_up_id'];
|
282 |
+
jQuery("select[name='"+pickupresult[0]+"']").val(pickupresult[1]).change();
|
283 |
+
jQuery('.pickup .value').html(pickup_html);
|
284 |
+
jQuery('.pickup').show();
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
</script>
|
290 |
+
|
291 |
+
<?php } ?>
|
292 |
+
|
293 |
+
<a href="#" onclick="$('order-shipping-method-info').hide();
|
294 |
+
$('order-shipping-method-choose').show();
|
295 |
+
return false">
|
296 |
+
<?php echo Mage::helper('sales')->__('Click to change shipping method') ?>
|
297 |
+
</a>
|
298 |
+
</div>
|
299 |
+
<?php else: ?>
|
300 |
+
<script type="text/javascript">$('order-shipping-method-choose').show();</script>
|
301 |
+
<?php endif; ?>
|
302 |
+
<?php elseif ($this->getIsRateRequest()): ?>
|
303 |
+
<strong><?php echo Mage::helper('sales')->__('Sorry, no quotes are available for this order at this time.') ?></strong>
|
304 |
+
<?php else: ?>
|
305 |
+
<div id="order-shipping-method-summary">
|
306 |
+
<a href="#" onclick="order.loadShippingRates();
|
307 |
+
return false">
|
308 |
+
<?php echo Mage::helper('sales')->__('Get shipping methods and rates') ?>
|
309 |
+
</a>
|
310 |
+
<input type="hidden" name="order[has_shipping]" value="" class="required-entry" />
|
311 |
+
</div>
|
312 |
+
<?php endif; ?>
|
313 |
+
<div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div>
|
314 |
+
<script type="text/javascript">
|
315 |
+
order.overlay('shipping-method-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
|
316 |
+
order.overlay('address-shipping-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
|
317 |
+
</script>
|
318 |
+
|
319 |
+
|
320 |
+
|
app/design/frontend/base/default/template/logistics/.DS_Store
CHANGED
Binary file
|
app/design/frontend/base/default/template/logistics/checkout/.DS_Store
CHANGED
Binary file
|
app/design/frontend/base/default/template/logistics/checkout/onepage/.DS_Store
CHANGED
Binary file
|
app/design/frontend/base/default/template/logistics/magestoreOnestepcheckout/shipping_method.phtml
CHANGED
@@ -121,9 +121,8 @@ if (!($_shippingRateGroups = $this->getShippingRates())):
|
|
121 |
<li class="radioparent">
|
122 |
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?> <!-- get method title and the code -->
|
123 |
|
124 |
-
<input name="shipping_method" type="radio" class=" radio validate-one-required-by-name" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo ' checked="checked"' ?> onclick="save_shipping_method(shipping_method_url, update_shipping_payment, update_shipping_review);
|
125 |
-
|
126 |
-
<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo '<script type="text/javascript"> showShipping("' . $_rate->getCode() . '","s_method_' . $_rate->getCode() . '" );</script>;' ?>
|
127 |
<span class="outer"><span class="inner"></span></span>
|
128 |
<?php
|
129 |
$shipping_method = $_rate->getCode();
|
121 |
<li class="radioparent">
|
122 |
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?> <!-- get method title and the code -->
|
123 |
|
124 |
+
<input name="shipping_method" type="radio" class=" radio validate-one-required-by-name" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo ' checked="checked"'; ?> onclick="save_shipping_method(shipping_method_url, update_shipping_payment, update_shipping_review); showShipping('<?php echo $_rate->getCode(); ?>', 's_method_<?php echo $_rate->getCode() ?>');" />
|
125 |
+
<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo '<script type="text/javascript"> showShipping("' . $_rate->getCode() . '","s_method_' . $_rate->getCode() . '" );</script>' ?>
|
|
|
126 |
<span class="outer"><span class="inner"></span></span>
|
127 |
<?php
|
128 |
$shipping_method = $_rate->getCode();
|
app/design/frontend/base/default/template/logistics/pickup.phtml
CHANGED
@@ -58,9 +58,9 @@ if ($method == 'pickup') { //if shipping method is pickup then the pick
|
|
58 |
<?php
|
59 |
} else { //displaying pickup data
|
60 |
?>
|
61 |
-
|
62 |
<span class="input-box">
|
63 |
-
<select class="required-entry" name="shipping_pickup[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
64 |
<option value=''><?php echo $this->__('Select a pick-up point'); ?></option>
|
65 |
<?php
|
66 |
foreach ($result as $key => $value) {
|
@@ -101,20 +101,14 @@ if ($carrier[0] == 'smartsendpostdanmark' || $carrier[0] == 'smartsendposten') {
|
|
101 |
if (count($result) > 0 || $result == true) {
|
102 |
//displaying flex data
|
103 |
?>
|
104 |
-
|
105 |
<span class="input-box">
|
106 |
-
<select class="required-entry" name="shipping_flex[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
107 |
<option value=''><?php echo $this->__('Select a flexdelivery option'); ?></option>
|
108 |
<?php
|
109 |
foreach ($result as $key => $value) {
|
110 |
-
$s = '';
|
111 |
-
if ($value == 'zip_code') {
|
112 |
-
$s .= $value . " ";
|
113 |
-
} else {
|
114 |
-
$s .= $value . ", ";
|
115 |
-
}
|
116 |
?>
|
117 |
-
<option value='<?php echo $key ?>'><?php echo
|
118 |
<?php
|
119 |
}
|
120 |
?>
|
58 |
<?php
|
59 |
} else { //displaying pickup data
|
60 |
?>
|
61 |
+
<!--<label for="<?php echo $_code ?>_store" class="required"><em>*</em><?php echo $this->__('Select a pick-up point').':'; ?></label>-->
|
62 |
<span class="input-box">
|
63 |
+
<select class="required-entry" style="width:90%" name="shipping_pickup[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
64 |
<option value=''><?php echo $this->__('Select a pick-up point'); ?></option>
|
65 |
<?php
|
66 |
foreach ($result as $key => $value) {
|
101 |
if (count($result) > 0 || $result == true) {
|
102 |
//displaying flex data
|
103 |
?>
|
104 |
+
<!--<label for="<?php echo $_code ?>_store" class="required"><em>*</em><?php echo $this->__('Select a flexdelivery option').':'; ?></label>-->
|
105 |
<span class="input-box">
|
106 |
+
<select class="required-entry" style="width:90%" name="shipping_flex[store][<?php echo $_rate->getCode() ?>]"> <!-- table rate shipping code -->
|
107 |
<option value=''><?php echo $this->__('Select a flexdelivery option'); ?></option>
|
108 |
<?php
|
109 |
foreach ($result as $key => $value) {
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
?>
|
111 |
+
<option value='<?php echo $key ?>'><?php echo $value ?></option>
|
112 |
<?php
|
113 |
}
|
114 |
?>
|
app/locale/da_DK/Smartsend_Logistics.csv
CHANGED
@@ -81,7 +81,7 @@
|
|
81 |
"DPD Guarantee","DPD Garantipakke"
|
82 |
"Value mail","Varebrev"
|
83 |
"Value mail first class","Varebrev første klasse"
|
84 |
-
"Value mail economy","
|
85 |
"Maxi mail","Stort brev"
|
86 |
"Commercial Bulksplit","Erhverv Bulksplit"
|
87 |
"Private Bulksplit","Privatpakke uden omdeling Bulksplit"
|
@@ -142,9 +142,14 @@
|
|
142 |
"Flexdelivery","Flexlevering"
|
143 |
"Flexdelivery note","Flexleveringsnote"
|
144 |
"Flexdelivery instruction not available","Flexleveringsinstruktion ikke valgt"
|
145 |
-
"By the
|
146 |
-
"By the
|
147 |
-
"
|
148 |
-
"
|
|
|
|
|
|
|
|
|
149 |
"Can be left unattended","Må stilles et andet sted"
|
|
|
150 |
"Debug","Fejlfinding"
|
81 |
"DPD Guarantee","DPD Garantipakke"
|
82 |
"Value mail","Varebrev"
|
83 |
"Value mail first class","Varebrev første klasse"
|
84 |
+
"Value mail economy","Varebrev økonomi"
|
85 |
"Maxi mail","Stort brev"
|
86 |
"Commercial Bulksplit","Erhverv Bulksplit"
|
87 |
"Private Bulksplit","Privatpakke uden omdeling Bulksplit"
|
142 |
"Flexdelivery","Flexlevering"
|
143 |
"Flexdelivery note","Flexleveringsnote"
|
144 |
"Flexdelivery instruction not available","Flexleveringsinstruktion ikke valgt"
|
145 |
+
"By the front door","Foran hoveddøren"
|
146 |
+
"By the back door","Ved bagdøren"
|
147 |
+
"One the porch","På terrassen"
|
148 |
+
"In the greenhouse","I drivhuset"
|
149 |
+
"In the garage/carport","I garagen/carporten"
|
150 |
+
"In the tool shed","I skuret/værkstedet"
|
151 |
+
"In the playhouse","I legehuset"
|
152 |
+
"Under the roof of the porch","Under halvtaget"
|
153 |
"Can be left unattended","Må stilles et andet sted"
|
154 |
+
"I have Modtagerflex","Jeg har Modtagerflex"
|
155 |
"Debug","Fejlfinding"
|
js/logistics/jquery.session.js
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(jQuery){
|
2 |
+
|
3 |
+
jQuery.session = {
|
4 |
+
|
5 |
+
_id: null,
|
6 |
+
|
7 |
+
_cookieCache: undefined,
|
8 |
+
|
9 |
+
_init: function()
|
10 |
+
{
|
11 |
+
if (!window.name) {
|
12 |
+
window.name = Math.random();
|
13 |
+
}
|
14 |
+
this._id = window.name;
|
15 |
+
this._initCache();
|
16 |
+
|
17 |
+
// See if we've changed protcols
|
18 |
+
|
19 |
+
var matches = (new RegExp(this._generatePrefix() + "=([^;]+);")).exec(document.cookie);
|
20 |
+
if (matches && document.location.protocol !== matches[1]) {
|
21 |
+
this._clearSession();
|
22 |
+
for (var key in this._cookieCache) {
|
23 |
+
try {
|
24 |
+
window.sessionStorage.setItem(key, this._cookieCache[key]);
|
25 |
+
} catch (e) {};
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
document.cookie = this._generatePrefix() + "=" + document.location.protocol + ';path=/;expires=' + (new Date((new Date).getTime() + 120000)).toUTCString();
|
30 |
+
|
31 |
+
},
|
32 |
+
|
33 |
+
_generatePrefix: function()
|
34 |
+
{
|
35 |
+
return '__session:' + this._id + ':';
|
36 |
+
},
|
37 |
+
|
38 |
+
_initCache: function()
|
39 |
+
{
|
40 |
+
var cookies = document.cookie.split(';');
|
41 |
+
this._cookieCache = {};
|
42 |
+
for (var i in cookies) {
|
43 |
+
var kv = cookies[i].split('=');
|
44 |
+
if ((new RegExp(this._generatePrefix() + '.+')).test(kv[0]) && kv[1]) {
|
45 |
+
this._cookieCache[kv[0].split(':', 3)[2]] = kv[1];
|
46 |
+
}
|
47 |
+
}
|
48 |
+
},
|
49 |
+
|
50 |
+
_setFallback: function(key, value, onceOnly)
|
51 |
+
{
|
52 |
+
var cookie = this._generatePrefix() + key + "=" + value + "; path=/";
|
53 |
+
if (onceOnly) {
|
54 |
+
cookie += "; expires=" + (new Date(Date.now() + 120000)).toUTCString();
|
55 |
+
}
|
56 |
+
document.cookie = cookie;
|
57 |
+
this._cookieCache[key] = value;
|
58 |
+
return this;
|
59 |
+
},
|
60 |
+
|
61 |
+
_getFallback: function(key)
|
62 |
+
{
|
63 |
+
if (!this._cookieCache) {
|
64 |
+
this._initCache();
|
65 |
+
}
|
66 |
+
return this._cookieCache[key];
|
67 |
+
},
|
68 |
+
|
69 |
+
_clearFallback: function()
|
70 |
+
{
|
71 |
+
for (var i in this._cookieCache) {
|
72 |
+
document.cookie = this._generatePrefix() + i + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
73 |
+
}
|
74 |
+
this._cookieCache = {};
|
75 |
+
},
|
76 |
+
|
77 |
+
_deleteFallback: function(key)
|
78 |
+
{
|
79 |
+
document.cookie = this._generatePrefix() + key + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
80 |
+
delete this._cookieCache[key];
|
81 |
+
},
|
82 |
+
|
83 |
+
get: function(key)
|
84 |
+
{
|
85 |
+
return window.sessionStorage.getItem(key) || this._getFallback(key);
|
86 |
+
},
|
87 |
+
|
88 |
+
set: function(key, value, onceOnly)
|
89 |
+
{
|
90 |
+
try {
|
91 |
+
window.sessionStorage.setItem(key, value);
|
92 |
+
} catch (e) {}
|
93 |
+
this._setFallback(key, value, onceOnly || false);
|
94 |
+
return this;
|
95 |
+
},
|
96 |
+
|
97 |
+
'delete': function(key){
|
98 |
+
return this.remove(key);
|
99 |
+
},
|
100 |
+
|
101 |
+
remove: function(key)
|
102 |
+
{
|
103 |
+
try {
|
104 |
+
window.sessionStorage.removeItem(key);
|
105 |
+
} catch (e) {};
|
106 |
+
this._deleteFallback(key);
|
107 |
+
return this;
|
108 |
+
},
|
109 |
+
|
110 |
+
_clearSession: function()
|
111 |
+
{
|
112 |
+
try {
|
113 |
+
window.sessionStorage.clear();
|
114 |
+
} catch (e) {
|
115 |
+
for (var i in window.sessionStorage) {
|
116 |
+
window.sessionStorage.removeItem(i);
|
117 |
+
}
|
118 |
+
}
|
119 |
+
},
|
120 |
+
|
121 |
+
clear: function()
|
122 |
+
{
|
123 |
+
this._clearSession();
|
124 |
+
this._clearFallback();
|
125 |
+
return this;
|
126 |
+
}
|
127 |
+
|
128 |
+
};
|
129 |
+
|
130 |
+
jQuery.session._init();
|
131 |
+
|
132 |
+
})(jQuery);
|
package.xml
CHANGED
@@ -1,72 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Smartsend_Logistics</name>
|
4 |
-
<version>7.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
* GLS (YourGLS)
|
15 |
-
* Bring (MyBring)
|
16 |
-
* Post Danmark (Pacsoft)
|
17 |
-
* Posten (Pacsoft)
|
18 |
-
* Post Nord (Pacsoft)
|
19 |
-

|
20 |
-
Supports worldwide shipping from these countries:
|
21 |
-

|
22 |
-
* Denmark
|
23 |
-
* Sweden
|
24 |
-
* Finland
|
25 |
-
* Norway
|
26 |
-

|
27 |
-
= Table rates =
|
28 |
-
Table rate settings enables multiple shipping methods to be easily configured in one table. Determine the shipping price for each method based on multiple condition.
|
29 |
-

|
30 |
-
Calculate shipping rate based on:
|
31 |
-

|
32 |
-
* Shipping address
|
33 |
-
* Order weight
|
34 |
-
* Order subtotal
|
35 |
-
* Shipping class
|
36 |
-

|
37 |
-
= Services =
|
38 |
-
Enable services for shipping methods:
|
39 |
-

|
40 |
-
* Customer notification by email
|
41 |
-
* Customer notification by SMS
|
42 |
-
* Pickup point (collect the parcel at a shop near the customer)
|
43 |
-
* Flex delivery (leave parcel at specified location)
|
44 |
-
* Home delivery
|
45 |
-
* Handling of special good, eg food
|
46 |
-
* TAX handling
|
47 |
-
* Enable free delivery based on condition
|
48 |
-

|
49 |
-
= Pickup point =
|
50 |
-
Let the customer choose a close by pickup point during checkout. The package will be delivered to that pickup point. The customer can collect the package at selected pickup point at convenience.
|
51 |
-

|
52 |
-
* Nearest pickup points based on customer address
|
53 |
-
* Automatically updated list
|
54 |
-
* User friendly dropdown list
|
55 |
-
* One step/page checkout compatible
|
56 |
-

|
57 |
-
= Shipping labels =
|
58 |
-
Create shipping labels directly from the backend by a single click. The information is automatically formatted and send to the carrier for processing. A PDF label is immediately shown and ready to print. Tracking information is automatically saved in the system and can be included in customer emails or can be sendt by text message.
|
59 |
-

|
60 |
-
Easily create:
|
61 |
-

|
62 |
-
* Shipping labels as PDF files
|
63 |
-
* Return shipping labels
|
64 |
-
* Tracking information</description>
|
65 |
-
<notes>Latest stable release</notes>
|
66 |
<authors><author><name>Smart Send ApS</name><user>SmartSendDK</user><email>anders@smartsend.dk</email></author></authors>
|
67 |
-
<date>2016-
|
68 |
-
<time>16:
|
69 |
-
<contents><target name="magecommunity"><dir name="Smartsend"><dir name="Logistics"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="1e5269928626d3817b62cd4f382ac47a"/></dir
|
70 |
<compatible/>
|
71 |
-
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>
|
72 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Smartsend_Logistics</name>
|
4 |
+
<version>7.1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Advanced table rate shipping module with flexible conditions determining the rate and pick-up point during checkout.</summary>
|
10 |
+
<description>Advanced table rate shipping methods with flexible conditions determining the rate and even let the customer chose a pick-up point during checkout. Integrates the shipping methods directly with carrier systems and create PDF labels directly from the backend.</description>
|
11 |
+
<notes>Adding support for vConnect.
|
12 |
+
Fixing problem with unshipped items.
|
13 |
+
Fixing problems when no quote was yet created.</notes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
<authors><author><name>Smart Send ApS</name><user>SmartSendDK</user><email>anders@smartsend.dk</email></author></authors>
|
15 |
+
<date>2016-08-13</date>
|
16 |
+
<time>16:00:31</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Smartsend"><dir name="Logistics"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="1e5269928626d3817b62cd4f382ac47a"/></dir><file name=".DS_Store" hash="a8024b86a2a6db24778a3da06b907bb8"/></dir><file name=".DS_Store" hash="db8663527ef5b94baa488e6056d35583"/></dir><file name=".DS_Store" hash="b19a555b34effebfe57bd7c15c0c8862"/></dir><file name="Shipping.php" hash="6713003ed07238480a8c557a6571d4ec"/><dir name="System"><dir name="Config"><file name="Excludetax.php" hash="cf6ee2a8f49bca55781ec9f9372b065b"/></dir><file name=".DS_Store" hash="a4d594a19cdea83c0103f6c635cc5a0a"/></dir><file name=".DS_Store" hash="8bbb92bd2cfd28df977802de06072e04"/></dir><file name="Bring.php" hash="552368784d2ab08740b6ccae1aeac710"/><file name="Gls.php" hash="5d73876aeffcbf9ea74b97500bf5547d"/><file name="Postdanmark.php" hash="62fce9866e4ccc165b104bd9e6b4c169"/><file name="Posten.php" hash="6179e6778be6157d46d30feca6c29d66"/><file name=".DS_Store" hash="39abb3416520deef5fc7dde1ef51ad8a"/></dir><dir name="Helper"><file name="Data.php" hash="2a7ebc0b1cc73dbfa20179294a4db144"/></dir><dir name="Model"><dir name="Api"><file name="Pickups.php" hash="1728e9b8d75963ff20000bfc543b1eab"/><file name="Validation.php" hash="1b79d70115a27dc6ea60513a8b63b6e2"/></dir><file name="Bring.php" hash="d085d49eb215752102ab74926a0d5c79"/><dir name="Carrier"><file name="Bring.php" hash="77ed23574ecab8ce681b70464a767836"/><file name="Gls.php" hash="c1ea91a8dfd267f3935dbd758daa6e07"/><file name="Postdanmark.php" hash="001379f18cfa1d56707bc079e62b3d8b"/><file name="Posten.php" hash="e91c9cd9b9dcb83674ff0b5fc93b7f0a"/></dir><file name="Flex.php" hash="387ef50380f86a4f5b81384cfd63e5d7"/><file name="Gls.php" hash="a40e74472e611bbd955c752f97d9769c"/><file name="Label.php" hash="b47c7fd9f087b79243228da630f37147"/><file name="Labelmagento.php" hash="63d1b7ae9e7404c2ca9ba7797561cb26"/><dir name="Mysql4"><dir name="Bring"><file name="Collection.php" hash="fbab7b8475845cd8c724f81f8da318cd"/></dir><file name="Bring.php" hash="2761ca69301f65d7c50dab039f832489"/><dir name="Flex"><file name="Collection.php" hash="b753243d0e12e93075d85b839bdf0cf3"/></dir><file name="Flex.php" hash="4ac593e8fa8be6a7d7cb26a325c01806"/><dir name="Gls"><file name="Collection.php" hash="ff85ba1838f20c88909cac240d484e90"/></dir><file name="Gls.php" hash="c6c4d58ebf7bde0fd13d010efc34771a"/><dir name="Pickup"><file name="Collection.php" hash="51b13cbc4eba93b1a4f97e15c403738b"/></dir><file name="Pickup.php" hash="a227429c1b4e405e96b42ca48a8f83fd"/><dir name="Postdanmark"><file name="Collection.php" hash="340ad97e9348c794b6c5af36c063c716"/></dir><file name="Postdanmark.php" hash="0eb4991832f7a7915e4b683aec0dd5bf"/><dir name="Posten"><file name="Collection.php" hash="0ce6dbb1ce831f71c53d924fb7bab360"/></dir><file name="Posten.php" hash="82adc2661f43b5fb1cd7e1cd8a77c367"/></dir><file name="Observer.php" hash="f3841c23f6c12e0c1094e1410daab6b5"/><file name="Order.php" hash="b3664ea3630d850072a363b6ad2a71ce"/><file name="Ordermagento.php" hash="f3d2f54d59ffbf301f079817a2f68f12"/><file name="Postdanmark.php" hash="049fd41acaeb28e3acbe6741fd2c3f1f"/><file name="Posten.php" hash="054949a6cd0f076f78587668e07cd723"/><dir name="Rewrite"><dir name="Sales"><dir name="Total"><dir name="Quote"><file name="Shipping.php" hash="9a5d55e67039ad7ea2d006f3388a7026"/><file name="Tax.php" hash="0a24c3f50a4cea7b5779eb784119c08d"/></dir></dir></dir></dir><file name="ShippingMethods.php" hash="6a05a45a3089eec8cc769b80c79a640f"/><file name="Status.php" hash="1e747a56f6fa5bfdff090d503178363a"/><dir name="System"><file name="CombinePdf.php" hash="8cf30d3e5ae6122d3df1f62e9020dbb3"/><file name="Listformat.php" hash="44dc7ae56508fd0d6cb6f7b6497b6648"/><file name="OrderOption.php" hash="c3dc4faae2f992a419c155ab3dbacc42"/><file name="Pacsoftformat.php" hash="ca53392c16a6cc90fcd2ca96f11d3cd6"/><dir name="Postdanmark"><file name="Flexdelivery.php" hash="39206f9b3449b523f1d8c2cdbe49ad1a"/></dir><dir name="Posten"><file name="Flexdelivery.php" hash="b48d69d668dcb72e7aa1a7e552346953"/></dir><file name="Return.php" hash="fafdb0b8f936dd53cc57304a12b3d63c"/><file name="Status.php" hash="ffc60450fe14ad83045d85819bd35468"/></dir><file name=".DS_Store" hash="2f9c145545e6e164ee760ec2b00d93f6"/></dir><dir name="controllers"><file name="LogisticsController.php" hash="f6e254d63cb831d59b7ae0aa12e027f3"/></dir><dir name="etc"><file name="config.xml" hash="ed25e4d4420de7c520c6ba270d3d9fbf"/><file name="system.xml" hash="20da4d61124c890f770b89d2c481a539"/></dir><dir name="sql"><dir name="logistics_setup"><file name="mysql4-install-7.0.1.php" hash="20adc2e823e38d1f6a8768ca7884cbdb"/><file name="mysql4-upgrade-7.0.5-7.0.6.php" hash="84015d08da1d57e444ab49a94d20ccac"/><file name="mysql4-upgrade-7.0.9-7.1.0.php" hash="900722f3b1da348dc862999d4046e3a9"/></dir></dir><file name=".DS_Store" hash="51bedc559f6bab4d254a8b5a8dd586e2"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="logistics.xml" hash="85fd40f808ff31f1be68263af36cd87a"/></dir><dir name="template"><dir name="logistics"><file name="array_dropdown.phtml" hash="0af2e17b8332f7ce489775c20ab2aad6"/><file name="pickup.phtml" hash="1e40a66722db378ec196f8b8556f433c"/><dir name="sales"><dir name="order"><dir name="create"><dir name="shipping"><dir name="method"><file name="form.phtml" hash="a2f5ca68efcff0cc0056879858b390a3"/></dir></dir></dir><dir name="view"><file name="info.phtml" hash="21c113f17c39865d2dfcb99316c36a60"/><dir name="tab"><file name="info.phtml" hash="bd6f569633cb9db29ea41647b51a7d88"/></dir></dir></dir></dir><dir name="system"><dir name="config"><file name="excludetax.phtml" hash="8e67e3bf0d3817cfc32d718e0435f8e6"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="logistics.xml" hash="9bab67a5d56c65e36b7c823fcc0d97d1"/></dir><dir name="template"><dir name="logistics"><dir name="checkout"><dir name="cart"><file name="shipping.phtml" hash="210de86c632932ebd6cd174aaa966b91"/></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="dbb6bb045fce61dacfb9aa00753c300d"/></dir><file name=".DS_Store" hash="69ddbba7cb8c0d1983dca56b576ad606"/></dir><file name=".DS_Store" hash="3a0b8c30af181f66c3bee373319ea31f"/></dir><dir name="email"><dir name="order"><dir name="shipment"><file name="track.phtml" hash="a6e681503ed9697583fcf8a6bb8a8e1f"/></dir></dir></dir><dir name="magestoreOnestepcheckout"><file name="shipping_method.phtml" hash="d5887a43f8861843680a2677e25e2388"/></dir><dir name="onestepcheckout"><file name="shipping_method.phtml" hash="f863700aaf72e850518bf93fd48493a8"/></dir><file name="pickup.phtml" hash="d80f9aa08018319e9a47feec3313ba99"/><file name=".DS_Store" hash="36886f9febedac16869950fc7491188f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smartsend_Logistics.xml" hash="f54aeead0ec93bc9e7d5150bac2b6907"/></dir></target><target name="magelocale"><dir name="da_DK"><file name="Smartsend_Logistics.csv" hash="c8f3deb76492ee1af61afdd29bf1e663"/><dir name="template"><dir name="email"><file name="smartsend_new_shipment_email.html" hash="1810230f1ac214ed68f396ebbd94bebc"/></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="logistics"><file name="jquery-1.10.2.min.js" hash="841dc30647f93349b7d8ef61deebe411"/><file name="jquery-1.6.4.min.js" hash="9118381924c51c89d9414a311ec9c97f"/><file name="jquery.session.js" hash="64502a24fa0b6875f9f35573d06766fe"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><file name="logistics.js" hash="e0dfee4a43a32d6814f415d83417f6fe"/></dir></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>2.0</max></package><extension><name>curl</name><min>6.0</min><max/></extension></required></dependencies>
|
20 |
</package>
|