HusseyCoding_Backorder - Version 1.0.6

Version Notes

- Dispatch estimates now work with 'Display products availability in stock in the frontend' disabled
- Sales representative can now be notified by email when an order is placed where items are on backorder
- Fixed display of order delivery estimates for products with no estimate

Download this release

Release Info

Developer Hussey Coding
Extension HusseyCoding_Backorder
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

app/code/community/HusseyCoding/Backorder/Block/Notify/Items.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HusseyCoding_Backorder_Block_Notify_Items extends Mage_Core_Block_Template
3
+ {
4
+ public function getBackorderItems()
5
+ {
6
+ return Mage::registry('backorder_items');
7
+ }
8
+ }
app/code/community/HusseyCoding/Backorder/Model/Observer.php CHANGED
@@ -1,6 +1,10 @@
1
  <?php
2
  class HusseyCoding_Backorder_Model_Observer
3
  {
 
 
 
 
4
  private $_helper;
5
 
6
  public function frontendControllerActionPredispatchCheckout($observer)
@@ -26,6 +30,44 @@ class HusseyCoding_Backorder_Model_Observer
26
  Mage::getSingleton('customer/session')->setBackorderAcceptedIds(array());
27
  Mage::register('is_backorder_email', true);
28
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
 
31
  public function globalSalesOrderPlaceAfter($observer)
1
  <?php
2
  class HusseyCoding_Backorder_Model_Observer
3
  {
4
+ const XML_PATH_BACKORDER_NOTIFY_TEMPLATE = 'backorder/general/backorder_notify_template';
5
+ const XML_PATH_BACKORDER_NOTIFY_RECIPIENT = 'trans_email/ident_sales/email';
6
+ const XML_PATH_BACKORDER_NOTIFY_SENDER = 'trans_email/ident_sales/name';
7
+
8
  private $_helper;
9
 
10
  public function frontendControllerActionPredispatchCheckout($observer)
30
  Mage::getSingleton('customer/session')->setBackorderAcceptedIds(array());
31
  Mage::register('is_backorder_email', true);
32
  endif;
33
+
34
+ if (Mage::getStoreConfig('backorder/general/backorder_notify')):
35
+ $count = 0;
36
+ $backitems = array();
37
+ foreach ($observer->getOrder()->getAllVisibleItems() as $item):
38
+ if ($estimate = $item->getBackorderEstimate()):
39
+ $count++;
40
+ $sku = $item->getSku();
41
+ $name = $item->getName();
42
+ $estimate = strtotime($estimate);
43
+ $estimate = date('jS F', $estimate);
44
+ $backitems[] = array('name' => $name, 'estimate' => $estimate, 'sku' => $sku);
45
+ endif;
46
+ endforeach;
47
+
48
+ if ($count):
49
+ Mage::unregister('backorder_items');
50
+ Mage::register('backorder_items', $backitems);
51
+ $translate = Mage::getSingleton('core/translate');
52
+ $translate->setTranslateInline(false);
53
+ $mailTemplate = Mage::getModel('core/email_template');
54
+ $mailTemplate
55
+ ->setDesignConfig(array('area' => 'frontend'))
56
+ ->setReplyTo(Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_RECIPIENT))
57
+ ->sendTransactional(
58
+ Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_TEMPLATE),
59
+ array('name' => Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_SENDER), 'email' => Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_RECIPIENT)),
60
+ Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_RECIPIENT),
61
+ Mage::getStoreConfig(self::XML_PATH_BACKORDER_NOTIFY_SENDER),
62
+ array(
63
+ 'increment_id' => $observer->getOrder()->getIncrementId(),
64
+ 'count' => $count,
65
+ 'customer_name' => $observer->getOrder()->getCustomerName()
66
+ )
67
+ );
68
+ $translate->setTranslateInline(true);
69
+ endif;
70
+ endif;
71
  }
72
 
73
  public function globalSalesOrderPlaceAfter($observer)
app/code/community/HusseyCoding/Backorder/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <HusseyCoding_Backorder>
5
- <version>1.0.5</version>
6
  </HusseyCoding_Backorder>
7
  </modules>
8
  <global>
@@ -44,6 +44,15 @@
44
  </observers>
45
  </sales_order_place_after>
46
  </events>
 
 
 
 
 
 
 
 
 
47
  </global>
48
  <frontend>
49
  <layout>
@@ -90,4 +99,11 @@
90
  </updates>
91
  </layout>
92
  </adminhtml>
 
 
 
 
 
 
 
93
  </config>
2
  <config>
3
  <modules>
4
  <HusseyCoding_Backorder>
