ship200_onebyone - Version 1.0.2

Version Notes

Initial Release

Download this release

Release Info

Developer Alex Boone
Extension ship200_onebyone
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/code/local/Ship200/Onebyone/controllers/IndexController.php CHANGED
@@ -43,9 +43,31 @@ class Ship200_Onebyone_IndexController extends Mage_Core_Controller_Front_Action
43
 
44
 
45
  if($_POST['update_tracking'] != "" && $_GET['id'] == $secret_key){
 
 
46
  $order=Mage::getModel("sales/order")->loadByIncrementId($_POST['keyForUpdate']);
47
 
48
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  $order->setData('state', $order_status_tracking);
51
  $order->setStatus($order_status_tracking);
43
 
44
 
45
  if($_POST['update_tracking'] != "" && $_GET['id'] == $secret_key){
46
+
47
+
48
  $order=Mage::getModel("sales/order")->loadByIncrementId($_POST['keyForUpdate']);
49
 
50
+ if($order->canShip()){
51
+
52
+ $arrTracking = array(
53
+ 'carrier_code' => strtolower($_POST['carrier']),
54
+ 'title' => $_POST[service]." - (Ship200 OneByOne)",
55
+ 'number' => $_POST['tracking'],
56
+ );
57
+
58
+ $itemQty = $order->getItemsCollection()->count();
59
+ $shipment = $order->prepareShipment();
60
+ if($shipment){
61
+ $track = Mage::getModel('sales/order_shipment_track')->addData($arrTracking);
62
+ $shipment->addTrack($track);
63
+ $shipment->register();
64
+ $transactionSave = Mage::getModel('core/resource_transaction')
65
+ ->addObject($shipment)
66
+ ->addObject($shipment->getOrder())
67
+ ->save();
68
+ }
69
+
70
+ }
71
 
72
  $order->setData('state', $order_status_tracking);
73
  $order->setStatus($order_status_tracking);
app/code/local/Ship200/Onebyone/etc/config.xml CHANGED
@@ -6,7 +6,7 @@
6
 
7
  <Ship200_Onebyone>
8
 
9
- <version>0.1.0</version>
10
 
11
  </Ship200_Onebyone>
12
 
@@ -110,4 +110,4 @@
110
 
111
 
112
 
113
- </config>
6
 
7
  <Ship200_Onebyone>
8
 
9
+ <version>0.1.2</version>
10
 
11
  </Ship200_Onebyone>
12
 
110
 
111
 
112
 
113
+ </config>
app/code/local/Ship200/Onebyone/sql/onebyone_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $this->startSetup();
3
+ $this->addAttribute('order', 'ship200_tack', array(
4
+ 'type' => 'varchar',
5
+ 'label' => 'Ship200 Tracking Code',
6
+ 'visible' => true,
7
+ 'required' => false,
8
+ 'visible_on_front' => true,
9
+ 'user_defined' => true
10
+ ));
11
+
12
+ $this->endSetup();
13
+ ?>
app/design/adminhtml/default/default/template/onebyone/sales/order/view/tab/info.phtml ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
28
+ <?php $_order = $this->getOrder() ?>
29
+ <div>
30
+ <div id="order-messages">
31
+ <?php echo $this->getChildHtml('order_messages') ?>
32
+ </div>
33
+ <?php echo $this->getChildHtml('order_info') ?>
34
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
35
+ <?php if ($_order->getIsVirtual()): ?>
36
+ <div class="box-right">
37
+ <?php else: ?>
38
+ <div class="box-left">
39
+ <?php endif; ?>
40
+ <!--Payment Method-->
41
+ <div class="entry-edit">
42
+ <div class="entry-edit-head">
43
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
44
+ </div>
45
+ <fieldset>
46
+ <?php echo $this->getPaymentHtml() ?>
47
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
48
+ </fieldset>
49
+ </div>
50
+ </div>
51
+ <?php if (!$_order->getIsVirtual()): ?>
52
+ <div class="box-right">
53
+ <!--Shipping Method-->
54
+ <div class="entry-edit">
55
+ <div class="entry-edit-head">
56
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
57
+ </div>
58
+ <fieldset>
59
+ <?php if ($_order->getTracksCollection()->count()) : ?>
60
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
61
+ <br/>
62
+ <?php endif; ?>
63
+ <?php if ($_order->getShippingDescription()): ?>
64
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
65
+
66
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
67
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
68
+ <?php else: ?>
69
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
70
+ <?php endif; ?>
71
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
72
+
73
+ <?php echo $_excl; ?>
74
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
75
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
76
+ <?php endif; ?>
77
+ <?php else: ?>
78
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
79
+ <?php endif; ?>
80
+ <br />
81
+ <?php if($_order->getShip200Tack()):?>
82
+ <address><?php echo $_order->getShip200Tack();?></address>
83
+ <?php endif; ?>
84
+ </fieldset>
85
+ </div>
86
+ </div>
87
+ <?php endif; ?>
88
+ <div class="clear"></div>
89
+ <?php echo $this->getGiftOptionsHtml() ?>
90
+ <div class="clear"></div>
91
+ <div class="entry-edit">
92
+ <div class="entry-edit-head">
93
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
94
+ </div>
95
+ </div>
96
+ <?php echo $this->getItemsHtml() ?>
97
+ <div class="clear"></div>
98
+
99
+ <div class="box-left">
100
+ <div class="entry-edit">
101
+ <div class="entry-edit-head">
102
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
103
+ </div>
104
+ <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
105
+ </div>
106
+ </div>
107
+ <div class="box-right entry-edit">
108
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
109
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
110
+ </div>
111
+ <div class="clear"></div>
112
+ </div>
113
+
114
+ <?php echo $this->getChildHtml('popup_window');?>
115
+ <script type="text/javascript">
116
+ //<![CDATA[
117
+ /**
118
+ * Retrieve gift options tooltip content
119
+ */
120
+ function getGiftOptionsTooltipContent(itemId) {
121
+ var contentLines = [];
122
+ var headerLine = null;
123
+ var contentLine = null;
124
+
125
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
126
+ if (element.down(0)) {
127
+ headerLine = element.down(0).innerHTML;
128
+ contentLine = element.down(0).next().innerHTML;
129
+ if (contentLine.length > 30) {
130
+ contentLine = contentLine.slice(0,30) + '...';
131
+ }
132
+ contentLines.push(headerLine + ' ' + contentLine);
133
+ }
134
+ });
135
+ return contentLines.join('<br/>');
136
+ }
137
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
138
+ //]]>
139
+ </script>
package.xml CHANGED
@@ -1,25 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ship200_onebyone</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software</summary>
10
- <description>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software which allows you to print shipping labels in bulk or individually and integrate process of creating labels directly into you Magento.&#xD;
11
- &lt;br /&gt;&lt;br /&gt;&#xD;
12
- This Plugin connects your Magento store to Ship200, and adds the ability to download new orders to Ship200 for creating shipping labels in bulk.&#xD;
13
- &lt;br /&gt;&lt;br /&gt;&#xD;
14
- Demo:&#xD;
15
- &lt;a href="https://www.youtube.com/watch?v=rZdC1f1WIxU"&gt;https://www.youtube.com/watch?v=rZdC1f1WIxU&lt;/a&gt;&#xD;
16
- &lt;br /&gt;&lt;br /&gt;&#xD;
17
- Visit Us at &lt;a href="http://www.Ship200.com"&gt;www.Ship200.com&lt;/a&gt;</description>
18
- <notes>nothing</notes>
19
- <authors><author><name>Ship200</name><user>Ship200</user><email>bell@ship200.com</email></author></authors>
20
- <date>2014-08-07</date>
21
- <time>05:47:40</time>
22
- <contents><target name="magelocal"><dir name="Ship200"><dir name="Onebyone"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="9e493ba3a3351061af3c655d9b09bab2"/></dir></dir><file name="Ship200.php" hash="c43d15e9f75a7fdfc163c8314e9646a6"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="1f325984c1daa1704e1e8529f6af8fd5"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="684696810527e63cab3f4dd0b0e0f042"/></dir><dir name="Model"><dir name="Source"><file name="Carrier.php" hash="cee4a17e17bdfa176ebcf090b0645e51"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="Ship200Controller.php" hash="c0570021dacf790f74514a55a82fc960"/></dir><file name="IndexController.php" hash="ffd395045f492d1d89bb913273d042b4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f3ca9a4f15afc39ce63aa4478c88bfcf"/><file name="config.xml" hash="6376c4f5758f645a7175f8e1a30beda9"/><file name="system.xml" hash="b09f4850717c6ba6337459ac9b238c4f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Ship200_onebyone.xml" hash="958bafb8d90b63cf2d8c783a0eadc7d5"/></dir><dir name="template"><dir name="onebyone"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="f50ef6fde79f7288ca7e645bb22c6fe6"/></dir></dir></dir><file name="ship200.phtml" hash="0a12ec3e50b74ebe1fbacfc452a698df"/><dir name="system"><dir name="config"><file name="button.phtml" hash="de35b412e052ce2c082212dde277e79c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ship200_Onebyone.xml" hash="c66ea49dc8acfcc0ed30a3348c7c29f7"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
25
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ship200_onebyone</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software</summary>
10
+ <description>Ship200 is Multi Carrier (Fedex, UPS, USPS) Shipping Software which allows you to print shipping labels in bulk or individually and integrate process of creating labels directly into you Magento. &#xD;
11
+ &#xD;
12
+ This Plugin adds "Create Shipping Label" and "Make Return Label" to order detail page. </description>
13
+ <notes>Initial Release</notes>
14
+ <authors><author><name>Ship200</name><user>Alex</user><email>support@ship200.com</email></author></authors>
15
+ <date>2015-03-23</date>
16
+ <time>19:32:37</time>
17
+ <contents><target name="magelocal"><dir name="Ship200"><dir name="Onebyone"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="View.php" hash="9e493ba3a3351061af3c655d9b09bab2"/></dir></dir><file name="Ship200.php" hash="c43d15e9f75a7fdfc163c8314e9646a6"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="1f325984c1daa1704e1e8529f6af8fd5"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="684696810527e63cab3f4dd0b0e0f042"/></dir><dir name="Model"><dir name="Source"><file name="Carrier.php" hash="cee4a17e17bdfa176ebcf090b0645e51"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="Ship200Controller.php" hash="c0570021dacf790f74514a55a82fc960"/></dir><file name="IndexController.php" hash="12846fd718f8e61f41b94041c454f55c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f3ca9a4f15afc39ce63aa4478c88bfcf"/><file name="config.xml" hash="bad61bb65a75e699364ded5258df0ddd"/><file name="system.xml" hash="b09f4850717c6ba6337459ac9b238c4f"/></dir><dir name="sql"><dir name="onebyone_setup"><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="46662fec5ded7452fb9c206d17a724b5"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="Ship200_onebyone.xml" hash="958bafb8d90b63cf2d8c783a0eadc7d5"/></dir><dir name="template"><dir name="onebyone"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="f50ef6fde79f7288ca7e645bb22c6fe6"/><dir name="tab"><file name="info.phtml" hash="f8aea0bff59cbf606a6846c11f2e8556"/></dir></dir></dir></dir><file name="ship200.phtml" hash="0a12ec3e50b74ebe1fbacfc452a698df"/><dir name="system"><dir name="config"><file name="button.phtml" hash="de35b412e052ce2c082212dde277e79c"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ship200_Onebyone.xml" hash="c66ea49dc8acfcc0ed30a3348c7c29f7"/></dir></target></contents>
 
 
 
 
 
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>