Version Notes
Removing all the licensing requirements.
Download this release
Release Info
Developer | Arron Moss |
Extension | Zero1_Customshipprice |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/community/Zero1/Customshipprice/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zero1_Customshipprice>
|
5 |
-
<version>1.0.
|
6 |
</Zero1_Customshipprice>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zero1_Customshipprice>
|
5 |
+
<version>1.0.1</version>
|
6 |
</Zero1_Customshipprice>
|
7 |
</modules>
|
8 |
|
app/design/adminhtml/default/default/layout/customshipprice.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<adminhtml_sales_order_create_index>
|
4 |
+
<reference name="shipping_method">
|
5 |
+
<block type="adminhtml/sales_order_create_shipping_method_form" template="zero1/customshipprice/price.phtml" name="form" />
|
6 |
+
</reference>
|
7 |
+
</adminhtml_sales_order_create_index>
|
8 |
+
<adminhtml_sales_order_create_load_block_data>
|
9 |
+
<reference name="shipping_method">
|
10 |
+
<block type="adminhtml/sales_order_create_shipping_method_form" template="zero1/customshipprice/price.phtml" name="form" />
|
11 |
+
</reference>
|
12 |
+
</adminhtml_sales_order_create_load_block_data>
|
13 |
+
<adminhtml_sales_order_create_load_block_shipping_method>
|
14 |
+
<reference name="shipping_method">
|
15 |
+
<block type="adminhtml/sales_order_create_shipping_method_form" template="zero1/customshipprice/price.phtml" name="form" />
|
16 |
+
</reference>
|
17 |
+
</adminhtml_sales_order_create_load_block_shipping_method>
|
18 |
+
</layout>
|
app/design/adminhtml/default/default/template/zero1/customshipprice/price.phtml
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$this->setCustomShippingPrice(Mage::getSingleton('core/session')->getCustomshippriceAmount());
|
3 |
+
$this->setCustomTitle(Mage::getSingleton('core/session')->getCustomshippriceDescription());
|
4 |
+
?>
|
5 |
+
<?php if($_shippingRateGroups = $this->getShippingRates()): ?>
|
6 |
+
<div id="order-shipping-method-choose" style="display:none">
|
7 |
+
<dl class="shipment-methods">
|
8 |
+
<?php foreach ($_shippingRateGroups as $code => $_rates): ?>
|
9 |
+
<?php if ($code == 'customshipprice'): ?>
|
10 |
+
<dt><strong><?php echo $this->getCarrierName($code) ?></strong></dt>
|
11 |
+
<dd style="margin-top:1em">
|
12 |
+
<ul>
|
13 |
+
<?php foreach ($_rates as $_rate): ?>
|
14 |
+
<?php $_code=$_rate->getCode() ?>
|
15 |
+
<li>
|
16 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
17 |
+
<ul class="messages">
|
18 |
+
<li class="error-msg"><?php echo $_rate->getErrorMessage() ?></li>
|
19 |
+
</ul>
|
20 |
+
<?php else: ?>
|
21 |
+
<label class="normal" for="s_method_<?php echo $_code ?>">
|
22 |
+
<p> <strong><?php echo $this->__('Rate:'); ?></strong> <input id="custom-shipping-rate" type="text" style="width: 175px;" value="<?php if ($this->getCustomShippingPrice()): echo sprintf("%.2f", $this->getCustomShippingPrice()); endif; ?>" /></p>
|
23 |
+
<p> <strong><?php echo $this->__('Title:'); ?></strong> <input id="custom-shipping-title" type="text" style="width: 175px;" value="<?php echo $this->getCustomTitle() ?>" /> <button id="custom-shipping-button" type="button" class="scalable " onclick="order.setCustomShippingValues(document.getElementById('custom-shipping-rate').value,document.getElementById('custom-shipping-title').value,'customshipprice_customshipprice');return false"><span><?php echo $this->__('Save'); ?></span></button></p>
|
24 |
+
</label>
|
25 |
+
<?php endif; ?>
|
26 |
+
</li>
|
27 |
+
<?php endforeach; ?>
|
28 |
+
</ul>
|
29 |
+
<ul class="messages">
|
30 |
+
<li class="notice-msg"><?php echo $this->__('Note: This will override any other shipping method selected.'); ?></li>
|
31 |
+
</ul>
|
32 |
+
<script type="text/javascript">
|
33 |
+
//<![CDATA[
|
34 |
+
AdminOrder.addMethods({
|
35 |
+
setCustomShippingValues : function(amount, description, method){
|
36 |
+
var data = {};
|
37 |
+
data['order[shipping_method]'] = method;
|
38 |
+
data['order[shipping_amount]'] = amount;
|
39 |
+
data['order[base_shipping_amount]'] = amount;
|
40 |
+
data['order[shipping_description]'] = description;
|
41 |
+
data['collect_shipping_rates'] = 1;
|
42 |
+
this.loadArea(['shipping_method', 'totals', 'billing_method'], true, data);
|
43 |
+
},
|
44 |
+
|
45 |
+
submit : function()
|
46 |
+
{
|
47 |
+
if (this.orderItemChanged) {
|
48 |
+
if (confirm('You have item changes')) {
|
49 |
+
if (editForm.submit()) {
|
50 |
+
disableElements('save');
|
51 |
+
}
|
52 |
+
} else {
|
53 |
+
this.itemsUpdate();
|
54 |
+
}
|
55 |
+
} else {
|
56 |
+
if (editForm.submit()) {
|
57 |
+
disableElements('save');
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
});
|
62 |
+
//]]>
|
63 |
+
</script>
|
64 |
+
</dd>
|
65 |
+
<?php else: ?>
|
66 |
+
<dt><strong><?php echo $this->getCarrierName($code) ?></strong></dt>
|
67 |
+
<dd>
|
68 |
+
<ul>
|
69 |
+
<?php foreach ($_rates as $_rate): ?>
|
70 |
+
<?php $_radioProperty = 'name="order[shipping_method]" type="radio" onclick="order.setShippingMethod(this.value)"' ?>
|
71 |
+
<?php $_code=$_rate->getCode() ?>
|
72 |
+
<li>
|
73 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
74 |
+
<ul class="messages">
|
75 |
+
<li class="error-msg"><?php echo $_rate->getErrorMessage() ?></li>
|
76 |
+
</ul>
|
77 |
+
<?php else: ?>
|
78 |
+
<?php $_checked = $this->isMethodActive($_code) ? 'checked="checked"' : '' ?>
|
79 |
+
<input <?php echo $_radioProperty ?> value="<?php echo $_code ?>" id="s_method_<?php echo $_code ?>" <?php echo $_checked ?>/>
|
80 |
+
<label class="normal" for="s_method_<?php echo $_code ?>">
|
81 |
+
<?php echo $_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()?> -
|
82 |
+
<strong>
|
83 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
84 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
85 |
+
|
86 |
+
<?php echo $_excl; ?>
|
87 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
88 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
89 |
+
<?php endif; ?>
|
90 |
+
</strong>
|
91 |
+
</label>
|
92 |
+
<?php endif ?>
|
93 |
+
</li>
|
94 |
+
<?php endforeach; ?>
|
95 |
+
</ul>
|
96 |
+
</dd>
|
97 |
+
<?php endif; ?>
|
98 |
+
<?php endforeach; ?>
|
99 |
+
</dl>
|
100 |
+
</div>
|
101 |
+
<?php if ($_rate = $this->getActiveMethodRate()): ?>
|
102 |
+
<div id="order-shipping-method-info">
|
103 |
+
<strong><?php echo $this->getCarrierName($_rate->getCarrier()) ?></strong><br/>
|
104 |
+
<?php if (($_rate->getCode() == 'customshipprice_customshipprice') && ($this->getCustomTitle())): ?>
|
105 |
+
<?php if ($this->getCustomTitle()): echo $this->getCustomTitle(); endif; ?> -
|
106 |
+
<?php else: ?>
|
107 |
+
<?php echo $_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription() ?> -
|
108 |
+
<?php endif; ?>
|
109 |
+
<strong>
|
110 |
+
<?php if (($_rate->getCode() == 'customshipprice_customshipprice') && ($this->getCustomShippingPrice())): ?>
|
111 |
+
<?php $_excl = $this->getShippingPrice($this->getCustomShippingPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
112 |
+
<?php $_incl = $this->getShippingPrice($this->getCustomShippingPrice(), true); ?>
|
113 |
+
<?php else: ?>
|
114 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
115 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
116 |
+
<?php endif; ?>
|
117 |
+
<?php echo $_excl; ?>
|
118 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
119 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
120 |
+
<?php endif; ?>
|
121 |
+
</strong>
|
122 |
+
<br/>
|
123 |
+
<a href="#" onclick="$('order-shipping-method-info').hide();$('order-shipping-method-choose').show();return false">
|
124 |
+
<?php echo Mage::helper('sales')->__('Click to change shipping method') ?>
|
125 |
+
</a>
|
126 |
+
</div>
|
127 |
+
<?php else: ?>
|
128 |
+
<script type="text/javascript">$('order-shipping-method-choose').show();</script>
|
129 |
+
<?php endif; ?>
|
130 |
+
<?php elseif($this->getIsRateRequest()): ?>
|
131 |
+
<strong><?php echo Mage::helper('sales')->__('Sorry, no quotes are available for this order at this time.') ?></strong>
|
132 |
+
<?php else: ?>
|
133 |
+
<div id="order-shipping-method-summary">
|
134 |
+
<a href="#" onclick="order.loadShippingRates();return false">
|
135 |
+
<?php echo Mage::helper('sales')->__('Get shipping methods and rates') ?>
|
136 |
+
</a>
|
137 |
+
<input type="hidden" name="order[has_shipping]" value="" class="required-entry">
|
138 |
+
</div>
|
139 |
+
<?php endif; ?>
|
140 |
+
<div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div>
|
141 |
+
<script type="text/javascript">
|
142 |
+
order.overlay('shipping-method-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
|
143 |
+
order.overlay('address-shipping-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
|
144 |
+
</script>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Zero1_Customshipprice</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
7 |
<channel>community</channel>
|
@@ -11,9 +11,9 @@
|
|
11 |
<notes>Removing all the licensing requirements.
|
12 |
</notes>
|
13 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
14 |
-
<date>2013-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Customshipprice"><dir name="Helper"><file name="Data.php" hash="ba9c722115a8371684a3a1955af2b88a"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Create.php" hash="f642fc1a7450929ce77e0668c2a1c94d"/></dir></dir></dir><dir name="Carrier"><file name="Customshipprice.php" hash="888632345045787c44ed435969573996"/></dir></dir><dir name="etc"><file name="config.xml" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Zero1_Customshipprice</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
7 |
<channel>community</channel>
|
11 |
<notes>Removing all the licensing requirements.
|
12 |
</notes>
|
13 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
14 |
+
<date>2013-05-31</date>
|
15 |
+
<time>12:27:57</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Customshipprice"><dir name="Helper"><file name="Data.php" hash="ba9c722115a8371684a3a1955af2b88a"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Create.php" hash="f642fc1a7450929ce77e0668c2a1c94d"/></dir></dir></dir><dir name="Carrier"><file name="Customshipprice.php" hash="888632345045787c44ed435969573996"/></dir></dir><dir name="etc"><file name="config.xml" hash="6b7d59c0beeb34550bb4d355c4139f99"/><file name="system.xml" hash="7219383cace47f7a86ce10f8bc552638"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Customshipprice.xml" hash="69e1410bd9095aa1fdc387ca88fa572f"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="customshipprice.xml" hash="6387917a34b0ba97afa18800564fc1fd"/></dir><dir name="template"><dir name="zero1"><dir name="customshipprice"><file name="price.phtml" hash="0de46fbdfa029a9e50761b07e703efdb"/></dir></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|