5
+ <version>1.0.6</version>
6
  </HusseyCoding_Backorder>
7
  </modules>
8
  <global>
44
  </observers>
45
  </sales_order_place_after>
46
  </events>
47
+ <template>
48
+ <email>
49
+ <backorder_general_backorder_notify_template translate="label" module="backorder">
50
+ <label>Backorder Notification</label>
51
+ <file>backorder_notification.html</file>
52
+ <type>html</type>
53
+ </backorder_general_backorder_notify_template>
54
+ </email>
55
+ </template>
56
  </global>
57
  <frontend>
58
  <layout>
99
  </updates>
100
  </layout>
101
  </adminhtml>
102
+ <default>
103
+ <backorder>
104
+ <general>
105
+ <backorder_notify_template>backorder_general_backorder_notify_template</backorder_notify_template>
106
+ </general>
107
+ </backorder>
108
+ </default>
109
  </config>
app/code/community/HusseyCoding/Backorder/etc/system.xml CHANGED
@@ -17,6 +17,7 @@
17
  <show_in_default>1</show_in_default>
18
  <show_in_website>1</show_in_website>
19
  <show_in_store>1</show_in_store>
 
20
  <fields>
21
  <enabled>
22
  <label>Enable Backorder</label>
@@ -103,6 +104,26 @@
103
  <show_in_store>1</show_in_store>
104
  <comment>Global handling time, overridden by handling time on each product. Entered as human readable text string i.e. '1 day'</comment>
105
  </handling_time>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  </fields>
107
  </general>
108
  </groups>
17
  <show_in_default>1</show_in_default>
18
  <show_in_website>1</show_in_website>
19
  <show_in_store>1</show_in_store>
20
+ <comment><![CDATA[<a href="https://github.com/husseycoding/backorder/blob/master/flowchart.png" target="_blank">View configuration flowchart</a>]]></comment>
21
  <fields>
22
  <enabled>
23
  <label>Enable Backorder</label>
104
  <show_in_store>1</show_in_store>
105
  <comment>Global handling time, overridden by handling time on each product. Entered as human readable text string i.e. '1 day'</comment>
106
  </handling_time>
107
+ <backorder_notify>
108
+ <label>Send Backorder Notification</label>
109
+ <frontend_type>select</frontend_type>
110
+ <source_model>adminhtml/system_config_source_yesno</source_model>
111
+ <sort_order>10</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <comment>Send email notification to sales representative when an item is backordered</comment>
116
+ </backorder_notify>
117
+ <backorder_notify_template>
118
+ <label>Backorder Notification Template</label>
119
+ <frontend_type>select</frontend_type>
120
+ <source_model>adminhtml/system_config_source_email_template</source_model>
121
+ <sort_order>11</sort_order>
122
+ <show_in_default>1</show_in_default>
123
+ <show_in_website>1</show_in_website>
124
+ <show_in_store>1</show_in_store>
125
+ <comment></comment>
126
+ </backorder_notify_template>
127
  </fields>
128
  </general>
129
  </groups>
app/design/frontend/base/default/layout/backorder.xml CHANGED
@@ -39,4 +39,7 @@
39
  <action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>backorder/bundle/email/order/items/order/default.phtml</template></action>
40
  </reference>
41
  </sales_email_order_items>
 
 
 
42
  </layout>
39
  <action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>backorder/bundle/email/order/items/order/default.phtml</template></action>
40
  </reference>
41
  </sales_email_order_items>
42
+ <backorder_notify_items>
43
+ <block type="backorder/notify_items" name="root" template="backorder/notify/items.phtml" />
44
+ </backorder_notify_items>
45
  </layout>
app/design/frontend/base/default/template/backorder/email/order/items/order/.LCKdefault.phtml~ DELETED
@@ -1 +0,0 @@
1
- /home/husseycoding/husseycoding/Magento/extensions/clean/app/design/frontend/base/default/template/backorder/email/order/items/order/default.phtml
 
app/design/frontend/base/default/template/backorder/notify/items.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php foreach ($this->getBackorderItems() as $item): ?>
2
+ <?php echo $item['name'] . ' (' . $item['sku'] . ') - Estimated delivery ' . $item['estimate']; ?><br />
3
+ <?php endforeach; ?>
app/locale/en_US/template/email/backorder_notification.html ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <!--@subject Order #{{var increment_id}} has {{var count}} product(s) on backorder@-->
2
+ <p>{{var customer_name}} has placed order #{{var increment_id}} which contains product(s) on backorder:</p>
3
+ <p>Products:<br />
4
+ {{layout handle="backorder_notify_items"}}</p>
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HusseyCoding_Backorder</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Adds dispatch estimate notifications to product pages and the cart.</summary>
10
  <description>Adds a dispatch lead time attribute to each product which should be entered as a human readable text string describing the lead time for the product, i.e. 1 week and 3 days. For parent products (grouped, configurable and bundle) the lead time should be entered for the child simple products rather than the parent product - any lead time on a parent product will be ignored.</description>
