From 347f716d0fa1fa4e4912d122b45e75b97645e0aa Mon Sep 17 00:00:00 2001 From: reindertvetter Date: Fri, 12 Aug 2016 14:52:03 +0200 Subject: [PATCH 1/2] show barcode if status is't set --- .../Grid/Column/Renderer/ShippingStatus.php | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/app/code/community/TIG/MyParcel2014/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingStatus.php b/app/code/community/TIG/MyParcel2014/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingStatus.php index 7326a758..7cb1dbf5 100644 --- a/app/code/community/TIG/MyParcel2014/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingStatus.php +++ b/app/code/community/TIG/MyParcel2014/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingStatus.php @@ -75,10 +75,13 @@ public function render(Varien_Object $row) * Check if any data is available. * If not available, show send link and country code */ - $value = $row->getData($this->getColumn()->getIndex()); $order = Mage::getModel('sales/order')->load($row->getId()); + $value = $row->getData($this->getColumn()->getIndex()); + $barcodes = explode(',', $row->getData(self::BARCODE_COLUMN)); + $barcodeData = array(); + $statusses = explode(',', $value); - if (!$value) { + if (empty($barcodes[0])) { if($order->canShip()) { $orderSendUrl = Mage::helper('adminhtml')->getUrl("adminhtml/sales_order_shipment/start", array('order_id' => $row->getId())); @@ -100,16 +103,16 @@ public function render(Varien_Object $row) 'postcode' => $postcode, ); - $barcodeData = array(); - $barcodes = explode(',', $row->getData(self::BARCODE_COLUMN)); - $statusses = explode(',', $value); - foreach ($statusses as $key => $status) { - if (!empty($barcodes[$key])) { - $barcodeUrl = Mage::helper('tig_myparcel')->getBarcodeUrl($barcodes[$key], $destinationData, false, true); - $oneBarcodeData = "{$barcodes[$key]} - {$status}"; - if(!in_array($oneBarcodeData, $barcodeData)) { - $barcodeData[] = $oneBarcodeData; - } + foreach ($barcodes as $key => $barcode) { + if (!empty($statusses[$key])) { + $status = " - {$statusses[$key]}"; + } else { + $status = ''; + } + $barcodeUrl = Mage::helper('tig_myparcel')->getBarcodeUrl($barcode, $destinationData, false, true); + $oneBarcodeData = "{$barcode}$status"; + if(!in_array($oneBarcodeData, $barcodeData)) { + $barcodeData[] = $oneBarcodeData; } } From f9163f023f772119edb754bdd9d69b96a3acef31 Mon Sep 17 00:00:00 2001 From: reindertvetter Date: Fri, 12 Aug 2016 14:54:17 +0200 Subject: [PATCH 2/2] 1.5.9 --- app/code/community/TIG/MyParcel2014/etc/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/TIG/MyParcel2014/etc/config.xml b/app/code/community/TIG/MyParcel2014/etc/config.xml index 1451ef53..98305f40 100644 --- a/app/code/community/TIG/MyParcel2014/etc/config.xml +++ b/app/code/community/TIG/MyParcel2014/etc/config.xml @@ -2,7 +2,7 @@ - 1.5.8 + 1.5.9