11
- <notes>Order today display logic fix, min out of stock quantity now pulled from config, added handling time, fixed lead time as date logic, added delivery estimates to order</notes>
 
 
12
  <authors><author><name>Hussey Coding</name><user>husseycoding</user><email>info@husseycoding.co.uk</email></author></authors>
13
- <date>2015-07-28</date>
14
- <time>15:15:23</time>
15
- <contents><target name="magecommunity"><dir name="HusseyCoding"><dir name="Backorder"><dir name="Block"><dir name="Adminhtml"><file name="Estimate.php" hash="385e1c6b6984be79c5d1b0e26ac1ae38"/></dir><dir name="Customer"><file name="Estimate.php" hash="6e6d0edf0a2419a03d02c812430ac1dc"/></dir><dir name="Estimate"><file name="Common.php" hash="bb1ef493353c5a2ca2ca6f7b72b0fe82"/></dir><file name="Estimate.php" hash="d72aca15f662940fe7c1a1db0faf1c90"/></dir><dir name="controllers"><file name="IndexController.php" hash="398362af6bd568d1cb5cb616c73d461a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="81e616c4c65ddbd6e92728f8dc8e3fe5"/><file name="config.xml" hash="5dc9f1332e3d14bdc2093d1e08deb117"/><file name="system.xml" hash="f3903f9bd44783fd82c895b6bf92eade"/></dir><dir name="Helper"><file name="Data.php" hash="349453311bf4d5691ffacb258ab558a2"/></dir><dir name="Model"><file name="Observer.php" hash="7d83be0a6ae9ca9c8726d8db9c069de1"/><dir name="Order"><file name="SalesItem.php" hash="04de33199c3fac846eefaa9276114183"/></dir></dir><dir name="sql"><dir name="backorder_setup"><file name="install-1.0.0.php" hash="54c2cb1a423fad263b465df516da1ccb"/><file name="upgrade-1.0.0-1.0.1.php" hash="87b1f3a15a9e062691e33be10e39d330"/><file name="upgrade-1.0.3-1.0.4.php" hash="bef00d714a36ad2a2d093d0804390715"/><file name="upgrade-1.0.4-1.0.5.php" hash="d8ce9608c85c192dfc1d23070f2cd275"/></dir></dir></dir><dir name="Common"><dir name="etc"><file name="system.xml" hash="6c9ba9f227b9adfc9abf97f17b46fdbf"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HusseyCoding_Backorder.xml" hash="97f4e05e024b0baa9f51ed3be9929168"/><file name="HusseyCoding_Common.xml" hash="31e82d3d9b3179c2fa9e002f9669da47"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="backorder.xml" hash="ae19bf83ee5e57e66e3d02f7d66471ba"/></dir><dir name="template"><dir name="backorder"><dir name="bundle"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="ead8320a2ffbc1ff62e00752a148bba0"/></dir></dir></dir></dir></dir><dir name="customer"><file name="estimate.phtml" hash="06b9a643a15d4d6c703ac97b50f5ddd2"/></dir><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="7c10e6eab957575c37548a8b4f4c30bd"/><file name=".LCKdefault.phtml~" hash="fc43612dd0aea43db22c8e5dcfafa252"/></dir></dir></dir></dir><file name="estimate.phtml" hash="72630a99f3703fc726a486516f694b92"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="backorder.xml" hash="1a7857b4d23af1401afda19cf0dc2aa2"/></dir><dir name="template"><dir name="backorder"><file name="estimate.phtml" hash="06b9a643a15d4d6c703ac97b50f5ddd2"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><file name="backorder.js" hash="d1515bb6ec6807a56b2e4adb3d28d5a2"/><dir name="backorder"><file name="customer.js" hash="d63fd34949bf1bee192ccc48d2e805cd"/></dir></dir><dir name="css"><file name="backorder.css" hash="f9601103bb20f597f9b58ec31d53ca6a"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="backorder"><dir name="css"><file name="estimate.css" hash="d1e518f4f08c6ebdf5204bb016ce0372"/></dir><dir name="js"><file name="estimate.js" hash="032dd22494211533781eed6b94b7cb83"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HusseyCoding_Backorder</name>
4
+ <version>1.0.6</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>Adds dispatch estimate notifications to product pages and the cart.</summary>
10
  <description>Adds a dispatch lead time attribute to each product which should be entered as a human readable text string describing the lead time for the product, i.e. 1 week and 3 days. For parent products (grouped, configurable and bundle) the lead time should be entered for the child simple products rather than the parent product - any lead time on a parent product will be ignored.</description>
11
+ <notes>- Dispatch estimates now work with 'Display products availability in stock in the frontend' disabled&#xD;
12
+ - Sales representative can now be notified by email when an order is placed where items are on backorder&#xD;
13
+ - Fixed display of order delivery estimates for products with no estimate</notes>
14
  <authors><author><name>Hussey Coding</name><user>husseycoding</user><email>info@husseycoding.co.uk</email></author></authors>
15
+ <date>2015-10-08</date>
16
+ <time>09:58:34</time>
17
+ <contents><target name="magecommunity"><dir name="HusseyCoding"><dir name="Backorder"><dir name="Block"><dir name="Adminhtml"><file name="Estimate.php" hash="385e1c6b6984be79c5d1b0e26ac1ae38"/></dir><dir name="Customer"><file name="Estimate.php" hash="6e6d0edf0a2419a03d02c812430ac1dc"/></dir><dir name="Estimate"><file name="Common.php" hash="bb1ef493353c5a2ca2ca6f7b72b0fe82"/></dir><file name="Estimate.php" hash="d72aca15f662940fe7c1a1db0faf1c90"/><dir name="Notify"><file name="Items.php" hash="888378c6ddbe8aa499f253dfeb03c53e"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="398362af6bd568d1cb5cb616c73d461a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="81e616c4c65ddbd6e92728f8dc8e3fe5"/><file name="config.xml" hash="a7443e0ad3664f58b41331f66118bd54"/><file name="system.xml" hash="0ad3f597bde93164804e68b743b288b0"/></dir><dir name="Helper"><file name="Data.php" hash="349453311bf4d5691ffacb258ab558a2"/></dir><dir name="Model"><file name="Observer.php" hash="a48244de6dde5c48fdd9aa50e7dc62f7"/><dir name="Order"><file name="SalesItem.php" hash="04de33199c3fac846eefaa9276114183"/></dir></dir><dir name="sql"><dir name="backorder_setup"><file name="install-1.0.0.php" hash="54c2cb1a423fad263b465df516da1ccb"/><file name="upgrade-1.0.0-1.0.1.php" hash="87b1f3a15a9e062691e33be10e39d330"/><file name="upgrade-1.0.3-1.0.4.php" hash="bef00d714a36ad2a2d093d0804390715"/><file name="upgrade-1.0.4-1.0.5.php" hash="d8ce9608c85c192dfc1d23070f2cd275"/></dir></dir></dir><dir name="Common"><dir name="etc"><file name="system.xml" hash="6c9ba9f227b9adfc9abf97f17b46fdbf"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="HusseyCoding_Backorder.xml" hash="97f4e05e024b0baa9f51ed3be9929168"/><file name="HusseyCoding_Common.xml" hash="31e82d3d9b3179c2fa9e002f9669da47"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="backorder.xml" hash="6c28968d1101a662b78d2e088cb25bd5"/></dir><dir name="template"><dir name="backorder"><dir name="bundle"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="ead8320a2ffbc1ff62e00752a148bba0"/></dir></dir></dir></dir></dir><dir name="customer"><file name="estimate.phtml" hash="06b9a643a15d4d6c703ac97b50f5ddd2"/></dir><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="7c10e6eab957575c37548a8b4f4c30bd"/></dir></dir></dir></dir><file name="estimate.phtml" hash="72630a99f3703fc726a486516f694b92"/><dir name="notify"><file name="items.phtml" hash="a9c73eea6850cdbc1577a81ade08367d"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="backorder.xml" hash="1a7857b4d23af1401afda19cf0dc2aa2"/></dir><dir name="template"><dir name="backorder"><file name="estimate.phtml" hash="06b9a643a15d4d6c703ac97b50f5ddd2"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="backorder.css" hash="f9601103bb20f597f9b58ec31d53ca6a"/></dir><dir name="js"><file name="backorder.js" hash="3b95ab6c1eca9e0f502aa7a053b4c816"/><dir name="backorder"><file name="customer.js" hash="72c4fe815d0c3af3263c6a6573a9373d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="backorder"><dir name="css"><file name="estimate.css" hash="d1e518f4f08c6ebdf5204bb016ce0372"/></dir><dir name="js"><file name="estimate.js" hash="f60c2208a113d446dc24fed10e8159ff"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="backorder_notification.html" hash="2e59f4a6c86156fb1922af3e232f35be"/></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
skin/adminhtml/default/default/backorder/js/estimate.js CHANGED
@@ -1,7 +1,9 @@
1
  var backorder = Class.create({
2
  afterInit: function() {
3
  $H(this.orderestimates).each(function(estimate) {
4
- $("order_item_" + estimate.key + "_title").insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate.value + "</span></p>"});
 
 
5
  }.bind(this));
6
  }
7
  });
1
  var backorder = Class.create({
2
  afterInit: function() {
3
  $H(this.orderestimates).each(function(estimate) {
4
+ if (estimate.value) {
5
+ $("order_item_" + estimate.key + "_title").insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate.value + "</span></p>"});
6
+ }
7
  }.bind(this));
8
  }
9
  });
skin/frontend/base/default/js/backorder.js CHANGED
@@ -11,9 +11,9 @@ var backorder = Class.create({
11
  this.initBundle();
12
  } else {
13
  if (this.productestimate) {
14
- $$(".availability")[0].insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + this.productestimate + "</span></p>"});
15
  } else if (this.showorderbefore) {
16
- $$(".availability")[0].insert({after: "<div class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</div>"});
17
  }
18
  }
19
  }
@@ -99,9 +99,9 @@ var backorder = Class.create({
99
  var productid = spConfig.getIdOfSelectedProduct();
100
  if (productid) {
101
  if (this.productestimate[productid]) {
102
- $$(".availability")[0].insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + this.productestimate[productid] + "</span></p>"});
103
  } else if (this.orderbefore && this.showorderbefore[productid]) {
104
- $$(".availability")[0].insert({after: "<p class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</p>"});
105
  }
106
  }
107
  },
@@ -153,9 +153,9 @@ var backorder = Class.create({
153
  }.bind(this));
154
  var estimate = this.getLongestBundleEstimate(estimates);
155
  if (estimate) {
156
- $$(".availability")[0].insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate + "</span></p>"});
157
  } else if (this.orderbefore && showbundleorderbefore) {
158
- $$(".availability")[0].insert({after: "<p class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</p>"});
159
  }
160
  },
161
  getBundleEstimate: function(bundleid, value) {
11
  this.initBundle();
12
  } else {
13
  if (this.productestimate) {
14
+ $$(".price-box")[0].insert({before: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + this.productestimate + "</span></p>"});
15
  } else if (this.showorderbefore) {
16
+ $$(".price-box")[0].insert({before: "<div class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</div>"});
17
  }
18
  }
19
  }
99
  var productid = spConfig.getIdOfSelectedProduct();
100
  if (productid) {
101
  if (this.productestimate[productid]) {
102
+ $$(".price-box")[0].insert({before: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + this.productestimate[productid] + "</span></p>"});
103
  } else if (this.orderbefore && this.showorderbefore[productid]) {
104
+ $$(".price-box")[0].insert({before: "<p class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</p>"});
105
  }
106
  }
107
  },
153
  }.bind(this));
154
  var estimate = this.getLongestBundleEstimate(estimates);
155
  if (estimate) {
156
+ $$(".price-box-bundle")[0].insert({before: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate + "</span></p>"});
157
  } else if (this.orderbefore && showbundleorderbefore) {
158
+ $$(".price-box-bundle")[0].insert({before: "<p class=\"dispatch-nolead\">" + this.getOrderBeforeString() + "</p>"});
159
  }
160
  },
161
  getBundleEstimate: function(bundleid, value) {
skin/frontend/base/default/js/backorder/customer.js CHANGED
@@ -1,7 +1,9 @@
1
  var backorder = Class.create({
2
  afterInit: function() {
3
  $H(this.orderestimates).each(function(estimate) {
4
- $("order-item-row-" + estimate.key).down("h3").insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate.value + "</span></p>"});
 
 
5
  }.bind(this));
6
  }
7
  });
1
  var backorder = Class.create({
2
  afterInit: function() {
3
  $H(this.orderestimates).each(function(estimate) {
4
+ if (estimate.value) {
5
+ $("order-item-row-" + estimate.key).down("h3").insert({after: "<p class=\"dispatch-estimate\">" + this.estimatetext + ": <span>" + estimate.value + "</span></p>"});
6
+ }
7
  }.bind(this));
8
  }
9
  });