zinc - Version 1.0.3

Version Notes

Zinc allows merchants to display warranty and product protection quotes next to the product being sold. Customers can add those policies to their purchases at point of sale, and Zinc follow up to complete the sale. Merchants earn additional margin while Zinc takes care of all the heavy lifting to execute the contract and handle the claims.

Download this release

Release Info

Developer ZincPlatform
Extension zinc
Version 1.0.3
Comparing to
See all releases


Version 1.0.3

Files changed (77) hide show
  1. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Catalog/Product/Grid.php +88 -0
  2. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Catalog/Product/Renderer/Category.php +38 -0
  3. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Order.php +18 -0
  4. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Order/Grid.php +102 -0
  5. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product.php +18 -0
  6. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit.php +29 -0
  7. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Form.php +24 -0
  8. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Tab/Form.php +91 -0
  9. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Tabs.php +29 -0
  10. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Grid.php +144 -0
  11. app/code/local/Zinc/Carebyzinc/Block/Adminhtml/System/Config/Tokenvalidate.php +56 -0
  12. app/code/local/Zinc/Carebyzinc/Block/Carebyzinc.php +23 -0
  13. app/code/local/Zinc/Carebyzinc/Helper/Data.php +60 -0
  14. app/code/local/Zinc/Carebyzinc/Model/Carebyzinc.php +235 -0
  15. app/code/local/Zinc/Carebyzinc/Model/Checkout/Cart.php +158 -0
  16. app/code/local/Zinc/Carebyzinc/Model/Entity/Category.php +17 -0
  17. app/code/local/Zinc/Carebyzinc/Model/Entity/Subcategory.php +18 -0
  18. app/code/local/Zinc/Carebyzinc/Model/Mysql4/Order.php +14 -0
  19. app/code/local/Zinc/Carebyzinc/Model/Mysql4/Order/Collection.php +15 -0
  20. app/code/local/Zinc/Carebyzinc/Model/Observer.php +47 -0
  21. app/code/local/Zinc/Carebyzinc/Model/Order.php +114 -0
  22. app/code/local/Zinc/Carebyzinc/Model/Sales/Quote.php +31 -0
  23. app/code/local/Zinc/Carebyzinc/Model/System/Config/Source.php +23 -0
  24. app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/CarebyzincController.php +25 -0
  25. app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/OrderController.php +25 -0
  26. app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/ProductController.php +174 -0
  27. app/code/local/Zinc/Carebyzinc/controllers/CartController.php +251 -0
  28. app/code/local/Zinc/Carebyzinc/controllers/IndexController.php +152 -0
  29. app/code/local/Zinc/Carebyzinc/etc/adminhtml.xml +59 -0
  30. app/code/local/Zinc/Carebyzinc/etc/config.xml +173 -0
  31. app/code/local/Zinc/Carebyzinc/etc/system.xml +141 -0
  32. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-install-0.1.0.php +32 -0
  33. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-0.1.0-0.2.0.php +30 -0
  34. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-0.2.0-1.0.0.php +23 -0
  35. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.0-1.0.1.php +34 -0
  36. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.1-1.0.2.php +23 -0
  37. app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.2-1.0.3.php +49 -0
  38. app/design/adminhtml/default/default/layout/zinc_carebyzinc.xml +107 -0
  39. app/design/adminhtml/default/default/template/carebyzinc/order/creditmemo/create/items/renderer/default.phtml +261 -0
  40. app/design/adminhtml/default/default/template/carebyzinc/order/creditmemo/view/items/renderer/default.phtml +262 -0
  41. app/design/adminhtml/default/default/template/carebyzinc/order/invoice/create/items/renderer/default.phtml +257 -0
  42. app/design/adminhtml/default/default/template/carebyzinc/order/invoice/view/items/renderer/default.phtml +249 -0
  43. app/design/adminhtml/default/default/template/carebyzinc/order/shipment/create/items/renderer/default.phtml +62 -0
  44. app/design/adminhtml/default/default/template/carebyzinc/order/shipment/view/items/renderer/default.phtml +48 -0
  45. app/design/adminhtml/default/default/template/carebyzinc/order/view/items/renderer/default.phtml +256 -0
  46. app/design/adminhtml/default/default/template/carebyzinc/system/tokenvalidate.phtml +18 -0
  47. app/design/frontend/base/default/layout/zinc_carebyzinc.xml +346 -0
  48. app/design/frontend/base/default/template/carebyzinc/carebyzinc.phtml +86 -0
  49. app/design/frontend/base/default/template/carebyzinc/checkout/cart.phtml +246 -0
  50. app/design/frontend/base/default/template/carebyzinc/checkout/cart/item/default.phtml +418 -0
  51. app/design/frontend/base/default/template/carebyzinc/checkout/cart/item/default.phtml-10-08-2016 +415 -0
  52. app/design/frontend/base/default/template/carebyzinc/checkout/cart/minicart/default.phtml +220 -0
  53. app/design/frontend/base/default/template/carebyzinc/checkout/multishipping/item/default.phtml +62 -0
  54. app/design/frontend/base/default/template/carebyzinc/checkout/onepage/review/item.phtml +260 -0
  55. app/design/frontend/base/default/template/carebyzinc/email/order/items/creditmemo/default.phtml +137 -0
  56. app/design/frontend/base/default/template/carebyzinc/email/order/items/invoice/default.phtml +138 -0
  57. app/design/frontend/base/default/template/carebyzinc/email/order/items/order/default.phtml +150 -0
  58. app/design/frontend/base/default/template/carebyzinc/email/order/items/shipment/default.phtml +60 -0
  59. app/design/frontend/base/default/template/carebyzinc/options/cart.phtml +31 -0
  60. app/design/frontend/base/default/template/carebyzinc/options/default.phtml +39 -0
  61. app/design/frontend/base/default/template/carebyzinc/sales/order/creditmemo/items/renderer/default.phtml +346 -0
  62. app/design/frontend/base/default/template/carebyzinc/sales/order/invoice/items/renderer/default.phtml +347 -0
  63. app/design/frontend/base/default/template/carebyzinc/sales/order/items/renderer/default.phtml +341 -0
  64. app/design/frontend/base/default/template/carebyzinc/sales/order/shipment/items/renderer/default.phtml +79 -0
  65. app/etc/modules/Zinc_Carebyzinc.xml +9 -0
  66. js/carebyzinc/jquery.colorbox.js +1105 -0
  67. js/carebyzinc/product.js +812 -0
  68. package.xml +18 -0
  69. skin/frontend/base/default/carebyzinc/css/carebyzinc.css +101 -0
  70. skin/frontend/base/default/carebyzinc/css/colorbox.css +71 -0
  71. skin/frontend/base/default/carebyzinc/css/images/border.png +0 -0
  72. skin/frontend/base/default/carebyzinc/css/images/cancel.png +0 -0
  73. skin/frontend/base/default/carebyzinc/css/images/care-preloader.gif +0 -0
  74. skin/frontend/base/default/carebyzinc/css/images/controls.png +0 -0
  75. skin/frontend/base/default/carebyzinc/css/images/loading.gif +0 -0
  76. skin/frontend/base/default/carebyzinc/css/images/loading_background.png +0 -0
  77. skin/frontend/base/default/carebyzinc/css/images/overlay.png +0 -0
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Catalog/Product/Grid.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
9
+ {
10
+
11
+ public function setCollection($collection)
12
+ {
13
+ //$collection->addAttributeToSelect('carebyzinc');
14
+ $collection->addExpressionAttributeToSelect('carebyzinc','round({{carebyzinc}},0)','carebyzinc');
15
+ parent::setCollection($collection);
16
+ }
17
+
18
+ protected function _prepareColumns()
19
+ {
20
+
21
+ $this->addColumnAfter('carebyzinc',
22
+ array(
23
+ 'header'=> Mage::helper('catalog')->__('Care by Zinc'),
24
+ 'width' => '70px',
25
+ 'index' => 'carebyzinc',
26
+ 'type' => 'options',
27
+ 'options' => array('1' => 'Enabled', '0' => 'Disabled'),
28
+ ), 'visibility');
29
+
30
+ return parent::_prepareColumns();
31
+ }
32
+
33
+ protected function _prepareMassaction()
34
+ {
35
+ $this->setMassactionIdField('entity_id');
36
+ $this->getMassactionBlock()->setFormFieldName('product');
37
+
38
+ $this->getMassactionBlock()->addItem('delete', array(
39
+ 'label'=> Mage::helper('catalog')->__('Delete'),
40
+ 'url' => $this->getUrl('*/*/massDelete'),
41
+ 'confirm' => Mage::helper('catalog')->__('Are you sure?')
42
+ ));
43
+
44
+ $statuses = Mage::getSingleton('catalog/product_status')->getOptionArray();
45
+
46
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
47
+ $this->getMassactionBlock()->addItem('status', array(
48
+ 'label'=> Mage::helper('catalog')->__('Change status'),
49
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
50
+ 'additional' => array(
51
+ 'visibility' => array(
52
+ 'name' => 'status',
53
+ 'type' => 'select',
54
+ 'class' => 'required-entry',
55
+ 'label' => Mage::helper('catalog')->__('Status'),
56
+ 'values' => $statuses
57
+ )
58
+ )
59
+ ));
60
+
61
+ $carebyzinc = Mage::getSingleton('carebyzinc/carebyzinc')->getOptionArray();
62
+
63
+ $this->getMassactionBlock()->addItem('zinc_carebyzinc', array(
64
+ 'label'=> Mage::helper('carebyzinc')->__('Change Carebyzinc'),
65
+ 'url' => $this->getUrl('adminhtml/product/massCarebyzinc', array('_current'=>true)),
66
+ 'additional' => array(
67
+ 'visibility' => array(
68
+ 'name' => 'zinc_carebyzinc',
69
+ 'type' => 'select',
70
+ 'class' => 'required-entry',
71
+ 'label' => Mage::helper('carebyzinc')->__('Care by Zinc'),
72
+ 'values' => $carebyzinc
73
+ )
74
+ )
75
+ ));
76
+
77
+ if (Mage::getSingleton('admin/session')->isAllowed('catalog/update_attributes')){
78
+ $this->getMassactionBlock()->addItem('attributes', array(
79
+ 'label' => Mage::helper('catalog')->__('Update Attributes'),
80
+ 'url' => $this->getUrl('*/catalog_product_action_attribute/edit', array('_current'=>true))
81
+ ));
82
+ }
83
+
84
+ Mage::dispatchEvent('adminhtml_catalog_product_grid_prepare_massaction', array('block' => $this));
85
+ return $this;
86
+ }
87
+
88
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Catalog/Product/Renderer/Category.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Zinc_Carebyzinc_Block_Adminhtml_Catalog_Product_Renderer_Category extends Varien_Data_Form_Element_Select
10
+ {
11
+ public function getAfterElementHtml()
12
+ {
13
+ $html = parent::getAfterElementHtml();
14
+
15
+ return $html."<script>
16
+ document.getElementById('carebyzinc_category').onchange = function() {getSubcategories(this.value)};
17
+
18
+ function getSubcategories(selectElement){
19
+ var reloadurl = '". Mage::getUrl('adminhtml/product/getSubcategories')."';
20
+ if(selectElement){
21
+ new Ajax.Request(reloadurl, {parameters: { cat: selectElement},
22
+ method: 'post',
23
+ onComplete: function(transport) {
24
+ var content = JSON.parse(transport.responseText);
25
+ var i = 0;
26
+ for (var key in content) {
27
+ document.getElementById('carebyzinc_subcategory').options[i] = new Option(content[key],content[key]);
28
+ i++;
29
+ }
30
+
31
+ }
32
+ });
33
+ }else
34
+ document.getElementById('carebyzinc_subcategory').innerHTML='';
35
+ }</script>";
36
+
37
+ }
38
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Order.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Order extends Mage_Adminhtml_Block_Widget_Grid_Container
9
+ {
10
+ public function __construct()
11
+ {
12
+ $this->_controller = 'adminhtml_order';
13
+ $this->_blockGroup = 'carebyzinc';
14
+ $this->_headerText = Mage::helper('carebyzinc')->__('Care by Zinc Orders');
15
+ parent::__construct();
16
+ $this->_removeButton('add');
17
+ }
18
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Order/Grid.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
+ {
10
+
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+ $this->setId('orderGrid');
15
+ $this->setDefaultSort('id');
16
+ $this->setDefaultDir('DESC');
17
+ $this->setSaveParametersInSession(true);
18
+ }
19
+
20
+ protected function _prepareCollection()
21
+ {
22
+ $collection = Mage::getModel('carebyzinc/order')->getCollection();
23
+ $this->setCollection($collection);
24
+ return parent::_prepareCollection();
25
+ }
26
+
27
+ protected function _prepareColumns()
28
+ {
29
+ $this->addColumn('id', array(
30
+ 'header' => Mage::helper('carebyzinc')->__('ID'),
31
+ 'align' =>'right',
32
+ 'width' => '50px',
33
+ 'index' => 'id',
34
+ ));
35
+
36
+ $this->addColumn('order_id', array(
37
+ 'header' => Mage::helper('carebyzinc')->__('Order ID'),
38
+ 'align' =>'right',
39
+ 'width' => '50px',
40
+ 'index' => 'order_inc_id',
41
+ ));
42
+
43
+ $this->addColumn('product_id', array(
44
+ 'header' => Mage::helper('carebyzinc')->__('Product ID'),
45
+ 'align' =>'right',
46
+ 'width' => '50px',
47
+ 'index' => 'product_id',
48
+ ));
49
+
50
+ $this->addColumn('product_name', array(
51
+ 'header' => Mage::helper('carebyzinc')->__('Product'),
52
+ 'align' =>'left',
53
+ 'index' => 'product_name',
54
+ ));
55
+ $this->addColumn('price', array(
56
+ 'header' => Mage::helper('carebyzinc')->__('Price'),
57
+ 'align' =>'left',
58
+ 'index' => 'product_price',
59
+ ));
60
+ $this->addColumn('warrenty_price', array(
61
+ 'header' => Mage::helper('carebyzinc')->__('Warrenty Price'),
62
+ 'align' =>'left',
63
+ 'index' => 'warrenty_price',
64
+ ));
65
+
66
+ $this->addColumn('customer_name', array(
67
+ 'header' => Mage::helper('carebyzinc')->__('Customer Name'),
68
+ 'align' =>'left',
69
+ 'index' => 'customer_name',
70
+ ));
71
+
72
+ $this->addColumn('customer_email', array(
73
+ 'header' => Mage::helper('carebyzinc')->__('Email'),
74
+ 'align' =>'left',
75
+ 'index' => 'customer_email',
76
+ ));
77
+
78
+ $this->addColumn('carebyzinc_key', array(
79
+ 'header' => Mage::helper('carebyzinc')->__('Care by Zinc Key'),
80
+ 'align' =>'right',
81
+ 'index' => 'carebyzinc_key',
82
+ ));
83
+
84
+ $this->addColumn('carebyzinc_provider', array(
85
+ 'header' => Mage::helper('carebyzinc')->__('Provider'),
86
+ 'align' =>'left',
87
+ 'index' => 'carebyzinc_provider',
88
+ ));
89
+
90
+ return parent::_prepareColumns();
91
+ }
92
+
93
+ public function getRowUrl($row)
94
+ {
95
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
96
+ return $this->getUrl('*/sales_order/view', array('order_id' => $row->getOrderId()));
97
+ }
98
+ return false;
99
+ }
100
+
101
+
102
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product extends Mage_Adminhtml_Block_Widget_Grid_Container
9
+ {
10
+ public function __construct()
11
+ {
12
+ $this->_controller = 'adminhtml_product';
13
+ $this->_blockGroup = 'carebyzinc';
14
+ $this->_headerText = Mage::helper('carebyzinc')->__('Care by Zinc Manager');
15
+ parent::__construct();
16
+ $this->_removeButton('add');
17
+ }
18
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
9
+ {
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+
14
+ $this->_objectId = 'id';
15
+ $this->_blockGroup = 'carebyzinc';
16
+ $this->_controller = 'adminhtml_product';
17
+ $this->_updateButton('save', 'label', Mage::helper('carebyzinc')->__('Save'));
18
+ }
19
+
20
+ public function getHeaderText()
21
+ {
22
+ if( Mage::registry('carebyzinc_data') && Mage::registry('carebyzinc_data')->getId() ) {
23
+ return Mage::helper('carebyzinc')->__("Edit Care by Zinc of '".'%s'."'", $this->htmlEscape(Mage::registry('carebyzinc_data')->getName()));
24
+ }
25
+ else
26
+ return Mage::helper('carebyzinc')->__("Edit Care by Zinc");
27
+
28
+ }
29
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Form.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
9
+ {
10
+ protected function _prepareForm()
11
+ {
12
+ $form = new Varien_Data_Form(array(
13
+ 'id' => 'edit_form',
14
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
15
+ 'method' => 'post',
16
+ 'enctype' => 'multipart/form-data'
17
+ )
18
+ );
19
+
20
+ $form->setUseContainer(true);
21
+ $this->setForm($form);
22
+ return parent::_prepareForm();
23
+ }
24
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Tab/Form.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
9
+ {
10
+ protected function _prepareForm()
11
+ {
12
+ $form = new Varien_Data_Form();
13
+ $this->setForm($form);
14
+ $fieldset = $form->addFieldset('carebyzinc_form', array('legend'=>Mage::helper('carebyzinc')->__('Care By Zinc')));
15
+ $fieldset->addField('carebyzinc', 'select', array(
16
+ 'label' => Mage::helper('carebyzinc')->__('Care by Zinc'),
17
+ 'class' => 'required-entry',
18
+ 'required' => true,
19
+ 'name' => 'carebyzinc',
20
+ 'values' => array(
21
+
22
+ array(
23
+ 'value' => 0,
24
+ 'label' => Mage::helper('carebyzinc')->__('Disable'),
25
+
26
+ ),
27
+ array(
28
+ 'value' => 1,
29
+ 'label' => Mage::helper('carebyzinc')->__('Enable'),
30
+ ),
31
+ ),
32
+
33
+ ));
34
+ $fieldset->addField('carebyzinc_category', 'select', array(
35
+ 'label' => Mage::helper('carebyzinc')->__('Category'),
36
+ 'class' => 'required-entry',
37
+ 'required' => true,
38
+ 'name' => 'category',
39
+
40
+ 'values' => Mage::getModel('carebyzinc/carebyzinc')->getCategoryArray(),
41
+ 'onchange' => "getSubcategories(this.value); function getSubcategories(selectElement){
42
+ var reloadurl = '". $this->getUrl('*/product/getSubcategories')."';
43
+ if(selectElement){
44
+ new Ajax.Request(reloadurl, {parameters: { cat: selectElement},
45
+ method: 'post',
46
+ onComplete: function(transport) {
47
+ var content = JSON.parse(transport.responseText);
48
+ var i = 0;
49
+ for (var key in content) {
50
+ document.getElementById('carebyzinc_subcategory').options[i] = new Option(content[key],content[key]);
51
+ i++;
52
+ }
53
+
54
+ }
55
+ });
56
+ }else
57
+ document.getElementById('carebyzinc_subcategory').innerHTML='';
58
+ }",
59
+ ));
60
+ $category = Mage::registry('carebyzinc_data')->getData('carebyzinc_category');
61
+ if(($this->getRequest()->getParam('id')) && ($category)) {
62
+ $fieldset->addField('carebyzinc_subcategory', 'select', array(
63
+ 'label' => Mage::helper('carebyzinc')->__('Sub Category'),
64
+ 'class' => 'required-entry',
65
+ 'required' => true,
66
+ 'name' => 'subcategory',
67
+ 'values' => Mage::getModel('carebyzinc/carebyzinc')->getSubCategoryArray($category),
68
+ ));
69
+ }else{
70
+
71
+ $fieldset->addField('carebyzinc_subcategory', 'select', array(
72
+ 'label' => Mage::helper('carebyzinc')->__('Sub Category'),
73
+ 'class' => 'required-entry',
74
+ 'required' => true,
75
+ 'name' => 'subcategory',
76
+ 'values' => array(''=>'Please Select'),
77
+ ));
78
+
79
+
80
+ }
81
+
82
+ if ( Mage::getSingleton('adminhtml/session')->getVendorData() )
83
+ {
84
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getCarebyzincData());
85
+ Mage::getSingleton('adminhtml/session')->setCarebyzincData(null);
86
+ } elseif ( Mage::registry('carebyzinc_data') ) {
87
+ $form->setValues( Mage::registry('carebyzinc_data')->getData());
88
+ }
89
+ return parent::_prepareForm();
90
+ }
91
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Edit/Tabs.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
9
+ {
10
+
11
+ public function __construct()
12
+ {
13
+ parent::__construct();
14
+ $this->setId('product_tabs');
15
+ $this->setDestElementId('edit_form');
16
+ $this->setTitle(Mage::helper('carebyzinc')->__('Care by Zinc'));
17
+ }
18
+
19
+ protected function _beforeToHtml()
20
+ {
21
+ $this->addTab('form_section', array(
22
+ 'label' => Mage::helper('carebyzinc')->__('Care by Zinc'),
23
+ 'title' => Mage::helper('carebyzinc')->__('Care by Zinc'),
24
+ 'content' => $this->getLayout()->createBlock('carebyzinc/adminhtml_product_edit_tab_form')->toHtml(),
25
+ ));
26
+
27
+ return parent::_beforeToHtml();
28
+ }
29
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/Product/Grid.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
9
+ {
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->setId('listGrid');
14
+ $this->setDefaultSort('entity_id');
15
+ $this->setDefaultDir('DESC');
16
+ $this->setSaveParametersInSession(true);
17
+ }
18
+
19
+ public function setCollection($collection)
20
+ {
21
+
22
+ //$collection->addAttributeToSelect('carebyzinc');
23
+ $collection->addFieldToFilter('price',array('gteq' => 500));
24
+ $collection->addAttributeToSelect('carebyzinc');
25
+ $collection->addExpressionAttributeToSelect('carebyzinc','round({{carebyzinc}},0)','carebyzinc');
26
+ parent::setCollection($collection);
27
+
28
+ }
29
+
30
+ protected function _prepareColumns()
31
+ {
32
+ $this->addColumn('entity_id',
33
+ array(
34
+ 'header'=> Mage::helper('catalog')->__('ID'),
35
+ 'width' => '50px',
36
+ 'type' => 'number',
37
+ 'index' => 'entity_id',
38
+ ));
39
+ $this->addColumn('name',
40
+ array(
41
+ 'header'=> Mage::helper('catalog')->__('Name'),
42
+ 'index' => 'name',
43
+ ));
44
+
45
+ $store = $this->_getStore();
46
+ if ($store->getId()) {
47
+ $this->addColumn('custom_name',
48
+ array(
49
+ 'header'=> Mage::helper('catalog')->__('Name in %s', $store->getName()),
50
+ 'index' => 'custom_name',
51
+ ));
52
+ }
53
+
54
+ $this->addColumn('sku',
55
+ array(
56
+ 'header'=> Mage::helper('catalog')->__('SKU'),
57
+ 'width' => '80px',
58
+ 'index' => 'sku',
59
+ ));
60
+
61
+ $store = $this->_getStore();
62
+ $this->addColumn('price',
63
+ array(
64
+ 'header'=> Mage::helper('catalog')->__('Price'),
65
+ 'type' => 'price',
66
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
67
+ 'index' => 'price',
68
+ ));
69
+
70
+ $this->addColumn('carebyzinc',
71
+ array(
72
+ 'header'=> Mage::helper('catalog')->__('Care by Zinc'),
73
+ 'width' => '150px',
74
+ 'index' => 'carebyzinc',
75
+ 'type' => 'options',
76
+ 'options' => array('1' => 'Enable', '0' => 'Disable')
77
+ ));
78
+ $this->addColumn('action', array(
79
+ 'header' => Mage::helper('carebyzinc')->__('Action'),
80
+ 'width' => '100',
81
+ 'type' => 'action',
82
+ 'getter' => 'getId',
83
+ 'actions' => array(
84
+ array(
85
+ 'caption' => Mage::helper('carebyzinc')->__('Edit'),
86
+ 'url' => array('base'=> '*/*/edit'),
87
+ 'title' => 'Edit',
88
+ 'field' => 'id'
89
+ )
90
+ ),
91
+ 'filter' => false,
92
+ 'sortable' => false,
93
+ 'index' => 'stores',
94
+ 'is_system' => true,
95
+ ));
96
+ return $this;
97
+ }
98
+
99
+ protected function _prepareMassaction()
100
+ {
101
+ $this->setMassactionIdField('entity_id');
102
+ $this->getMassactionBlock()->setFormFieldName('product');
103
+
104
+ $carebyzinc = Mage::getSingleton('carebyzinc/carebyzinc')->getOptionArray();
105
+
106
+ $this->getMassactionBlock()->addItem('zinc_carebyzinc', array(
107
+ 'label'=> Mage::helper('carebyzinc')->__('Change Care by Zinc'),
108
+ 'url' => $this->getUrl('adminhtml/product/massCarebyzinc', array('_current'=>true,'pid'=>1)),
109
+ 'additional' => array(
110
+ 'visibility' => array(
111
+ 'name' => 'zinc_carebyzinc',
112
+ 'type' => 'select',
113
+ 'class' => 'required-entry',
114
+ 'values' => $carebyzinc
115
+ )
116
+ )
117
+ ));
118
+ $this->getMassactionBlock()->addItem('carebyzinc_category', array(
119
+ 'label'=> Mage::helper('carebyzinc')->__('Change Category'),
120
+ 'url' => $this->getUrl('adminhtml/product/massCategory', array('_current'=>true,'pid'=>1)),
121
+ 'additional' => array(
122
+ 'visibility' => array(
123
+ 'name' => 'carebyzinc_category',
124
+ 'type' => 'select',
125
+ 'class' => 'required-entry',
126
+ 'values' => Mage::getModel('carebyzinc/carebyzinc')->getCategoryArray()
127
+ )
128
+ )
129
+ ));
130
+
131
+
132
+
133
+ return $this;
134
+ }
135
+
136
+ public function getRowUrl($row)
137
+ {
138
+ return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
139
+ }
140
+ public function getGridUrl(){
141
+ return $this->getUrl('*/*/grid', array('_current'=>true));
142
+ }
143
+
144
+ }
app/code/local/Zinc/Carebyzinc/Block/Adminhtml/System/Config/Tokenvalidate.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Adminhtml_System_Config_Tokenvalidate extends Mage_Adminhtml_Block_System_Config_Form_Field
9
+ {
10
+ /*
11
+ * Set template
12
+ */
13
+ protected function _construct()
14
+ {
15
+ parent::_construct();
16
+ $this->setTemplate('carebyzinc/system/tokenvalidate.phtml');
17
+ }
18
+
19
+ /**
20
+ * Return element html
21
+ *
22
+ * @param Varien_Data_Form_Element_Abstract $element
23
+ * @return string
24
+ */
25
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
26
+ {
27
+ return $this->_toHtml();
28
+ }
29
+
30
+ /**
31
+ * Return ajax url for button
32
+ *
33
+ * @return string
34
+ */
35
+ public function getAjaxCheckUrl()
36
+ {
37
+ return Mage::helper('adminhtml')->getUrl('adminhtml/carebyzinc/validate');
38
+ }
39
+
40
+ /**
41
+ * Generate button html
42
+ *
43
+ * @return string
44
+ */
45
+ public function getButtonHtml()
46
+ {
47
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
48
+ ->setData(array(
49
+ 'id' => 'validate_button',
50
+ 'label' => $this->helper('adminhtml')->__('Validate Token'),
51
+ 'onclick' => 'javascript:validate(); return false;'
52
+ ));
53
+
54
+ return $button->toHtml();
55
+ }
56
+ }
app/code/local/Zinc/Carebyzinc/Block/Carebyzinc.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Block_Carebyzinc extends Mage_Core_Block_Template
9
+ {
10
+ public function _prepareLayout()
11
+ {
12
+ return parent::_prepareLayout();
13
+ }
14
+
15
+ public function getCarebyzinc()
16
+ {
17
+ if (!$this->hasData('carebyzinc')) {
18
+ $this->setData('carebyzinc', Mage::registry('carebyzinc'));
19
+ }
20
+ return $this->getData('carebyzinc');
21
+
22
+ }
23
+ }
app/code/local/Zinc/Carebyzinc/Helper/Data.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+ public function getTitle(){
11
+ $config = Mage::getStoreConfig('carebyzinc/general/carebytitle');
12
+ return $config;
13
+ }
14
+ public function getZipCode(){
15
+
16
+ $zip = '';
17
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
18
+ $primaryAddress = Mage::getSingleton('customer/session')->getCustomer()->getPrimaryShippingAddress();
19
+ if($primaryAddress->getPostcode()){
20
+ $zip = $primaryAddress->getPostcode();
21
+ }
22
+ }
23
+ if(! $zip){
24
+ $url = 'http://freegeoip.net/json/'.$_SERVER['REMOTE_ADDR'];
25
+ $response = $this->callApi($url);
26
+ $responseArray = (array)json_decode($response);
27
+ $zip = $responseArray['zip_code'];
28
+ if(! $zip)
29
+ $zip = Mage::getStoreConfig('carebyzinc/general/defaultzip');
30
+ }
31
+ return $zip;
32
+ }
33
+ public function getDeleteUrl($itemId){
34
+
35
+ return Mage::getUrl('carebyzinc/index/removeWarranty', array('id' => $itemId));
36
+
37
+ }
38
+ public function validatePrice($price){
39
+ if($price >=500)
40
+ return true;
41
+ else
42
+ return false;
43
+
44
+ }
45
+ public function callApi($url){
46
+
47
+ $ch = curl_init($url);
48
+ curl_setopt($ch, CURLOPT_URL, $url);
49
+ curl_setopt($ch, CURLOPT_HEADER ,FALSE);
50
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json"));
51
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER ,TRUE);
52
+ $result = curl_exec($ch);
53
+ curl_close($ch);
54
+ return $result;
55
+ }
56
+ public function checkQuoteVisibility(){
57
+ return Mage::getStoreConfig('carebyzinc/general/showquote');
58
+
59
+ }
60
+ }
app/code/local/Zinc/Carebyzinc/Model/Carebyzinc.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Carebyzinc extends Mage_Core_Model_Abstract
9
+ {
10
+ const WARRANTY_ENABLED = 1;
11
+ const WARRANTY_DISABLED = 0;
12
+
13
+ public function _construct()
14
+ {
15
+ parent::_construct();
16
+ $this->_init('carebyzinc/carebyzinc');
17
+ }
18
+
19
+ static public function getOptionArray()
20
+ {
21
+ return array(
22
+ self::WARRANTY_ENABLED => Mage::helper('carebyzinc')->__('Enabled'),
23
+ self::WARRANTY_DISABLED => Mage::helper('carebyzinc')->__('Disabled')
24
+ );
25
+ }
26
+
27
+
28
+ public function getPriceQuote($product,$zip,$optionPrice)
29
+ {
30
+ $currencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
31
+ $price = $product->getFinalPrice();
32
+ if($optionPrice)
33
+ $price += $optionPrice;
34
+ $userId = $this->getUserId();
35
+ $data = array();
36
+ $data['sku'] = array(
37
+ 'merchant_sku_id' => $product->getId(),
38
+ 'sku_name' => $product->getName(),
39
+ 'variant_id' => '',
40
+ 'category' => $product->getCarebyzincCategory(),
41
+ 'subcategory' => $product->getCarebyzincSubcategory(),
42
+ 'subcategory2' => '',
43
+ 'description' => $product->getShortDescription(),
44
+ 'price' => $price,
45
+ 'currency' => $currencyCode,
46
+ 'user_id' => $userId
47
+ );
48
+
49
+ if(! $zip){
50
+ $helper = Mage::helper('carebyzinc');
51
+ $zip = $helper->getZipCode();
52
+ }
53
+ $data['zip_code'] = $zip;
54
+ $outData = $this->callApi($data, 'price_quotes/generate');
55
+ if($outData['code'] == '200'){
56
+ $response = $outData['response'];
57
+ $quoteData = json_decode($response, true);
58
+ $priceQuote = array();
59
+ foreach($quoteData['price_quotes'] as $item):
60
+ $priceQuote[$item['id']] = $item;
61
+ endforeach;
62
+ Mage::getSingleton('core/session')->setCareQuote($priceQuote);
63
+ return $priceQuote;
64
+
65
+ }else{
66
+ $response = $outData['response'];
67
+ $response = (array)json_decode($response, true);
68
+ return $response['errors'];
69
+ }
70
+
71
+ }
72
+
73
+ public function getPriceQuoteinCart($product,$itemId,$zip)
74
+ {
75
+
76
+ $currencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
77
+ $_item = Mage::getModel('sales/quote_item')->load($itemId);
78
+ $userId = $this->getUserId();
79
+ $data = array();
80
+ $data['sku'] = array(
81
+ 'merchant_sku_id' => $product->getId(),
82
+ 'sku_name' => $product->getName(),
83
+ 'variant_id' => '',
84
+ 'category' => $product->getCarebyzincCategory(),
85
+ 'subcategory' => $product->getCarebyzincSubcategory(),
86
+ 'subcategory2' => '',
87
+ 'description' => $product->getShortDescription(),
88
+ 'price' => $_item->getPrice(),
89
+ 'currency' => $currencyCode,
90
+ 'user_id' => $userId
91
+ );
92
+ if(! $zip){
93
+ $helper = Mage::helper('carebyzinc');
94
+ $zip = $helper->getZipCode();
95
+ }
96
+ $data['zip_code'] = $zip;
97
+ $outData = $this->callApi($data, 'price_quotes/generate');
98
+ if($outData['code'] == '200'){
99
+ $response = $outData['response'];
100
+ $quoteData = json_decode($response, true);
101
+ $priceQuote = array();
102
+ foreach($quoteData['price_quotes'] as $item):
103
+ $priceQuote[$itemId][$item['id']] = $item;
104
+ endforeach;
105
+ Mage::getSingleton('core/session')->setCareByZincQuote($priceQuote);
106
+ return $priceQuote;
107
+ }else{
108
+ $response = $outData['response'];
109
+ $response = (array)json_decode($response, true);
110
+ return $response['errors'];
111
+ }
112
+
113
+ }
114
+
115
+ public function getApiUrl($action)
116
+ {
117
+ $path = Mage::getStoreConfig('carebyzinc/api/url');
118
+ if((Mage::getStoreConfig('carebyzinc/api/testmode')) == 'live')
119
+ $path = Mage::getStoreConfig('carebyzinc/api/url');
120
+ else
121
+ $path = Mage::getStoreConfig('carebyzinc/api/test_url');
122
+
123
+ $url = $path.'/'.$action;
124
+ return $url;
125
+ }
126
+
127
+ private function getUserId()
128
+ {
129
+ $userId = Mage::getStoreConfig('carebyzinc/api/user_id');
130
+ return $userId;
131
+ }
132
+
133
+ public function callApi($data, $action, $method = 'post'){
134
+ $outData = array();
135
+ $values = json_encode($data);
136
+ $url = $this->getApiUrl($action);
137
+ $uid = $this->getUserId();
138
+ $token = Mage::getStoreConfig('carebyzinc/api/access_token');
139
+ $client = Mage::getStoreConfig('carebyzinc/api/client');
140
+ $header = array( "Content-Type: application/json","uid:$uid","access-token:$token","client:$client","token-type:Bearer");
141
+ $ch = curl_init($url);
142
+ curl_setopt($ch, CURLOPT_URL, $url);
143
+ if($method == 'post'){
144
+ curl_setopt($ch, CURLOPT_POST,TRUE);
145
+ curl_setopt($ch, CURLOPT_POSTFIELDS,$values);
146
+ }
147
+ curl_setopt($ch, CURLOPT_HEADER ,FALSE);
148
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
149
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER ,TRUE);
150
+ $outData['response'] = curl_exec($ch);
151
+ $outData['code'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
152
+ curl_close($ch);
153
+ return $outData;
154
+ }
155
+
156
+ public function getwarrantyStatus( $item_id )
157
+ {
158
+ if($item_id < 0){
159
+ return '';
160
+ }
161
+ $cart = Mage::getSingleton('checkout/cart');
162
+ $quoteItem = $cart->getQuote()->getItemById($item_id);
163
+ $product = Mage::getModel('catalog/product')->load($quoteItem->getProductId());
164
+ if(($product->getCarebyzinc() != 1) && ($quoteItem->getCarebyzincOption())){
165
+ if ($additionalOption = $quoteItem->getOptionByCode('additional_options'))
166
+ {
167
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
168
+ }
169
+ $additionalOptionsArray = array();
170
+ foreach($additionalOptions as $option){
171
+ if($option['label'] != 'carebyzinc')
172
+ $additionalOptionsArray[] = $option;
173
+ }
174
+ $quoteItem->setCarebyzincOption('');
175
+
176
+ if(! empty($additionalOptionsArray)){
177
+ $quoteItem->addOption(array( 'product_id' => $quoteItem->getProductId(),
178
+ 'code' => 'additional_options',
179
+ 'value' => serialize($additionalOptionsArray)
180
+ ));
181
+ }else{
182
+ $quoteItem->getOptionByCode('additional_options')->delete();
183
+ }
184
+ $productPrice = $quoteItem->getProduct()->getFinalPrice();
185
+ $quoteItem->setCustomPrice($productPrice);
186
+ $quoteItem->setOriginalCustomPrice($productPrice);
187
+ $quoteItem->getProduct()->setIsSuperMode(true);
188
+ $quoteItem->save();
189
+ $cart->getQuote()->collectTotals()->save();
190
+
191
+ }
192
+ return true;
193
+ }
194
+ public function getCategoryArray()
195
+ {
196
+
197
+
198
+ $dataArray = $this->getCategoryJson();
199
+ $category = array(''=>'Please Select');
200
+ foreach($dataArray as $key => $value){
201
+ $category[$key] = $key;
202
+ }
203
+ return $category;
204
+
205
+ }
206
+ public function getSubCategoryArray($category)
207
+ {
208
+ if($category)
209
+ $dataArray = $this->getCategoryJson();
210
+ $subcategory = array();
211
+ foreach($dataArray as $key => $value){
212
+ if($key == $category){
213
+ foreach($value as $val){
214
+ $subcategory[$val] = $val;
215
+ }
216
+ }
217
+ }
218
+ return $subcategory;
219
+
220
+ }
221
+ public function getCategoryJson()
222
+ {
223
+
224
+ $outData = $this->callApi('','categories','get');
225
+ if($outData['code'] == '200')
226
+ $response = $outData['response'];
227
+ else
228
+ $response = '{"Jewelry": ["Bracelet", "Necklace","Pendant","Brooch","Engagement Ring","Wedding Ring","Other Ring","Other"]}';
229
+ $dataArray = json_decode($response);
230
+ return $dataArray;
231
+
232
+ }
233
+
234
+
235
+ }
app/code/local/Zinc/Carebyzinc/Model/Checkout/Cart.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Checkout_Cart extends Mage_Checkout_Model_Cart
9
+ {
10
+ /**
11
+ * Add product to shopping cart (quote)
12
+ *
13
+ * @param int|Mage_Catalog_Model_Product $productInfo
14
+ * @param mixed $requestInfo
15
+ * @return Mage_Checkout_Model_Cart
16
+ */
17
+ public function addProduct($productInfo, $requestInfo=null)
18
+ {
19
+ $product = $this->_getProduct($productInfo);
20
+ $request = $this->_getProductRequest($requestInfo);
21
+ $productId = $product->getId();
22
+ $flag = 0;$qty = 0;
23
+ $productType = $product->getTypeId();
24
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1))
25
+ {
26
+ $flag = 1;
27
+ $qty = $request->getQty();
28
+ $request['qty'] = 1;
29
+ }
30
+ if ($product->getStockItem()) {
31
+ $minimumQty = $product->getStockItem()->getMinSaleQty();
32
+ //If product was not found in cart and there is set minimal qty for it
33
+ if ($minimumQty && $minimumQty > 0 && $request->getQty() < $minimumQty
34
+ && !$this->getQuote()->hasProductId($productId)
35
+ ){
36
+ $request->setQty($minimumQty);
37
+ }
38
+ }
39
+ if($flag){
40
+ $helper = Mage::helper('carebyzinc');
41
+
42
+
43
+ if ($productId) {
44
+ try {
45
+ for($i= 0;$i<$qty;$i++){
46
+ $additionalOptions = array();
47
+ $product = Mage::getModel('catalog/product')
48
+ ->setStoreId(Mage::app()->getStore()->getId())
49
+ ->load($productId);
50
+ $result = $this->getQuote()->addProduct($product, $request);
51
+ if(is_object($result)){
52
+ $result = ( $result->getParentItem() ? $result->getParentItem() : $result );
53
+ $carebyzincId = $request->getCarebyzincOption();
54
+ $priceQuote = Mage::getSingleton('core/session')->getCareQuote();
55
+ $carebyzincAry = $priceQuote[$carebyzincId];
56
+ $productPrice = $result->getProduct()->getFinalPrice();
57
+ $valid = $helper->validatePrice($productPrice);
58
+ if($valid){
59
+ if($price = $carebyzincAry['price_per_year']){
60
+ $newPrice = $productPrice + $price;
61
+ $result->setCustomPrice($newPrice);
62
+ $result->setOriginalCustomPrice($newPrice);
63
+ $result->setCarebyzincPrice($price);
64
+ $result->getProduct()->setIsSuperMode(true);
65
+ }
66
+ if ($additionalOption = $result->getOptionByCode('additional_options'))
67
+ {
68
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
69
+ }
70
+
71
+ if( $item = $priceQuote[$carebyzincId]){
72
+ $additionalOptions[] = array(
73
+ 'label' => 'carebyzinc',
74
+ 'value' => $carebyzincId,
75
+ );
76
+ $result->setCarebyzincOption(serialize($priceQuote[$carebyzincId]));
77
+
78
+
79
+ }else{
80
+ $additionalOptions[] = array(
81
+ 'label' => 'carebyzinc',
82
+ 'value' => '',
83
+ );
84
+
85
+
86
+
87
+ }
88
+ $result->addOption(array(
89
+ 'product_id' => $result->getProductId(),
90
+ 'code' => 'additional_options',
91
+ 'value' => serialize($additionalOptions)
92
+ ));
93
+ $this->getQuote()->save();
94
+ }
95
+ }}
96
+ } catch (Mage_Core_Exception $e) {
97
+ $this->getCheckoutSession()->setUseNotice(false);
98
+ $result = $e->getMessage();
99
+ }
100
+ /**
101
+ * String we can get if prepare process has error
102
+ */
103
+ if (is_string($result)) {
104
+ $redirectUrl = ($product->hasOptionsValidationFail())
105
+ ? $product->getUrlModel()->getUrl(
106
+ $product,
107
+ array('_query' => array('startcustomization' => 1))
108
+ )
109
+ : $product->getProductUrl();
110
+ $this->getCheckoutSession()->setRedirectUrl($redirectUrl);
111
+ if ($this->getCheckoutSession()->getUseNotice() === null) {
112
+ $this->getCheckoutSession()->setUseNotice(true);
113
+ }
114
+ Mage::throwException($result);
115
+ }
116
+ } else {
117
+ Mage::throwException(Mage::helper('checkout')->__('The product does not exist.'));
118
+ }
119
+
120
+ Mage::dispatchEvent('checkout_cart_product_add_after', array('quote_item' => $result, 'product' => $product));
121
+ $this->getCheckoutSession()->setLastAddedProductId($productId);
122
+ //}Mage::getSingleton('core/session')->unsCareQuote();
123
+ }else{
124
+ if ($productId) {
125
+ try {
126
+ $result = $this->getQuote()->addProduct($product, $request);
127
+
128
+ } catch (Mage_Core_Exception $e) {
129
+ $this->getCheckoutSession()->setUseNotice(false);
130
+ $result = $e->getMessage();
131
+ }
132
+ /**
133
+ * String we can get if prepare process has error
134
+ */
135
+ if (is_string($result)) {
136
+ $redirectUrl = ($product->hasOptionsValidationFail())
137
+ ? $product->getUrlModel()->getUrl(
138
+ $product,
139
+ array('_query' => array('startcustomization' => 1))
140
+ )
141
+ : $product->getProductUrl();
142
+ $this->getCheckoutSession()->setRedirectUrl($redirectUrl);
143
+ if ($this->getCheckoutSession()->getUseNotice() === null) {
144
+ $this->getCheckoutSession()->setUseNotice(true);
145
+ }
146
+ Mage::throwException($result);
147
+ }
148
+ }else {
149
+ Mage::throwException(Mage::helper('checkout')->__('The product does not exist.'));
150
+ }
151
+
152
+ Mage::dispatchEvent('checkout_cart_product_add_after', array('quote_item' => $result, 'product' => $product));
153
+ $this->getCheckoutSession()->setLastAddedProductId($productId);
154
+ }
155
+
156
+ return $this;
157
+ }
158
+ }
app/code/local/Zinc/Carebyzinc/Model/Entity/Category.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Zinc_Carebyzinc_Model_Entity_Category extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
10
+ {
11
+ public function getAllOptions()
12
+ {
13
+ $this->_options = array();
14
+ $this->_options = Mage::getModel('carebyzinc/carebyzinc')->getCategoryArray();
15
+ return $this->_options;
16
+ }
17
+ }
app/code/local/Zinc/Carebyzinc/Model/Entity/Subcategory.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Zinc_Carebyzinc_Model_Entity_Subcategory extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
10
+ {
11
+ public function getAllOptions()
12
+ {
13
+ $this->_options = array();
14
+ if($category = Mage::registry('current_product')->getCarebyzincCategory())
15
+ $this->_options = Mage::getModel('carebyzinc/carebyzinc')->getSubcategoryArray($category);
16
+ return $this->_options;
17
+ }
18
+ }
app/code/local/Zinc/Carebyzinc/Model/Mysql4/Order.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Mysql4_Order extends Mage_Core_Model_Mysql4_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ $this->_init('carebyzinc/order', 'id');
13
+ }
14
+ }
app/code/local/Zinc/Carebyzinc/Model/Mysql4/Order/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Mysql4_Order_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('carebyzinc/order');
14
+ }
15
+ }
app/code/local/Zinc/Carebyzinc/Model/Observer.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Observer{
9
+
10
+
11
+
12
+ public function saveCarebyzinc($observer)
13
+ {
14
+ if(!Mage::registry('carebyzinc_save')):
15
+ $order = $observer->getEvent()->getOrder();
16
+ $model = Mage::getModel('carebyzinc/order');
17
+ $model->savePolicy($order);
18
+ Mage::register('carebyzinc_save',true);
19
+ endif;
20
+
21
+ }
22
+ public function cartLoad($observer)
23
+ {
24
+ if( ! Mage::getStoreConfig('carebyzinc/general/enabled')){
25
+ $cartHelper = Mage::helper('checkout/cart');
26
+ $cart = Mage::getModel('checkout/cart')->getQuote();
27
+ foreach ($cart->getAllItems() as $item) {
28
+ if($item->getCarebyzincOption()){
29
+ $cartHelper->getCart()->removeItem($item->getId())->save();
30
+ }
31
+ $additionalOptions = array();
32
+ $item->addOption(array(
33
+ 'product_id' => $item->getProductId(),
34
+ 'code' => 'additional_options',
35
+ 'value' => serialize($additionalOptions)
36
+ ));
37
+ $item->save();
38
+ }
39
+
40
+
41
+ }
42
+
43
+ }
44
+
45
+
46
+
47
+ }
app/code/local/Zinc/Carebyzinc/Model/Order.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Order extends Mage_Core_Model_Abstract
9
+ {
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('carebyzinc/order');
14
+ }
15
+
16
+
17
+ public function savePolicy($order)
18
+ {
19
+ $data = array();
20
+ $currencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
21
+ $data['user_id'] = $this->getUserId();
22
+ $data['customer'] = $this->getUserAddress($order);
23
+ $carebyItem = 0;
24
+ $orderItems = $order->getAllVisibleItems();
25
+ $model = Mage::getModel('carebyzinc/carebyzinc');
26
+ foreach($orderItems as $item){
27
+ if($item->getCarebyzincOption()){
28
+ $carebyItem++;
29
+ $policyNo = '';
30
+ $carebyzincAry = (array) unserialize($item->getCarebyzincOption()) ;
31
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
32
+ $data['price_quote_id'] = $carebyzincAry['id'];
33
+ $data['sku_id'] = $carebyzincAry['sku_id'];
34
+ $result = $model->callApi($data, 'policies');
35
+ $policyAry = $result['response'];
36
+ if($result['code'] == 200){
37
+ $policyArray = (array) json_decode($policyAry);
38
+ $policyNo = $policyArray['policy_id'];
39
+ }
40
+ $careOrder = Mage::getModel('carebyzinc/order');
41
+ $careOrder->setOrderId($order->getId());
42
+ $careOrder->setProductId($item->getProductId());
43
+ $careOrder->setCustomerId($order->getCustomerId());
44
+ $careOrder->setProductName($product->getName());
45
+ $careOrder->setProductSku($product->getSku());
46
+ $careOrder->setCarebyzincKey($policyNo);
47
+ $careOrder->setOrderIncId($order->getIncrementId());
48
+ $careOrder->setItemId($item->getId());
49
+ $careOrder->setWarrentyPrice($carebyzincAry['price_per_year']);
50
+ $price = $item->getPrice() - $carebyzincAry['price_per_year'];
51
+ $careOrder->setProductPrice($price);
52
+ $careOrder->setCarebyzincProvider($carebyzincAry['provider']);
53
+ $name = $order->getCustomerFirstname(). ' '. $order->getCustomerLastname();
54
+ $careOrder->setCustomerName($name);
55
+ $careOrder->setCustomerEmail($order->getCustomerEmail());
56
+ $careOrder->setCreatedTime(now());
57
+ $careOrder->save();
58
+ }
59
+ }
60
+ if($carebyItem){
61
+ $fromname = Mage::getStoreConfig('trans_email/ident_general/name');
62
+ $fromemail = Mage::getStoreConfig('trans_email/ident_general/email');
63
+ $translate = Mage::getSingleton('core/translate');
64
+ $email = 'support@zincplatform.com';
65
+ $name = 'Zinc';
66
+ $templateId = Mage::getStoreConfig('sales_email/order/template');
67
+ if($email){
68
+ $storeObj = Mage::getModel('core/store')->load($order->getStoreId());
69
+ $anyDate = $order->getCreatedAt();
70
+ $dateTimestamp = Mage::getModel('core/date')->timestamp(strtotime($anyDate));
71
+ $date = date("Y-m-d",$dateTimestamp);
72
+ $subject = $this->getUserId().'_policyid_'.$storeObj->getFrontendName().'_'.$date;
73
+ $emailTemplate = Mage::getModel('core/email_template')->loadDefault('sales_email_order_template');
74
+ $emailTemplateVariables = array();
75
+ $emailTemplateVariables['order'] = $order;
76
+ $emailTemplateVariables['store'] = $storeObj;
77
+ $emailTemplate->setSenderName($fromname);
78
+ $emailTemplate->setSenderEmail($fromemail);
79
+ $emailTemplate->setType('html');
80
+ $emailTemplate->setTemplateSubject($subject);
81
+ $emailTemplate->send($email, $name, $emailTemplateVariables);
82
+
83
+
84
+ }
85
+
86
+ }
87
+ }
88
+
89
+ private function getUserId()
90
+ {
91
+ $userId = Mage::getStoreConfig('carebyzinc/api/user_id');
92
+ return $userId;
93
+ }
94
+
95
+ public function getUserAddress($order)
96
+ {
97
+ $address ['first_name'] = $order->getCustomerFirstname();
98
+ $address ['last_name'] = $order->getCustomerLastname();
99
+ $address ['transaction_currency'] = $order->getOrderCurrencyCode();
100
+ $address ['email'] = $order->getCustomerEmail();
101
+ $billingAddress = $order->getBillingAddress();
102
+ $address ['main_phone_number'] = $billingAddress->getTelephone();
103
+ $address ['country'] = $billingAddress->getCountryId();
104
+ $address ['address'] = array(
105
+ "billing_city" => $billingAddress->getCity(),
106
+ "billing_zip_code" => $billingAddress->getPostcode(),
107
+ "billing_state" => $billingAddress->getRegion(),
108
+ "billing_address1" => $billingAddress->getStreet(),
109
+ );
110
+
111
+ return $address;
112
+
113
+ }
114
+ }
app/code/local/Zinc/Carebyzinc/Model/Sales/Quote.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_Sales_Quote extends Mage_Sales_Model_Quote
9
+ {
10
+ /**
11
+ * Retrieve quote item by product id
12
+ *
13
+ * @param Mage_Catalog_Model_Product $product
14
+ * @return Mage_Sales_Model_Quote_Item || false
15
+ */
16
+ public function getItemByProduct($product)
17
+ {
18
+ $product = Mage::getModel('catalog/product')->load($product);
19
+ $productType = $product->getTypeId();
20
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1))
21
+ return false;
22
+ else{
23
+ foreach ($this->getAllItems() as $item) {
24
+ if ($item->representProduct($product)) {
25
+ return $item;
26
+ }
27
+ }
28
+ }
29
+ return false;
30
+ }
31
+ }
app/code/local/Zinc/Carebyzinc/Model/System/Config/Source.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Model_System_Config_Source
9
+ {
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array(
14
+ 'value' => 'test',
15
+ 'label' => 'Test Mode',
16
+ ),
17
+ array(
18
+ 'value' => 'live',
19
+ 'label' => 'Production Mode',
20
+ ),
21
+ );
22
+ }
23
+ }
app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/CarebyzincController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Adminhtml_CarebyzincController extends Mage_Adminhtml_Controller_action
9
+ {
10
+ public function validateAction()
11
+ {
12
+ $data['uid'] = Mage::getStoreConfig('carebyzinc/api/user_id');
13
+ $data['access-token'] = Mage::getStoreConfig('carebyzinc/api/access_token');
14
+ $data['client'] = Mage::getStoreConfig('carebyzinc/api/client');
15
+
16
+ $model = Mage::getModel('carebyzinc/carebyzinc');
17
+ $result = $model->callApi($data,'auth/validate_token','get');
18
+ if($result['code'] == 200)
19
+ $response = 'Success';
20
+ else
21
+ $response = 'Error';
22
+ Mage::app()->getResponse()->setBody($response);
23
+ }
24
+
25
+ }
app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/OrderController.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Adminhtml_OrderController extends Mage_Adminhtml_Controller_action
9
+ {
10
+
11
+ protected function _initAction() {
12
+ $this->loadLayout()
13
+ ->_setActiveMenu('carebyzinc/order')
14
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Carebyzinc Orders'), Mage::helper('adminhtml')->__('Carebyzinc Orders'));
15
+
16
+ return $this;
17
+ }
18
+
19
+ public function indexAction() {
20
+ $this->_initAction()
21
+ ->renderLayout();
22
+ }
23
+
24
+
25
+ }
app/code/local/Zinc/Carebyzinc/controllers/Adminhtml/ProductController.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_Adminhtml_ProductController extends Mage_Adminhtml_Controller_action
9
+ {
10
+
11
+ protected function _initAction() {
12
+ $this->loadLayout()
13
+ ->_setActiveMenu('carebyzinc/product')
14
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Care by Zinc'), Mage::helper('adminhtml')->__('Care by Zinc'));
15
+
16
+ return $this;
17
+ }
18
+
19
+ public function indexAction() {
20
+ $this->_initAction()
21
+ ->renderLayout();
22
+ }
23
+
24
+
25
+ public function orderAction() {
26
+ $this->_initAction()
27
+ ->renderLayout();
28
+ }
29
+ public function gridAction()
30
+ {
31
+ $this->loadLayout();
32
+ $this->renderLayout();
33
+ }
34
+ /**
35
+ * Edit Carebyzinc status action
36
+ *
37
+ */
38
+ public function editAction() {
39
+ $id = $this->getRequest()->getParam('id');
40
+ $model = Mage::getModel('catalog/product')->load($id);
41
+ if ($model->getId() || $id == 0) {
42
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
43
+ if (!empty($data)) {
44
+ $model->setData($data);
45
+ }
46
+
47
+ Mage::register('carebyzinc_data', $model);
48
+ $this->loadLayout();
49
+ $this->_setActiveMenu('carebyzinc/products');
50
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
51
+ $this->_addContent($this->getLayout()->createBlock('carebyzinc/adminhtml_product_edit'))
52
+ ->_addLeft($this->getLayout()->createBlock('carebyzinc/adminhtml_product_edit_tabs'));
53
+ $this->renderLayout();
54
+ } else {
55
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('carebyzinc')->__('Item does not exist'));
56
+ $this->_redirect('*/*/');
57
+ }
58
+ }
59
+ /**
60
+ * Update product(s) status action
61
+ *
62
+ */
63
+ public function saveAction()
64
+ {
65
+ $post = $this->getRequest()->getPost();
66
+ $id = $this->getRequest()->getParam('id');
67
+ $model = Mage::getModel('catalog/product')->load($id);
68
+ $model->setCarebyzincCategory($post['category']);
69
+ $model->setCarebyzincSubcategory($post['subcategory']);
70
+ $model->setCarebyzinc($post['carebyzinc']);
71
+ $model->save();
72
+ $this->_redirect('*/*/');
73
+ return;
74
+
75
+ }
76
+
77
+ /**
78
+ * Update product(s) status action
79
+ *
80
+ */
81
+ public function massCarebyzincAction()
82
+ {
83
+ $productIds = (array)$this->getRequest()->getParam('product');
84
+ $carebyzinc = (int)$this->getRequest()->getParam('zinc_carebyzinc');
85
+
86
+ try {
87
+ $this->_validateMassCarebyzinc($productIds, $carebyzinc);
88
+ Mage::getSingleton('catalog/product_action')
89
+ ->updateAttributes($productIds, array('carebyzinc' => $carebyzinc));
90
+
91
+ $this->_getSession()->addSuccess(
92
+ $this->__('Total of %d record(s) have been updated.', count($productIds))
93
+ );
94
+ }
95
+ catch (Mage_Core_Model_Exception $e) {
96
+ $this->_getSession()->addError($e->getMessage());
97
+ } catch (Mage_Core_Exception $e) {
98
+ $this->_getSession()->addError($e->getMessage());
99
+ } catch (Exception $e) {
100
+ $this->_getSession()
101
+ ->addException($e, $this->__('An error occurred while updating the product(s)'));
102
+ }
103
+ if($this->getRequest()->getParam('pid'))
104
+ $this->_redirect('*/*/');
105
+ else
106
+ $this->_redirect('adminhtml/catalog_product/index');
107
+ }
108
+
109
+ /**
110
+ * Update product(s) category action
111
+ *
112
+ */
113
+ public function massCategoryAction()
114
+ {
115
+ $productIds = (array)$this->getRequest()->getParam('product');
116
+ $category = $this->getRequest()->getParam('carebyzinc_category');
117
+ $subCat = 'Other';
118
+ if(!is_array($productIds)) {
119
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('carebyzinc')->__('Please select Product(s).'));
120
+ }else {
121
+ try {
122
+ $this->_validateMassCarebyzinc($productIds, $category);
123
+ $subCategories = Mage::getModel('carebyzinc/carebyzinc')->getSubCategoryArray($category);
124
+ foreach ($productIds as $product_id) {
125
+ $productModel = Mage::getModel('catalog/product')->load($product_id);
126
+ $name = $productModel->getName();
127
+ foreach($subCategories as $subcat){
128
+ if (stripos($name, $subcat) !== false) {
129
+ $subCat = $subcat;
130
+ break;
131
+ }
132
+ }
133
+ $productModel->setCarebyzincCategory($category);
134
+ $productModel->setCarebyzincSubcategory($subCat);
135
+ $productModel->save();
136
+
137
+ }
138
+
139
+ $this->_getSession()->addSuccess(
140
+ $this->__('Total of %d record(s) have been updated.', count($productIds))
141
+ );
142
+ }
143
+ catch (Mage_Core_Model_Exception $e) {
144
+ $this->_getSession()->addError($e->getMessage());
145
+ } catch (Mage_Core_Exception $e) {
146
+ $this->_getSession()->addError($e->getMessage());
147
+ } catch (Exception $e) {
148
+ $this->_getSession()
149
+ ->addException($e, $this->__('An error occurred while updating the product(s)'));
150
+ }
151
+ }
152
+ if($this->getRequest()->getParam('pid'))
153
+ $this->_redirect('*/*/');
154
+ else
155
+ $this->_redirect('adminhtml/catalog_product/index');
156
+ }
157
+
158
+ public function _validateMassCarebyzinc(array $productIds, $carebyzinc)
159
+ {
160
+ if (!Mage::getModel('catalog/product')->isProductsHasSku($productIds)) {
161
+ throw new Mage_Core_Exception(
162
+ $this->__('Some of the processed products have no SKU value defined. Please fill it prior to performing operations on these products.')
163
+ );
164
+ }
165
+ }
166
+
167
+ public function getSubcategoriesAction()
168
+ {
169
+ $cid = $this->getRequest()->getParam('cat');
170
+ $subCategories = Mage::getModel('carebyzinc/carebyzinc')->getSubCategoryArray($cid);
171
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($subCategories));
172
+
173
+ }
174
+ }
app/code/local/Zinc/Carebyzinc/controllers/CartController.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ /**
10
+ * Shopping cart controller
11
+ */
12
+ require_once 'Mage/Checkout/controllers/CartController.php';
13
+ class Zinc_Carebyzinc_CartController extends Mage_Checkout_CartController
14
+ {
15
+ /**
16
+ * Update product configuration for a cart item
17
+ */
18
+ public function updateItemOptionsAction()
19
+ {
20
+ $cart = $this->_getCart();
21
+ $id = (int) $this->getRequest()->getParam('id');
22
+ $params = $this->getRequest()->getParams();
23
+ if (!isset($params['options'])) {
24
+ $params['options'] = array();
25
+ }
26
+
27
+ try {
28
+ $quoteItem = $cart->getQuote()->getItemById($id);
29
+ if (!$quoteItem) {
30
+ Mage::throwException($this->__('Quote item is not found.'));
31
+ }
32
+
33
+ $product = Mage::getModel('catalog/product')->load($quoteItem->getProductId());
34
+ $productType = $product->getTypeId();
35
+ $carebyzinc = '';
36
+ $flag = 0;$price = 0;
37
+ $additionalOptions = array();
38
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1))
39
+ {
40
+ $newPrice = $quoteItem->getPrice();
41
+ $qty = 1;
42
+ $flag = 1;
43
+ }
44
+
45
+ if (isset($params['qty'])) {
46
+ if($flag){
47
+ $qty = $params['qty'];
48
+ $params['qty'] = 1;
49
+ }
50
+ $filter = new Zend_Filter_LocalizedToNormalized(
51
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
52
+ );
53
+ $params['qty'] = $filter->filter($params['qty']);
54
+ }
55
+
56
+ if($flag)
57
+ {
58
+ $carebyzincOption = $params['carebyzinc_option'];
59
+ if ($additionalOption = $quoteItem->getOptionByCode('additional_options'))
60
+ {
61
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
62
+ }
63
+ if($carebyzincOption){
64
+ $priceQuote = Mage::getSingleton('core/session')->getCareQuote();
65
+ $carebyzincAry = $priceQuote[$carebyzincOption];
66
+ $price = $carebyzincAry['price_per_year']?$carebyzincAry['price_per_year']:0;
67
+ $carebyzinc = serialize($priceQuote[$carebyzincOption]);
68
+ foreach($additionalOptions as $option){
69
+ if($option['label'] == 'carebyzinc'){
70
+ $option['value'] = $carebyzincOption;
71
+ break;
72
+ }
73
+ }
74
+
75
+ Mage::getSingleton('core/session')->unsCareQuote();
76
+
77
+ }else{
78
+ $carebyzinc = $quoteItem->getCarebyzincOption();
79
+ $price = $quoteItem->getCarebyzincPrice();
80
+ }
81
+
82
+ }
83
+ $item = $cart->updateItem($id, new Varien_Object($params));
84
+
85
+ if($flag){
86
+ $productPrice = $item->getProduct()->getFinalPrice();
87
+ $newPrice = $productPrice + $price;
88
+ if($carebyzinc){
89
+ $item->setCarebyzincOption($carebyzinc);
90
+ $item->addOption(array(
91
+ 'product_id' => $item->getProductId(),
92
+ 'code' => 'additional_options',
93
+ 'value' => serialize($additionalOptions)
94
+ ));
95
+ $item->setCarebyzincPrice($price);
96
+ $item->setCustomPrice($newPrice);
97
+ $item->setOriginalCustomPrice($newPrice);
98
+ $item->getProduct()->setIsSuperMode(true);
99
+ }
100
+ if($qty >1){
101
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
102
+ for($i = 1;$i<=($qty-1);$i++){
103
+ $result = $quote->addProduct($product, $item->getBuyRequest());
104
+ $result = ( $result->getParentItem() ? $result->getParentItem() : $result );
105
+ if($carebyzinc){
106
+ $result->setCarebyzincOption($carebyzinc);
107
+ $result->setCarebyzincPrice($price);
108
+ $result->addOption(array(
109
+ 'product_id' => $item->getProductId(),
110
+ 'code' => 'additional_options',
111
+ 'value' => serialize($additionalOptions)
112
+ ));
113
+
114
+ $result->setCustomPrice($newPrice);
115
+ $result->setOriginalCustomPrice($newPrice);
116
+ }
117
+ }
118
+ }
119
+
120
+ }
121
+
122
+ if (is_string($item)) {
123
+ Mage::throwException($item);
124
+ }
125
+ if ($item->getHasError()) {
126
+ Mage::throwException($item->getMessage());
127
+ }
128
+
129
+ $related = $this->getRequest()->getParam('related_product');
130
+ if (!empty($related)) {
131
+ $cart->addProductsByIds(explode(',', $related));
132
+ }
133
+
134
+ $cart->save();
135
+
136
+ $this->_getSession()->setCartWasUpdated(true);
137
+
138
+ Mage::dispatchEvent('checkout_cart_update_item_complete',
139
+ array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())
140
+ );
141
+ if (!$this->_getSession()->getNoCartRedirect(true)) {
142
+ if (!$cart->getQuote()->getHasError()) {
143
+ $message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->escapeHtml($item->getProduct()->getName()));
144
+ $this->_getSession()->addSuccess($message);
145
+ }
146
+ $this->_goBack();
147
+ }
148
+ } catch (Mage_Core_Exception $e) {
149
+ if ($this->_getSession()->getUseNotice(true)) {
150
+ $this->_getSession()->addNotice($e->getMessage());
151
+ } else {
152
+ $messages = array_unique(explode("\n", $e->getMessage()));
153
+ foreach ($messages as $message) {
154
+ $this->_getSession()->addError($message);
155
+ }
156
+ }
157
+
158
+ $url = $this->_getSession()->getRedirectUrl(true);
159
+ if ($url) {
160
+ $this->getResponse()->setRedirect($url);
161
+ } else {
162
+ $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
163
+ }
164
+ } catch (Exception $e) {
165
+ $this->_getSession()->addException($e, $this->__('Cannot update the item.'));
166
+ Mage::logException($e);
167
+ $this->_goBack();
168
+ }
169
+ $this->_redirect('*/*');
170
+ }
171
+
172
+ /**
173
+ * Update customer's shopping cart
174
+ */
175
+ protected function _updateShoppingCart()
176
+ {
177
+ try {
178
+ $cartData = $this->getRequest()->getParam('cart');
179
+ if (is_array($cartData)) {
180
+ $filter = new Zend_Filter_LocalizedToNormalized(
181
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
182
+ );
183
+ $cart = $this->_getCart();
184
+ foreach ($cartData as $index => $data) {
185
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
186
+ $oldQuoteItem = $quote->getItemById($index);
187
+ $flag = 0;
188
+ if($oldQuoteItem){
189
+ $product = Mage::getModel('catalog/product')
190
+ ->setStoreId(Mage::app()->getStore()->getId())
191
+ ->load($oldQuoteItem->getProductId());
192
+ $productType = $product->getTypeId();
193
+ $newPrice = 0;$price = 0;$additionalOptions = array();
194
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1))
195
+ {
196
+ $additionalOption = $oldQuoteItem->getOptionByCode('additional_options');
197
+ $newPrice = $oldQuoteItem->getPrice();
198
+ $price = $oldQuoteItem->getCarebyzincPrice();
199
+ $qty = 1;
200
+ $flag = 1;
201
+ if ($additionalOption = $oldQuoteItem->getOptionByCode('additional_options'))
202
+ {
203
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
204
+ }
205
+ }
206
+ if (isset($data['qty'])) {
207
+ if($flag){
208
+ $qty = $data['qty'];
209
+ $data['qty'] = 1;
210
+ }
211
+ $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
212
+ }
213
+ if($flag){
214
+ if($qty >1){
215
+ for($i = 1;$i<=($qty-1);$i++){
216
+
217
+ $result = $quote->addProduct($product, $oldQuoteItem->getBuyRequest());
218
+ $result = ( $result->getParentItem() ? $result->getParentItem() : $result );
219
+ $result->setCarebyzincOption($oldQuoteItem->getCarebyzincOption());
220
+ $result->setCarebyzincPrice($price);
221
+ $result->addOption(array(
222
+ 'product_id' => $result->getProductId(),
223
+ 'code' => 'additional_options',
224
+ 'value' => serialize($additionalOptions)
225
+ ));
226
+
227
+ $result->setCustomPrice($newPrice);
228
+ $result->setOriginalCustomPrice($newPrice);
229
+ }
230
+ }
231
+ }
232
+ }}
233
+
234
+ if (! $cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
235
+ $cart->getQuote()->setCustomerId(null);
236
+ }
237
+
238
+ $cartData = $cart->suggestItemsQty($cartData);
239
+ $cart->updateItems($cartData)
240
+ ->save();
241
+ }
242
+ $this->_getSession()->setCartWasUpdated(true);
243
+ } catch (Mage_Core_Exception $e) {
244
+ $this->_getSession()->addError(Mage::helper('core')->escapeHtml($e->getMessage()));
245
+ } catch (Exception $e) {
246
+ $this->_getSession()->addException($e, $this->__('Cannot update shopping cart.'));
247
+ Mage::logException($e);
248
+ }
249
+ }
250
+
251
+ }
app/code/local/Zinc/Carebyzinc/controllers/IndexController.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Zinc_Carebyzinc_IndexController extends Mage_Core_Controller_Front_Action
9
+ {
10
+ public function indexAction()
11
+ {
12
+ $this->loadLayout();
13
+ $this->renderLayout();
14
+ }
15
+
16
+ public function priceQuoteAction()
17
+ {
18
+ $product_id = $this->getRequest()->getParam('pid');
19
+ $configOptions = $this->getRequest()->getParam('configOptions');
20
+ $customoptionPrice = $this->getRequest()->getParam('customoptionPrice');
21
+
22
+ $configOptionsArray = (array)json_decode($configOptions);
23
+ $zip = $this->getRequest()->getParam('zip');
24
+ if($product_id < 0){
25
+ return '';
26
+ }
27
+ $response = '';
28
+ $this->loadLayout();
29
+ $product = Mage::getModel('catalog/product')->load($product_id);
30
+ if(! empty($configOptionsArray)){
31
+ //$childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes( $configOptionsArray, $product);
32
+ //$product = Mage::getModel('catalog/product')->load($childProduct->getId());
33
+ $attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
34
+ $priceVal = 0;
35
+ foreach ($attributes as $attribute){
36
+ $prices = $attribute->getPrices();
37
+ foreach ($prices as $price){
38
+ foreach($configOptionsArray as $key =>$value){
39
+ if($price['value_index'] == $value ){
40
+ if ($price['is_percent']){
41
+ $priceVal += (float)$price['pricing_value'] * $basePrice / 100;
42
+ }
43
+ else {
44
+ $priceVal += (float)$price['pricing_value'];
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ $customoptionPrice += $priceVal;
51
+
52
+
53
+ }
54
+
55
+ $model = Mage::getModel('carebyzinc/carebyzinc');
56
+ $quoteBlock = $this->getLayout()->createBlock('carebyzinc/carebyzinc');
57
+ $itemId = $this->getRequest()->getParam('itemId');
58
+ if($itemId){
59
+ $response = $model->getPriceQuoteinCart($product,$itemId,$zip);
60
+ $response = is_array($response[$itemId])?$response[$itemId]:$response;
61
+ $quoteBlock->setTemplate('carebyzinc/options/cart.phtml');
62
+ $quoteBlock->setItemId($itemId);
63
+
64
+ } else {
65
+ $response = $model->getPriceQuote($product,$zip,$customoptionPrice);
66
+ $quoteBlock->setTemplate('carebyzinc/options/default.phtml');
67
+ }
68
+ $quoteBlock->setQuoteData($response);
69
+
70
+ $html = $quoteBlock->toHtml();
71
+ $this->getResponse()->setBody( Mage::helper('core')->jsonEncode($html));
72
+ }
73
+
74
+ public function updatePriceQuoteinCartAction()
75
+ {
76
+ $carebyzincId = $this->getRequest()->getParam('carebyzinc');
77
+ $itemId = $this->getRequest()->getParam('itemId');
78
+ $priceQuoteSession = Mage::getSingleton('core/session')->getCareByZincQuote();
79
+ $priceQuote = $priceQuoteSession[$itemId];
80
+
81
+ if($carebyzincItem = $priceQuote[$carebyzincId]){
82
+ $additionalOptions[] = array(
83
+ 'label' => 'carebyzinc',
84
+ 'value' => $carebyzincId,
85
+ );
86
+
87
+ $cart = Mage::getSingleton('checkout/cart');
88
+ $item = $cart->getQuote()->getItemById($itemId);
89
+ $item->getProduct()->setIsSuperMode(true);
90
+ if($price = $carebyzincItem['price_per_year']){
91
+ $product = Mage::getModel('catalog/product')->load($item->getProductId());
92
+ //$productPrice = $product->getFinalPrice();
93
+ $productPrice = $item->getProduct()->getFinalPrice();
94
+ $newPrice = $productPrice + $price;
95
+ $item->setCarebyzincPrice($price);
96
+ $item->setCustomPrice($newPrice);
97
+ $item->setOriginalCustomPrice($newPrice);
98
+ }
99
+ if ($additionalOption = $item->getOptionByCode('additional_options'))
100
+ {
101
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
102
+ }
103
+ $item->setCarebyzincOption(serialize($priceQuote[$carebyzincId]));
104
+ $item->addOption(array(
105
+ 'product_id' => $item->getProductId(),
106
+ 'code' => 'additional_options',
107
+ 'value' => serialize($additionalOptions)
108
+ ));
109
+ $item->save();
110
+ $cart->save();
111
+ Mage::getSingleton('core/session')->unsCareByZincQuote();
112
+ }
113
+ echo 'success';
114
+ }
115
+ public function removeWarrantyAction()
116
+ {
117
+ $item_id = $this->getRequest()->getParam('id');
118
+ if($item_id < 0){
119
+ return '';
120
+ }
121
+ $cart = Mage::getSingleton('checkout/cart');
122
+ $quoteItem = $cart->getQuote()->getItemById($item_id);
123
+ if ($additionalOption = $quoteItem->getOptionByCode('additional_options'))
124
+ {
125
+ $additionalOptions = (array) unserialize($additionalOption->getValue());
126
+ }
127
+ $additionalOptionsArray = array();
128
+ foreach($additionalOptions as $option){
129
+ if($option['label'] != 'carebyzinc')
130
+ $additionalOptionsArray[] = $option;
131
+ }
132
+ $quoteItem->setCarebyzincOption('');
133
+ $productPrice = $quoteItem->getProduct()->getFinalPrice();
134
+ if(! empty($additionalOptionsArray)){
135
+ $quoteItem->addOption(array( 'product_id' => $quoteItem->getProductId(),
136
+ 'code' => 'additional_options',
137
+ 'value' => serialize($additionalOptionsArray)
138
+ ));
139
+ }else{
140
+ $quoteItem->getOptionByCode('additional_options')->delete();
141
+
142
+ }
143
+ $quoteItem->setCarebyzincPrice(0);
144
+ $quoteItem->setCustomPrice($productPrice);
145
+ $quoteItem->setOriginalCustomPrice($productPrice);
146
+ $quoteItem->getProduct()->setIsSuperMode(true);
147
+ $quoteItem->save();
148
+ $cart->getQuote()->collectTotals()->save();
149
+ $this->_redirect('checkout/cart/');
150
+ }
151
+
152
+ }
app/code/local/Zinc/Carebyzinc/etc/adminhtml.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ZincPlatform
5
+ * @package Zinc_Carebyzinc
6
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <acl>
12
+ <resources>
13
+ <all>
14
+ <title>Allow Everything</title>
15
+ </all>
16
+ <admin>
17
+ <children>
18
+ <catalog>
19
+ <children>
20
+ <zinc_carebyzinc>
21
+ <title>Zinc Admin</title>
22
+ <sort_order>500</sort_order>
23
+ </zinc_carebyzinc>
24
+ </children>
25
+ </catalog>
26
+ <system>
27
+ <children>
28
+ <config>
29
+ <children>
30
+ <carebyzinc>
31
+ <title>Zinc Admin Configuration Section</title>
32
+ </carebyzinc>
33
+ </children>
34
+ </config>
35
+ </children>
36
+ </system>
37
+ </children>
38
+ </admin>
39
+ </resources>
40
+ </acl>
41
+ <menu>
42
+ <carebyzinc module="carebyzinc">
43
+ <title>Zinc Admin</title>
44
+ <sort_order>71</sort_order>
45
+ <children>
46
+ <products module="carebyzinc">
47
+ <title>Products</title>
48
+ <sort_order>10</sort_order>
49
+ <action>adminhtml/product</action>
50
+ </products>
51
+ <orders module="carebyzinc">
52
+ <title>Orders</title>
53
+ <sort_order>20</sort_order>
54
+ <action>adminhtml/order</action>
55
+ </orders>
56
+ </children>
57
+ </carebyzinc>
58
+ </menu>
59
+ </config>
app/code/local/Zinc/Carebyzinc/etc/config.xml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ZincPlatform
5
+ * @package Zinc_Carebyzinc
6
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Zinc_Carebyzinc>
13
+ <version>1.0.3</version>
14
+ </Zinc_Carebyzinc>
15
+ </modules>
16
+ <frontend>
17
+ <routers>
18
+ <carebyzinc>
19
+ <use>standard</use>
20
+ <args>
21
+ <module>Zinc_Carebyzinc</module>
22
+ <frontName>carebyzinc</frontName>
23
+ </args>
24
+ </carebyzinc>
25
+ </routers>
26
+ <layout>
27
+ <updates>
28
+ <carebyzinc>
29
+ <file>zinc_carebyzinc.xml</file>
30
+ </carebyzinc>
31
+ </updates>
32
+ </layout>
33
+ </frontend>
34
+
35
+ <admin>
36
+ <routers>
37
+ <adminhtml>
38
+ <args>
39
+ <modules>
40
+ <carebyzinc after="Mage_Adminhtml">Zinc_Carebyzinc_Adminhtml</carebyzinc>
41
+ </modules>
42
+ </args>
43
+ </adminhtml>
44
+ </routers>
45
+ </admin>
46
+ <adminhtml>
47
+ <layout>
48
+ <updates>
49
+ <carebyzinc>
50
+ <file>zinc_carebyzinc.xml</file>
51
+ </carebyzinc>
52
+ </updates>
53
+ </layout>
54
+ </adminhtml>
55
+ <global>
56
+ <rewrite>
57
+ <zinc_carebyzinc>
58
+ <from><![CDATA[#^/checkout/cart/#]]></from>
59
+ <to>/carebyzinc/cart/</to>
60
+ </zinc_carebyzinc>
61
+ </rewrite>
62
+
63
+ <sales>
64
+ <quote>
65
+ <item>
66
+ <product_attributes>
67
+ <carebyzinc_option />
68
+ </product_attributes>
69
+ </item>
70
+ </quote>
71
+ </sales>
72
+ <events>
73
+ <controller_action_predispatch_checkout_cart_index>
74
+ <observers>
75
+ <modify_carebyzinc>
76
+ <type>singleton</type>
77
+ <class>Zinc_Carebyzinc_Model_Observer</class>
78
+ <method>cartLoad</method>
79
+ </modify_carebyzinc>
80
+ </observers>
81
+ </controller_action_predispatch_checkout_cart_index>
82
+ <controller_action_predispatch_checkout_cart_onepage>
83
+ <observers>
84
+ <modify_carebyzinc>
85
+ <type>singleton</type>
86
+ <class>Zinc_Carebyzinc_Model_Observer</class>
87
+ <method>cartLoad</method>
88
+ </modify_carebyzinc>
89
+ </observers>
90
+ </controller_action_predispatch_checkout_cart_onepage>
91
+ <sales_order_save_after>
92
+ <observers>
93
+ <save_carebyzinc>
94
+ <type>singleton</type>
95
+ <class>Zinc_Carebyzinc_Model_Observer</class>
96
+ <method>saveCarebyzinc</method>
97
+ </save_carebyzinc>
98
+ </observers>
99
+ </sales_order_save_after>
100
+ </events>
101
+ <fieldsets>
102
+ <sales_convert_quote_item>
103
+ <carebyzinc_option>
104
+ <to_order_item>*</to_order_item>
105
+ </carebyzinc_option>
106
+ </sales_convert_quote_item>
107
+ <sales_convert_order_item>
108
+ <carebyzinc_option>
109
+ <to_quote_item>*</to_quote_item>
110
+ </carebyzinc_option>
111
+ </sales_convert_order_item>
112
+ </fieldsets>
113
+ <models>
114
+ <carebyzinc>
115
+ <class>Zinc_Carebyzinc_Model</class>
116
+ <resourceModel>carebyzinc_mysql4</resourceModel>
117
+ </carebyzinc>
118
+ <carebyzinc_mysql4>
119
+ <class>Zinc_Carebyzinc_Model_Mysql4</class>
120
+ <entities>
121
+ <order>
122
+ <table>zinc_carebyzinc_order</table>
123
+ </order>
124
+ </entities>
125
+ </carebyzinc_mysql4>
126
+ <checkout>
127
+ <rewrite>
128
+ <cart>Zinc_Carebyzinc_Model_Checkout_Cart</cart>
129
+ </rewrite>
130
+ </checkout>
131
+ <sales>
132
+ <rewrite>
133
+ <quote>Zinc_Carebyzinc_Model_Sales_Quote</quote>
134
+ </rewrite>
135
+ </sales>
136
+ </models>
137
+ <resources>
138
+ <carebyzinc_setup>
139
+ <setup>
140
+ <module>Zinc_Carebyzinc</module>
141
+ </setup>
142
+ <connection>
143
+ <use>core_setup</use>
144
+ </connection>
145
+ </carebyzinc_setup>
146
+ <carebyzinc_write>
147
+ <connection>
148
+ <use>core_write</use>
149
+ </connection>
150
+ </carebyzinc_write>
151
+ <carebyzinc_read>
152
+ <connection>
153
+ <use>core_read</use>
154
+ </connection>
155
+ </carebyzinc_read>
156
+ </resources>
157
+ <blocks>
158
+ <carebyzinc>
159
+ <class>Zinc_Carebyzinc_Block</class>
160
+ </carebyzinc>
161
+ <adminhtml>
162
+ <rewrite>
163
+ <catalog_product_grid>Zinc_Carebyzinc_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
164
+ </rewrite>
165
+ </adminhtml>
166
+ </blocks>
167
+ <helpers>
168
+ <carebyzinc>
169
+ <class>Zinc_Carebyzinc_Helper</class>
170
+ </carebyzinc>
171
+ </helpers>
172
+ </global>
173
+ </config>
app/code/local/Zinc/Carebyzinc/etc/system.xml ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ZincPlatform
5
+ * @package Zinc_Carebyzinc
6
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <tabs>
12
+ <zinc_carebyzinc translate="label" module="carebyzinc">
13
+ <label>Zinc Admin</label>
14
+ <sort_order>150</sort_order>
15
+ </zinc_carebyzinc>
16
+ </tabs>
17
+ <sections>
18
+ <carebyzinc>
19
+ <label>Care by Zinc</label>
20
+ <tab>zinc_carebyzinc</tab>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <groups>
26
+ <general>
27
+ <label>General</label>
28
+ <sort_order>10</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <fields>
33
+ <enabled>
34
+ <label>Enabled</label>
35
+ <sort_order>10</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_Yesno</source_model>
41
+ </enabled>
42
+ <carebytitle>
43
+ <label>Title</label>
44
+ <sort_order>20</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <frontend_type>text</frontend_type>
49
+ </carebytitle>
50
+ <showquote>
51
+ <label>Show Quote on Product Page</label>
52
+ <sort_order>30</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_Yesno</source_model>
58
+ </showquote>
59
+ <defaultzip>
60
+ <label>Default Zipcode</label>
61
+ <sort_order>40</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ <frontend_type>text</frontend_type>
66
+ </defaultzip>
67
+
68
+
69
+ </fields>
70
+ </general>
71
+ <api>
72
+ <label>Configuration</label>
73
+ <sort_order>20</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ <fields>
78
+ <testmode>
79
+ <label>Test / Production Mode</label>
80
+ <frontend_type>select</frontend_type>
81
+ <sort_order>1</sort_order>
82
+ <source_model>carebyzinc/system_config_source</source_model>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </testmode>
87
+ <test_url>
88
+ <label>Test API URL</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>15</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ </test_url>
95
+ <url>
96
+ <label>Production API URL</label>
97
+ <frontend_type>text</frontend_type>
98
+ <sort_order>10</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </url>
103
+ <user_id>
104
+ <label>User ID</label>
105
+ <frontend_type>text</frontend_type>
106
+ <sort_order>20</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>1</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ </user_id>
111
+ <access_token>
112
+ <label>Access Token</label>
113
+ <frontend_type>text</frontend_type>
114
+ <sort_order>30</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ </access_token>
119
+ <client>
120
+ <label>Client</label>
121
+ <frontend_type>text</frontend_type>
122
+ <sort_order>40</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ </client>
127
+ <validate translate="label" module="carebyzinc">
128
+ <comment>Please save configuration value before validating.</comment>
129
+ <frontend_type>button</frontend_type>
130
+ <frontend_model>carebyzinc/adminhtml_system_config_tokenvalidate</frontend_model>
131
+ <sort_order>120</sort_order>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>1</show_in_website>
134
+ <show_in_store>0</show_in_store>
135
+ </validate>
136
+ </fields>
137
+ </api>
138
+ </groups>
139
+ </carebyzinc>
140
+ </sections>
141
+ </config>
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer = $this;
9
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
10
+ $installer->startSetup();
11
+ $setup->addAttributeGroup('catalog_product', 'Default', 'Zinc Admin', 1000);
12
+ $setup->addAttribute('catalog_product', 'carebyzinc', array(
13
+ 'group' => 'Zinc Admin',
14
+ 'label' => 'Care by Zinc',
15
+ 'input' => 'boolean',
16
+ 'type' => 'int',
17
+ 'source' => 'eav/entity_attribute_source_boolean',
18
+ 'default' => '0',
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => false,
22
+ 'searchable' => false,
23
+ 'filterable' => false,
24
+ 'comparable' => false,
25
+ 'visible_on_front' => true,
26
+ 'visible_in_advanced_search' => false,
27
+ 'unique' => false,
28
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
29
+ ));
30
+
31
+
32
+ $installer->endSetup();
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-0.1.0-0.2.0.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer=$this;
9
+ $installer->startSetup();
10
+
11
+ $installer->run("
12
+ DROP TABLE IF EXISTS {$this->getTable('zinc_carebyzinc_order')};
13
+ CREATE TABLE {$this->getTable('zinc_carebyzinc_order')} (
14
+ `id` int(11) unsigned NOT NULL auto_increment,
15
+ `order_id` int(11) NOT NULL,
16
+ `product_id` int(11) NOT NULL,
17
+ `customer_id` int(11) NOT NULL,
18
+ `product_name` varchar(255) NOT NULL default '',
19
+ `product_sku` varchar(255) NOT NULL default '',
20
+ `carebyzinc_key` int(11) NOT NULL,
21
+ `carebyzinc_provider` varchar(255) NOT NULL default '',
22
+ `customer_name` varchar(255) NOT NULL default '',
23
+ `customer_email` varchar(255) NOT NULL default '',
24
+ `created_time` datetime NULL,
25
+ PRIMARY KEY (`id`)
26
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
27
+ ");
28
+
29
+ $installer->endSetup();
30
+
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-0.2.0-1.0.0.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer = new Mage_Sales_Model_Resource_Setup('core_setup');
9
+ $entities = array(
10
+ 'quote_item',
11
+ 'order_item'
12
+ );
13
+ $options = array(
14
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
15
+ 'visible' => true,
16
+ 'required' => false
17
+ );
18
+ foreach ($entities as $entity) {
19
+ $installer->addAttribute($entity, 'carebyzinc_option', $options);
20
+ }
21
+
22
+ $installer->endSetup();
23
+
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer = $this;
9
+ $installer->startSetup();
10
+
11
+ $this->startSetup();
12
+
13
+ $this->getConnection()
14
+ ->addColumn($installer->getTable('zinc_carebyzinc_order'),'order_inc_id',"varchar(200) COMMENT 'OrderIncrementId'");
15
+
16
+ $this->getConnection()
17
+ ->addColumn($installer->getTable('zinc_carebyzinc_order'),'item_id',"INT(11) COMMENT 'ItemId'");
18
+
19
+ $this->getConnection()
20
+ ->addColumn($installer->getTable('zinc_carebyzinc_order'),'warrenty_price',"double COMMENT 'WarrentyPrice'");
21
+ $this->getConnection()
22
+ ->addColumn($installer->getTable('zinc_carebyzinc_order'),'product_price',"double COMMENT 'ProductPrice'");
23
+
24
+
25
+ $switch = new Mage_Core_Model_Config();
26
+
27
+ $switch ->saveConfig('carebyzinc/general/carebytitle', "Care By Zinc", 'default', 0);
28
+
29
+
30
+
31
+
32
+
33
+
34
+
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.1-1.0.2.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer = new Mage_Sales_Model_Resource_Setup('core_setup');
9
+ $entities = array(
10
+ 'quote_item',
11
+ 'order_item'
12
+ );
13
+ $options = array(
14
+ 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL,
15
+ 'visible' => true,
16
+ 'required' => false
17
+ );
18
+ foreach ($entities as $entity) {
19
+ $installer->addAttribute($entity, 'carebyzinc_price', $options);
20
+ }
21
+
22
+ $installer->endSetup();
23
+
app/code/local/Zinc/Carebyzinc/sql/carebyzinc_setup/mysql4-upgrade-1.0.2-1.0.3.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ZincPlatform
4
+ * @package Zinc_Carebyzinc
5
+ * @copyright Copyright (c) 2016-2017 Zinplatform (http://www.zincplatform.com/)
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
9
+ $setup->addAttributeGroup('catalog_product', 'Default', 'Zinc Admin', 1000);
10
+ $installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
11
+ $installer->startSetup();
12
+
13
+ $installer->addAttribute('catalog_product', 'carebyzinc_category', array(
14
+ 'group' => 'Zinc Admin',
15
+ 'label' => 'Care by Zinc Category',
16
+ 'type' => 'varchar',
17
+ 'visible' => true,
18
+ 'input' => 'select',
19
+ 'required' => false,
20
+ 'user_defined' => false,
21
+ 'searchable' => false,
22
+ 'filterable' => false,
23
+ 'comparable' => false,
24
+ 'visible_on_front' => true,
25
+ 'visible_in_advanced_search' => false,
26
+ 'unique' => false,
27
+ 'source' =>'carebyzinc/entity_category',
28
+ 'input_renderer' => 'carebyzinc/adminhtml_catalog_product_renderer_category',
29
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
30
+ ));
31
+ $installer->addAttribute('catalog_product', 'carebyzinc_subcategory', array(
32
+ 'group' => 'Zinc Admin',
33
+ 'label' => 'Care by Zinc Subcategory',
34
+ 'input' => 'select',
35
+ 'type' => 'varchar',
36
+ 'visible' => true,
37
+ 'required' => false,
38
+ 'user_defined' => false,
39
+ 'searchable' => false,
40
+ 'filterable' => false,
41
+ 'comparable' => false,
42
+ 'visible_on_front' => true,
43
+ 'visible_in_advanced_search' => false,
44
+ 'unique' => false,
45
+ 'source' =>'carebyzinc/entity_subcategory',
46
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
47
+ ));
48
+
49
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/zinc_carebyzinc.xml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <adminhtml_product_index>
4
+ <reference name="content">
5
+ <block type="carebyzinc/adminhtml_product" name="product" />
6
+ </reference>
7
+ </adminhtml_product_index>
8
+ <adminhtml_product_grid>
9
+ <block type="core/text_list" name="root" output="toHtml">
10
+ <block type="carebyzinc/adminhtml_product_grid" name="product" />
11
+ </block>
12
+ </adminhtml_product_grid>
13
+ <adminhtml_order_index>
14
+ <reference name="content">
15
+ <block type="carebyzinc/adminhtml_order" name="order" />
16
+ </reference>
17
+ </adminhtml_order_index>
18
+ <adminhtml_order_grid>
19
+ <block type="core/text_list" name="root" output="toHtml">
20
+ <block type="carebyzinc/adminhtml_order" name="order" />
21
+ </block>
22
+ </adminhtml_order_grid>
23
+ <adminhtml_sales_order_view>
24
+ <reference name="order_items">
25
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
26
+ <type>default</type>
27
+ <block>adminhtml/sales_order_view_items_renderer_default</block>
28
+ <template>carebyzinc/order/view/items/renderer/default.phtml</template>
29
+ </action>
30
+ </reference>
31
+ </adminhtml_sales_order_view>
32
+ <adminhtml_sales_order_invoice_new>
33
+ <reference name="order_items">
34
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
35
+ <type>default</type>
36
+ <block>adminhtml/sales_items_renderer_default</block>
37
+ <template>carebyzinc/order/invoice/create/items/renderer/default.phtml</template>
38
+ </action>
39
+ </reference>
40
+ </adminhtml_sales_order_invoice_new>
41
+
42
+ <adminhtml_sales_order_invoice_updateqty>
43
+ <reference name="order_items">
44
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
45
+ <type>default</type>
46
+ <block>adminhtml/sales_items_renderer_default</block>
47
+ <template>carebyzinc/order/invoice/create/items/renderer/default.phtml</template>
48
+ </action>
49
+ </reference>
50
+ </adminhtml_sales_order_invoice_updateqty>
51
+ <adminhtml_sales_order_invoice_view>
52
+ <reference name="invoice_items">
53
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
54
+ <type>default</type>
55
+ <block>adminhtml/sales_items_renderer_default</block>
56
+ <template>carebyzinc/order/invoice/view/items/renderer/default.phtml</template>
57
+ </action>
58
+ </reference>
59
+ </adminhtml_sales_order_invoice_view>
60
+ <adminhtml_sales_order_shipment_new>
61
+ <reference name="order_items">
62
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
63
+ <type>default</type>
64
+ <block>adminhtml/sales_items_renderer_default</block>
65
+ <template>carebyzinc/order/shipment/create/items/renderer/default.phtml</template>
66
+ </action>
67
+ </reference>
68
+ </adminhtml_sales_order_shipment_new>
69
+ <adminhtml_sales_order_shipment_view>
70
+ <reference name="shipment_items">
71
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
72
+ <type>default</type>
73
+ <block>adminhtml/sales_items_renderer_default</block>
74
+ <template>carebyzinc/order/shipment/view/items/renderer/default.phtml</template>
75
+ </action>
76
+ </reference>
77
+ </adminhtml_sales_order_shipment_view>
78
+ <adminhtml_sales_order_creditmemo_new>
79
+ <reference name="order_items">
80
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
81
+ <type>default</type>
82
+ <block>adminhtml/sales_items_renderer_default</block>
83
+ <template>carebyzinc/order/creditmemo/create/items/renderer/default.phtml</template>
84
+ </action>
85
+ </reference>
86
+ </adminhtml_sales_order_creditmemo_new>
87
+ <adminhtml_sales_order_creditmemo_updateqty>
88
+ <reference name="order_items">
89
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
90
+ <type>default</type>
91
+ <block>adminhtml/sales_items_renderer_default</block>
92
+ <template>carebyzinc/order/creditmemo/create/items/renderer/default.phtml</template>
93
+ </action>
94
+ </reference>
95
+ </adminhtml_sales_order_creditmemo_updateqty>
96
+ <adminhtml_sales_order_creditmemo_view>
97
+ <reference name="creditmemo_items">
98
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
99
+ <type>default</type>
100
+ <block>adminhtml/sales_items_renderer_default</block>
101
+ <template>carebyzinc/order/creditmemo/view/items/renderer/default.phtml</template>
102
+ </action>
103
+ </reference>
104
+ </adminhtml_sales_order_creditmemo_view>
105
+
106
+
107
+ </layout>
app/design/adminhtml/default/default/template/carebyzinc/order/creditmemo/create/items/renderer/default.phtml ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $this->setPriceDataObject($_item); ?>
29
+ <tr class="border">
30
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
31
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
32
+ <?php if($careByZinc): ?>
33
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
34
+ <div class="product-cart-careby">
35
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
36
+ <?php echo $carebyzincAry['description'] ?><br />
37
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
38
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?><br />
39
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
40
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
41
+ </p>
42
+ </div>
43
+ <?php endif;?>
44
+
45
+
46
+ </td>
47
+ <td class="a-right">
48
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
49
+ <span class="price-excl-tax">
50
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
51
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
52
+ <?php endif; ?>
53
+
54
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
55
+ <?php
56
+ echo $this->displayPrices(
57
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
58
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
59
+ );
60
+ ?>
61
+ <?php else: ?>
62
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
63
+ <?php endif; ?>
64
+
65
+
66
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
67
+ <br />
68
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
69
+ <small>
70
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
71
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
72
+ <?php endforeach; ?>
73
+ </small>
74
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
75
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
76
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
77
+ <?php endforeach; ?>
78
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
79
+ <small>
80
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
81
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
82
+ <?php endforeach; ?>
83
+ </small>
84
+ <?php endif; ?>
85
+
86
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
87
+ <br />
88
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
89
+ <?php
90
+ echo $this->displayPrices(
91
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
92
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
93
+ );
94
+ ?>
95
+ </span>
96
+ <?php endif; ?>
97
+ <?php endif; ?>
98
+ </span>
99
+ <br />
100
+ <?php endif; ?>
101
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
102
+ <span class="price-incl-tax">
103
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
104
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
105
+ <?php endif; ?>
106
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
107
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
108
+
109
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
110
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
111
+ <?php else: ?>
112
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
113
+ <?php endif; ?>
114
+
115
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
116
+ <br />
117
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
118
+ <small>
119
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
120
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
121
+ <?php endforeach; ?>
122
+ </small>
123
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
124
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
125
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
126
+ <?php endforeach; ?>
127
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
128
+ <small>
129
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
130
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
131
+ <?php endforeach; ?>
132
+ </small>
133
+ <?php endif; ?>
134
+
135
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
136
+ <br />
137
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
138
+ <?php endif; ?>
139
+ <?php endif; ?>
140
+ </span>
141
+ <?php endif; ?>
142
+ </td>
143
+ <td class="a-center"><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
144
+ <?php if ($this->canParentReturnToStock($_item)) : ?>
145
+ <td class="a-center">
146
+ <?php if ($this->canReturnItemToStock($_item)) : ?>
147
+ <input type="checkbox" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][back_to_stock]" value="1"<?php if ($_item->getBackToStock()):?> checked<?php endif;?>/>
148
+ <?php endif; ?>
149
+ </td>
150
+ <?php endif; ?>
151
+ <td class="a-center">
152
+ <?php if ($this->canEditQty()) : ?>
153
+ <input type="text" class="input-text qty-input" name="creditmemo[items][<?php echo $_item->getOrderItemId() ?>][qty]" value="<?php echo $_item->getQty()*1 ?>"/>
154
+ <?php else : ?>
155
+ <?php echo $_item->getQty()*1 ?>
156
+ <?php endif; ?>
157
+ </td>
158
+ <td class="a-right">
159
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
160
+ <span class="price-excl-tax">
161
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
162
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
163
+ <?php endif; ?>
164
+
165
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
166
+ <?php
167
+ echo $this->displayPrices(
168
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
169
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
170
+ );
171
+ ?>
172
+ <?php else: ?>
173
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
174
+ <?php endif; ?>
175
+
176
+
177
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
178
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
179
+ <small>
180
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
181
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
182
+ <?php endforeach; ?>
183
+ </small>
184
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
185
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
186
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
187
+ <?php endforeach; ?>
188
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
189
+ <small>
190
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
191
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
192
+ <?php endforeach; ?>
193
+ </small>
194
+ <?php endif; ?>
195
+
196
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
197
+ <br />
198
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
199
+ <?php
200
+ echo $this->displayPrices(
201
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
202
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
203
+ );
204
+ ?>
205
+ </span>
206
+ <?php endif; ?>
207
+ <?php endif; ?>
208
+ </span>
209
+ <br />
210
+ <?php endif; ?>
211
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
212
+ <span class="price-incl-tax">
213
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
214
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
215
+ <?php endif; ?>
216
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
217
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
218
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
219
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item),$_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
220
+ <?php else: ?>
221
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
222
+ <?php endif; ?>
223
+
224
+
225
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
226
+
227
+ <br />
228
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
229
+ <small>
230
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
231
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
232
+ <?php endforeach; ?>
233
+ </small>
234
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
235
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
236
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
237
+ <?php endforeach; ?>
238
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
239
+ <small>
240
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
241
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
242
+ <?php endforeach; ?>
243
+ </small>
244
+ <?php endif; ?>
245
+
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
247
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
248
+ <?php endif; ?>
249
+ <?php endif; ?>
250
+ </span>
251
+ <?php endif; ?>
252
+ </td>
253
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
254
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
255
+ <td class="a-right last">
256
+ <?php echo $this->displayPrices(
257
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
258
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
259
+ ) ?>
260
+ </td>
261
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/creditmemo/view/items/renderer/default.phtml ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_item->setStoreId($_item->getCreditMemo()->getStoreId()) ?>
29
+ <?php $this->setPriceDataObject($_item) ?>
30
+ <tr class="border">
31
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
32
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
33
+ <?php if($careByZinc): ?>
34
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
35
+ <div class="product-cart-careby">
36
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
37
+ <?php echo $carebyzincAry['description'] ?><br />
38
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
39
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?>
40
+ <br/> <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
41
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
42
+ </p>
43
+ </div>
44
+ <?php endif;?>
45
+
46
+ </td>
47
+ <td class="a-right">
48
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
49
+ <span class="price-excl-tax">
50
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
51
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
52
+ <?php endif; ?>
53
+
54
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
55
+ <?php
56
+ echo $this->displayPrices(
57
+ $_item->getBasePrice() + $_item->getBaseWeeeTaxAppliedAmount() + $_item->getBaseWeeeTaxDisposition(),
58
+ $_item->getPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()
59
+ );
60
+ ?>
61
+ <?php else: ?>
62
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
63
+ <?php endif; ?>
64
+
65
+
66
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
67
+ <br/>
68
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
69
+ <small>
70
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
71
+ <span class="nobr"><?php echo $tax['title']; ?>
72
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
73
+ <?php endforeach; ?>
74
+ </small>
75
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
76
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
77
+ <span class="nobr"><small><?php echo $tax['title']; ?>
78
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
79
+ <?php endforeach; ?>
80
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
81
+ <small>
82
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
83
+ <span class="nobr"><?php echo $tax['title']; ?>
84
+ : <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
85
+ <?php endforeach; ?>
86
+ </small>
87
+ <?php endif; ?>
88
+
89
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
90
+ <br/>
91
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br/>
92
+ <?php
93
+ echo $this->displayPrices(
94
+ $_item->getBasePrice() + $_item->getBaseWeeeTaxAppliedAmount() + $_item->getBaseWeeeTaxDisposition(),
95
+ $_item->getPrice() + $_item->getWeeeTaxAppliedAmount() + $_item->getWeeeTaxDisposition()
96
+ );
97
+ ?>
98
+ </span>
99
+ <?php endif; ?>
100
+ <?php endif; ?>
101
+ </span>
102
+ <br/>
103
+ <?php endif; ?>
104
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
105
+ <span class="price-incl-tax">
106
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
107
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
108
+ <?php endif; ?>
109
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
110
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
111
+
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
113
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
114
+ <?php else: ?>
115
+ <?php echo $this->displayPrices($_baseIncl - $_item->getBaseWeeeTaxDisposition(), $_incl - $_item->getWeeeTaxDisposition()) ?>
116
+ <?php endif; ?>
117
+
118
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
119
+ <br/>
120
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
121
+ <small>
122
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
123
+ <span class="nobr"><?php echo $tax['title']; ?>
124
+ : <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
125
+ <?php endforeach; ?>
126
+ </small>
127
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
128
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
129
+ <span class="nobr"><small><?php echo $tax['title']; ?>
130
+ : <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
131
+ <?php endforeach; ?>
132
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
133
+ <small>
134
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
135
+ <span class="nobr"><?php echo $tax['title']; ?>
136
+ : <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
137
+ <?php endforeach; ?>
138
+ </small>
139
+ <?php endif; ?>
140
+
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
142
+ <br/>
143
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
144
+ :<br/> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
145
+ <?php endif; ?>
146
+ <?php endif; ?>
147
+ </span>
148
+ <?php endif; ?>
149
+
150
+ </td>
151
+ <td class="a-center"><?php echo $_item->getQty() * 1 ?></td>
152
+ <td class="a-right">
153
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
154
+ <span class="price-excl-tax">
155
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
156
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
157
+ <?php endif; ?>
158
+
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
160
+ <?php
161
+ echo $this->displayPrices(
162
+ $_item->getBaseRowTotal() + $_item->getBaseWeeeTaxAppliedRowAmount() + $_item->getBaseWeeeTaxRowDisposition(),
163
+ $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount() + $_item->getWeeeTaxRowDisposition()
164
+ );
165
+ ?>
166
+ <?php else: ?>
167
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
168
+ <?php endif; ?>
169
+
170
+
171
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
173
+ <small>
174
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
175
+ <span class="nobr"><?php echo $tax['title']; ?>
176
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
177
+ <?php endforeach; ?>
178
+ </small>
179
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
180
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
181
+ <span class="nobr"><small><?php echo $tax['title']; ?>
182
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
183
+ <?php endforeach; ?>
184
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
185
+ <small>
186
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
187
+ <span class="nobr"><?php echo $tax['title']; ?>
188
+ : <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
189
+ <?php endforeach; ?>
190
+ </small>
191
+ <?php endif; ?>
192
+
193
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
194
+ <br/>
195
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br/>
196
+ <?php
197
+ echo $this->displayPrices(
198
+ $_item->getBaseRowTotal() + $_item->getBaseWeeeTaxAppliedRowAmount() + $_item->getBaseWeeeTaxRowDisposition(),
199
+ $_item->getRowTotal() + $_item->getWeeeTaxAppliedRowAmount() + $_item->getWeeeTaxRowDisposition()
200
+ );
201
+ ?>
202
+ </span>
203
+ <?php endif; ?>
204
+ <?php endif; ?>
205
+ </span>
206
+ <br/>
207
+ <?php endif; ?>
208
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
209
+ <span class="price-incl-tax">
210
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
211
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
212
+ <?php endif; ?>
213
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
214
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
215
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
216
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
217
+ <?php else: ?>
218
+ <?php echo $this->displayPrices($_baseIncl - $_item->getBaseWeeeTaxRowDisposition(), $_incl - $_item->getWeeeTaxRowDisposition()) ?>
219
+ <?php endif; ?>
220
+
221
+
222
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
223
+
224
+ <br/>
225
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
226
+ <small>
227
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
228
+ <span class="nobr"><?php echo $tax['title']; ?>
229
+ : <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
230
+ <?php endforeach; ?>
231
+ </small>
232
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
233
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
234
+ <span class="nobr"><small><?php echo $tax['title']; ?>
235
+ : <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
236
+ <?php endforeach; ?>
237
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
238
+ <small>
239
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
240
+ <span class="nobr"><?php echo $tax['title']; ?>
241
+ : <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
242
+ <?php endforeach; ?>
243
+ </small>
244
+ <?php endif; ?>
245
+
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
247
+ <br/><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
248
+ :<br/> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
249
+ <?php endif; ?>
250
+ <?php endif; ?>
251
+ </span>
252
+ <?php endif; ?>
253
+ </td>
254
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
255
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
256
+ <td class="a-right last">
257
+ <?php echo $this->displayPrices(
258
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
259
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
260
+ ) ?>
261
+ </td>
262
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/invoice/create/items/renderer/default.phtml ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $this->setPriceDataObject($_item)?>
29
+ <tr class="border">
30
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
31
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
32
+ <?php if($careByZinc): ?>
33
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
34
+ <div class="product-cart-careby">
35
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
36
+ <?php echo $carebyzincAry['description'] ?><br />
37
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
38
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?><br/>
39
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
40
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
41
+ </p>
42
+ </div>
43
+ <?php endif;?>
44
+
45
+
46
+
47
+ </td>
48
+ <td class="a-right">
49
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
50
+ <span class="price-excl-tax">
51
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
52
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
53
+ <?php endif; ?>
54
+
55
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
56
+ <?php
57
+ echo $this->displayPrices(
58
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
59
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
60
+ );
61
+ ?>
62
+ <?php else: ?>
63
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
64
+ <?php endif; ?>
65
+
66
+
67
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
68
+ <br />
69
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
70
+ <small>
71
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
72
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
73
+ <?php endforeach; ?>
74
+ </small>
75
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
76
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
77
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
78
+ <?php endforeach; ?>
79
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
80
+ <small>
81
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
82
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
83
+ <?php endforeach; ?>
84
+ </small>
85
+ <?php endif; ?>
86
+
87
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
88
+ <br />
89
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
90
+ <?php
91
+ echo $this->displayPrices(
92
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
93
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
94
+ );
95
+ ?>
96
+ </span>
97
+ <?php endif; ?>
98
+ <?php endif; ?>
99
+ </span>
100
+ <br />
101
+ <?php endif; ?>
102
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
103
+ <span class="price-incl-tax">
104
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
105
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
106
+ <?php endif; ?>
107
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
108
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
109
+
110
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
111
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
112
+ <?php else: ?>
113
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
114
+ <?php endif; ?>
115
+
116
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
117
+ <br />
118
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
119
+ <small>
120
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
121
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
122
+ <?php endforeach; ?>
123
+ </small>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
125
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
126
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
127
+ <?php endforeach; ?>
128
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
129
+ <small>
130
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
131
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
132
+ <?php endforeach; ?>
133
+ </small>
134
+ <?php endif; ?>
135
+
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
137
+ <br />
138
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ <?php endif; ?>
143
+
144
+ </td>
145
+ <td class="a-center"><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
146
+ <td class="a-center">
147
+ <?php if ($this->canEditQty()) : ?>
148
+ <input type="text" class="input-text qty-input" name="invoice[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>"/>
149
+ <?php else : ?>
150
+ <?php echo $_item->getQty()*1 ?>
151
+ <?php endif; ?>
152
+ </td>
153
+ <td class="a-right">
154
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
155
+ <span class="price-excl-tax">
156
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
157
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
158
+ <?php endif; ?>
159
+
160
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
161
+ <?php
162
+ echo $this->displayPrices(
163
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
164
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
165
+ );
166
+ ?>
167
+ <?php else: ?>
168
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
169
+ <?php endif; ?>
170
+
171
+
172
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
173
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
174
+ <small>
175
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
176
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
177
+ <?php endforeach; ?>
178
+ </small>
179
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
180
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
181
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
182
+ <?php endforeach; ?>
183
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
184
+ <small>
185
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
186
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
187
+ <?php endforeach; ?>
188
+ </small>
189
+ <?php endif; ?>
190
+
191
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
192
+ <br />
193
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
194
+ <?php
195
+ echo $this->displayPrices(
196
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
197
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
198
+ );
199
+ ?>
200
+ </span>
201
+ <?php endif; ?>
202
+ <?php endif; ?>
203
+ </span>
204
+ <br />
205
+ <?php endif; ?>
206
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
207
+ <span class="price-incl-tax">
208
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
209
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
210
+ <?php endif; ?>
211
+
212
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
213
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
214
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
215
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
216
+ <?php else: ?>
217
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
218
+ <?php endif; ?>
219
+
220
+
221
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
222
+
223
+ <br />
224
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
225
+ <small>
226
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
227
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
228
+ <?php endforeach; ?>
229
+ </small>
230
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
231
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
232
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
233
+ <?php endforeach; ?>
234
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
235
+ <small>
236
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
237
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
238
+ <?php endforeach; ?>
239
+ </small>
240
+ <?php endif; ?>
241
+
242
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
243
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
244
+ <?php endif; ?>
245
+ <?php endif; ?>
246
+ </span>
247
+ <?php endif; ?>
248
+ </td>
249
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
250
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
251
+ <td class="a-right last">
252
+ <?php echo $this->displayPrices(
253
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
254
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
255
+ ) ?>
256
+ </td>
257
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/invoice/view/items/renderer/default.phtml ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_item->setStoreId($_item->getInvoice()->getStoreId()) ?>
29
+ <?php $this->setPriceDataObject($_item) ?>
30
+ <tr class="border">
31
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
32
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
33
+ <?php if($careByZinc): ?>
34
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
35
+ <div class="product-cart-careby">
36
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
37
+ <?php echo $carebyzincAry['description'] ?><br />
38
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
39
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?><br/>
40
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
41
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
42
+ </p>
43
+ </div>
44
+ <?php endif;?>
45
+
46
+
47
+ </td>
48
+ <td class="a-right">
49
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
50
+ <span class="price-excl-tax">
51
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
52
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
53
+ <?php endif; ?>
54
+
55
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
56
+ <?php
57
+ echo $this->displayPrices(
58
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
59
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
60
+ );
61
+ ?>
62
+ <?php else: ?>
63
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
64
+ <?php endif; ?>
65
+
66
+
67
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
68
+ <br />
69
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
70
+ <small>
71
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
72
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
73
+ <?php endforeach; ?>
74
+ </small>
75
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
76
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
77
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
78
+ <?php endforeach; ?>
79
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
80
+ <small>
81
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
82
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
83
+ <?php endforeach; ?>
84
+ </small>
85
+ <?php endif; ?>
86
+
87
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
88
+ <br />
89
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
90
+ <?php
91
+ echo $this->displayPrices(
92
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
93
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
94
+ );
95
+ ?>
96
+ </span>
97
+ <?php endif; ?>
98
+ <?php endif; ?>
99
+ </span>
100
+ <br />
101
+ <?php endif; ?>
102
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
103
+ <span class="price-incl-tax">
104
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
105
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
106
+ <?php endif; ?>
107
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
108
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
109
+
110
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
111
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
112
+ <?php else: ?>
113
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
114
+ <?php endif; ?>
115
+
116
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
117
+ <br />
118
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
119
+ <small>
120
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
121
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
122
+ <?php endforeach; ?>
123
+ </small>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
125
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
126
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
127
+ <?php endforeach; ?>
128
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
129
+ <small>
130
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
131
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
132
+ <?php endforeach; ?>
133
+ </small>
134
+ <?php endif; ?>
135
+
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
137
+ <br />
138
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ <?php endif; ?>
143
+
144
+ </td>
145
+ <td class="a-center"><?php echo $_item->getQty()*1 ?></td>
146
+ <td class="a-right">
147
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
148
+ <span class="price-excl-tax">
149
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
150
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
151
+ <?php endif; ?>
152
+
153
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
154
+ <?php
155
+ echo $this->displayPrices(
156
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
157
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
158
+ );
159
+ ?>
160
+ <?php else: ?>
161
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
162
+ <?php endif; ?>
163
+
164
+
165
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
166
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
167
+ <small>
168
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
169
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
170
+ <?php endforeach; ?>
171
+ </small>
172
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
173
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
174
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
175
+ <?php endforeach; ?>
176
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
177
+ <small>
178
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
179
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
180
+ <?php endforeach; ?>
181
+ </small>
182
+ <?php endif; ?>
183
+
184
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
185
+ <br />
186
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
187
+ <?php
188
+ echo $this->displayPrices(
189
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
190
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
191
+ );
192
+ ?>
193
+ </span>
194
+ <?php endif; ?>
195
+ <?php endif; ?>
196
+ </span>
197
+ <br />
198
+ <?php endif; ?>
199
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
200
+ <span class="price-incl-tax">
201
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
202
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
203
+ <?php endif; ?>
204
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
205
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
206
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
207
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
208
+ <?php else: ?>
209
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
210
+ <?php endif; ?>
211
+
212
+
213
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
214
+
215
+ <br />
216
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
217
+ <small>
218
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
219
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
220
+ <?php endforeach; ?>
221
+ </small>
222
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
223
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
224
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
225
+ <?php endforeach; ?>
226
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
227
+ <small>
228
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
229
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
230
+ <?php endforeach; ?>
231
+ </small>
232
+ <?php endif; ?>
233
+
234
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
235
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
236
+ <?php endif; ?>
237
+ <?php endif; ?>
238
+ </span>
239
+ <?php endif; ?>
240
+ </td>
241
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
242
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
243
+ <td class="a-right last">
244
+ <?php echo $this->displayPrices(
245
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
246
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
247
+ ) ?>
248
+ </td>
249
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/shipment/create/items/renderer/default.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <tr class="border">
29
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
30
+
31
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
32
+ <?php if($careByZinc): ?>
33
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
34
+ <div class="product-cart-careby">
35
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
36
+ <?php echo $carebyzincAry['description'] ?><br />
37
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
38
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?>
39
+ <br/> <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
40
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
41
+ </p>
42
+ </div>
43
+ <?php endif;?>
44
+
45
+
46
+ </td>
47
+ <td><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
48
+
49
+ <td class="<?php if ($this->isShipmentRegular()): ?>last<?php endif; ?> a-center">
50
+ <?php if ($this->canShipPartiallyItem()): ?>
51
+ <input type="text" class="input-text qty-item" name="shipment[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" />
52
+ <?php else: ?>
53
+ <?php echo $_item->getQty()*1 ?>
54
+ <?php endif; ?>
55
+ </td>
56
+ <?php if (!$this->canShipPartiallyItem()): ?>
57
+ <td class="a-center last">
58
+ <input type="hidden" name="shipment[items][<?php echo $_item->getOrderItemId() ?>]" value="0" />
59
+ <input type="checkbox" name="shipment[items][<?php echo $_item->getOrderItemId() ?>]" value="<?php echo $_item->getQty()*1 ?>" checked />
60
+ </td>
61
+ <?php endif; ?>
62
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/shipment/view/items/renderer/default.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <tr class="border">
29
+ <td><?php echo $this->getColumnHtml($_item, 'name') ?>
30
+
31
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption(); ?>
32
+ <?php if($careByZinc): ?>
33
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
34
+ <div class="product-cart-careby">
35
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
36
+ <?php echo $carebyzincAry['description'] ?><br />
37
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
38
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?>
39
+ <br/> <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
40
+ <span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?>
41
+ </p>
42
+ </div>
43
+ <?php endif;?>
44
+
45
+
46
+ </td>
47
+ <td class="a-center last"><?php echo $_item->getQty()*1 ?></td>
48
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/order/view/items/renderer/default.phtml ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $this->setPriceDataObject($_item) ?>
29
+ <tr<?php if (!$this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
30
+ <td>
31
+ <?php if ($this->canDisplayContainer()): ?>
32
+ <div id="<?php echo $this->getHtmlId() ?>" class="item-container">
33
+ <?php endif; ?>
34
+ <div class="item-text">
35
+ <?php echo $this->getColumnHtml($_item, 'name') ?>
36
+ </div>
37
+ <?php $careByZinc = $_item->getCarebyzincOption(); ?>
38
+ <?php if($careByZinc): ?>
39
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
40
+ <div class="product-cart-careby">
41
+ <p><strong><?php echo $this->__('Care By Zinc'); ?></strong><br />
42
+ <?php echo $carebyzincAry['description'] ?><br />
43
+ <?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?><br />
44
+ <span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
45
+ </div>
46
+ <?php endif;?>
47
+ <?php if ($this->canDisplayContainer()): ?>
48
+ </div>
49
+ <?php endif ?>
50
+ </td>
51
+ <td class="a-center"><?php echo $_item->getStatus() ?></td>
52
+ <td class="a-right"><?php echo $this->displayPriceAttribute('original_price') ?></td>
53
+ <td class="a-right">
54
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
55
+ <span class="price-excl-tax">
56
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
57
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
58
+ <?php endif; ?>
59
+
60
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
61
+ <?php
62
+ echo $this->displayPrices(
63
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
64
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
65
+ );
66
+ ?>
67
+ <?php else: ?>
68
+ <?php echo $this->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
69
+ <?php endif; ?>
70
+
71
+
72
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
73
+ <br />
74
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
75
+ <small>
76
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
77
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
78
+ <?php endforeach; ?>
79
+ </small>
80
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
81
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
82
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></small></span>
83
+ <?php endforeach; ?>
84
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
85
+ <small>
86
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
87
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount'], $tax['amount']); ?></span>
88
+ <?php endforeach; ?>
89
+ </small>
90
+ <?php endif; ?>
91
+
92
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
93
+ <br />
94
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
95
+ <?php
96
+ echo $this->displayPrices(
97
+ $_item->getBasePrice()+$_item->getBaseWeeeTaxAppliedAmount()+$_item->getBaseWeeeTaxDisposition(),
98
+ $_item->getPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()
99
+ );
100
+ ?>
101
+ </span>
102
+ <?php endif; ?>
103
+ <?php endif; ?>
104
+ </span>
105
+ <br />
106
+ <?php endif; ?>
107
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
108
+ <span class="price-incl-tax">
109
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
110
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
111
+ <?php endif; ?>
112
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
113
+ <?php $_baseIncl = $this->helper('checkout')->getBasePriceInclTax($_item); ?>
114
+
115
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
116
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
117
+ <?php else: ?>
118
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxDisposition(), $_incl-$_item->getWeeeTaxDisposition()) ?>
119
+ <?php endif; ?>
120
+
121
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
122
+ <br />
123
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
124
+ <small>
125
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
126
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
127
+ <?php endforeach; ?>
128
+ </small>
129
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
130
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
131
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></small></span>
132
+ <?php endforeach; ?>
133
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
134
+ <small>
135
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
136
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_amount_incl_tax'], $tax['amount_incl_tax']); ?></span>
137
+ <?php endforeach; ?>
138
+ </small>
139
+ <?php endif; ?>
140
+
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
142
+ <br />
143
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseWeeeTaxInclTax($_item) , $_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
144
+ <?php endif; ?>
145
+ <?php endif; ?>
146
+ </span>
147
+ <?php endif; ?>
148
+
149
+ </td>
150
+ <td><?php echo $this->getColumnHtml($_item, 'qty') ?></td>
151
+
152
+ <td class="a-right">
153
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
154
+ <span class="price-excl-tax">
155
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
156
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
157
+ <?php endif; ?>
158
+
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
160
+ <?php
161
+ echo $this->displayPrices(
162
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
163
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
164
+ );
165
+ ?>
166
+ <?php else: ?>
167
+ <?php echo $this->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
168
+ <?php endif; ?>
169
+
170
+
171
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
173
+ <small>
174
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
175
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
176
+ <?php endforeach; ?>
177
+ </small>
178
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
179
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
180
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></small></span>
181
+ <?php endforeach; ?>
182
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
183
+ <small>
184
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
185
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount'], $tax['row_amount']); ?></span>
186
+ <?php endforeach; ?>
187
+ </small>
188
+ <?php endif; ?>
189
+
190
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
191
+ <br />
192
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br />
193
+ <?php
194
+ echo $this->displayPrices(
195
+ $_item->getBaseRowTotal()+$_item->getBaseWeeeTaxAppliedRowAmount()+$_item->getBaseWeeeTaxRowDisposition(),
196
+ $_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()
197
+ );
198
+ ?>
199
+ </span>
200
+ <?php endif; ?>
201
+ <?php endif; ?>
202
+ </span>
203
+ <br />
204
+ <?php endif; ?>
205
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
206
+ <span class="price-incl-tax">
207
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
208
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
209
+ <?php endif; ?>
210
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
211
+ <?php $_baseIncl = $this->helper('checkout')->getBaseSubtotalInclTax($_item); ?>
212
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales', $_item->getStoreId())): ?>
213
+ <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item), $_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
214
+ <?php else: ?>
215
+ <?php echo $this->displayPrices($_baseIncl-$_item->getBaseWeeeTaxRowDisposition(), $_incl-$_item->getWeeeTaxRowDisposition()) ?>
216
+ <?php endif; ?>
217
+
218
+
219
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
220
+
221
+ <br />
222
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales', $_item->getStoreId())): ?>
223
+ <small>
224
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
225
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
226
+ <?php endforeach; ?>
227
+ </small>
228
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
229
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
230
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></small></span>
231
+ <?php endforeach; ?>
232
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales', $_item->getStoreId())): ?>
233
+ <small>
234
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
235
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->displayPrices($tax['base_row_amount_incl_tax'], $tax['row_amount_incl_tax']); ?></span>
236
+ <?php endforeach; ?>
237
+ </small>
238
+ <?php endif; ?>
239
+
240
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales', $_item->getStoreId())): ?>
241
+ <br /><span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl + Mage::helper('weee')->getBaseRowWeeeTaxInclTax($_item),$_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
242
+ <?php endif; ?>
243
+ <?php endif; ?>
244
+ </span>
245
+ <?php endif; ?>
246
+ </td>
247
+ <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
248
+ <td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
249
+ <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
250
+ <td class="a-right last">
251
+ <?php echo $this->displayPrices(
252
+ $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + Mage::helper('weee')->getBaseRowWeeeAmountAfterDiscount($_item) - $_item->getBaseDiscountAmount(),
253
+ $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + Mage::helper('weee')->getRowWeeeAmountAfterDiscount($_item) - $_item->getDiscountAmount()
254
+ ); ?>
255
+ </td>
256
+ </tr>
app/design/adminhtml/default/default/template/carebyzinc/system/tokenvalidate.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ */
4
+ ?><script type="text/javascript">
5
+ //<![CDATA[
6
+ function validate() {
7
+ new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
8
+ method: 'get',
9
+ onSuccess: function(transport){
10
+ data = transport.responseText;
11
+ alert(data)
12
+ }
13
+ });
14
+ }
15
+ //]]>
16
+ </script>
17
+
18
+ <?php echo $this->getButtonHtml() ?>
app/design/frontend/base/default/layout/zinc_carebyzinc.xml ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss" ifconfig="carebyzinc/general/enabled"><stylesheet>carebyzinc/css/carebyzinc.css</stylesheet></action>
6
+ </reference>
7
+ <reference name="minicart_content">
8
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
9
+ <type>default</type>
10
+ <block>checkout/cart_item_renderer</block>
11
+ <template>carebyzinc/checkout/cart/minicart/default.phtml</template>
12
+ </action>
13
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
14
+ <type>simple</type>
15
+ <block>checkout/cart_item_renderer</block>
16
+ <template>carebyzinc/checkout/cart/minicart/default.phtml</template>
17
+ </action>
18
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
19
+ <type>grouped</type>
20
+ <block>checkout/cart_item_renderer_grouped</block>
21
+ <template>carebyzinc/checkout/cart/minicart/default.phtml</template>
22
+ </action>
23
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
24
+ <type>configurable</type>
25
+ <block>checkout/cart_item_renderer_configurable</block>
26
+ <template>carebyzinc/checkout/cart/minicart/default.phtml</template>
27
+ </action>
28
+
29
+ </reference>
30
+ </default>
31
+ <carebyzinc_index_index>
32
+ <reference name="content">
33
+ <block type="carebyzinc/carebyzinc" name="carebyzinc" template="carebyzinc/carebyzinc.phtml" />
34
+ </reference>
35
+ </carebyzinc_index_index>
36
+ <catalog_product_view translate="label">
37
+ <reference name="head">
38
+ <action method="addJs" ifconfig="carebyzinc/general/enabled"><script>carebyzinc/product.js</script></action>
39
+ <action method="removeItem" ifconfig="carebyzinc/general/enabled"><type>js</type><name>varien/product.js</name></action>
40
+ <action method="addJs" ifconfig="carebyzinc/general/enabled">
41
+ <script>carebyzinc/jquery.colorbox.js</script>
42
+ </action>
43
+ <action method="addCss" ifconfig="carebyzinc/general/enabled">
44
+ <stylesheet>carebyzinc/css/colorbox.css</stylesheet>
45
+ </action>
46
+ </reference>
47
+ <reference name="product.info.extrahint">
48
+ <block type="carebyzinc/carebyzinc" name="carebyzinc" before="product.info.media">
49
+ <action method="setTemplate" ifconfig="carebyzinc/general/enabled"><template>carebyzinc/carebyzinc.phtml</template></action>
50
+ </block>
51
+ </reference>
52
+ </catalog_product_view>
53
+ <checkout_cart_index>
54
+ <reference name="head">
55
+ <action method="addJs" ifconfig="carebyzinc/general/enabled">
56
+ <script>carebyzinc/jquery.colorbox.js</script>
57
+ </action>
58
+ <action method="addCss" ifconfig="carebyzinc/general/enabled">
59
+ <stylesheet>carebyzinc/css/colorbox.css</stylesheet>
60
+ </action>
61
+ </reference>
62
+ <reference name="checkout.cart">
63
+ <action method="setCartTemplate" ifconfig="carebyzinc/general/enabled">
64
+ <value>carebyzinc/checkout/cart.phtml</value>
65
+ </action>
66
+ <action method="setEmptyTemplate" ifconfig="carebyzinc/general/enabled">
67
+ <value>checkout/cart/noItems.phtml</value>
68
+ </action>
69
+ <action method="chooseTemplate"/>
70
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
71
+ <type>simple</type>
72
+ <block>checkout/cart_item_renderer</block>
73
+ <template>carebyzinc/checkout/cart/item/default.phtml</template>
74
+ </action>
75
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
76
+ <type>grouped</type>
77
+ <block>checkout/cart_item_renderer_grouped</block>
78
+ <template>carebyzinc/checkout/cart/item/default.phtml</template>
79
+ </action>
80
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
81
+ <type>configurable</type>
82
+ <block>checkout/cart_item_renderer_configurable</block>
83
+ <template>carebyzinc/checkout/cart/item/default.phtml</template>
84
+ </action>
85
+ </reference>
86
+ </checkout_cart_index>
87
+ <checkout_onepage_review>
88
+ <reference name="root">
89
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
90
+ <type>default</type>
91
+ <block>checkout/cart_item_renderer</block>
92
+ <template>carebyzinc/checkout/onepage/review/item.phtml</template>
93
+ </action>
94
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
95
+ <type>grouped</type>
96
+ <block>checkout/cart_item_renderer_grouped</block>
97
+ <template>carebyzinc/checkout/onepage/review/item.phtml</template>
98
+ </action>
99
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
100
+ <type>configurable</type>
101
+ <block>checkout/cart_item_renderer_configurable</block>
102
+ <template>carebyzinc/checkout/onepage/review/item.phtml</template>
103
+ </action>
104
+
105
+ </reference>
106
+
107
+ </checkout_onepage_review>
108
+ <checkout_multishipping_addresses>
109
+ <reference name="checkout_addresses">
110
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
111
+ <type>default</type>
112
+ <block>checkout/cart_item_renderer</block>
113
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
114
+ </action>
115
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
116
+ <type>grouped</type>
117
+ <block>checkout/cart_item_renderer_grouped</block>
118
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
119
+ </action>
120
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
121
+ <type>configurable</type>
122
+ <block>checkout/cart_item_renderer_configurable</block>
123
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
124
+ </action>
125
+
126
+ </reference>
127
+ </checkout_multishipping_addresses>
128
+ <checkout_multishipping_shipping>
129
+ <reference name="checkout_shipping">
130
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
131
+ <type>default</type>
132
+ <block>checkout/cart_item_renderer</block>
133
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
134
+ </action>
135
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
136
+ <type>grouped</type>
137
+ <block>checkout/cart_item_renderer_grouped</block>
138
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
139
+ </action>
140
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
141
+ <type>configurable</type>
142
+ <block>checkout/cart_item_renderer_configurable</block>
143
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
144
+ </action>
145
+
146
+ </reference>
147
+ </checkout_multishipping_shipping>
148
+ <checkout_multishipping_overview>
149
+ <reference name="checkout_overview">
150
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
151
+ <type>default</type>
152
+ <block>checkout/cart_item_renderer</block>
153
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
154
+ </action>
155
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
156
+ <type>grouped</type>
157
+ <block>checkout/cart_item_renderer_grouped</block>
158
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
159
+ </action>
160
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
161
+ <type>configurable</type>
162
+ <block>checkout/cart_item_renderer_configurable</block>
163
+ <template>carebyzinc/checkout/multishipping/item/default.phtml</template>
164
+ </action>
165
+ <action method="addRowItemRender" ifconfig="carebyzinc/general/enabled">
166
+ <type>grouped</type>
167
+ <block>checkout/cart_item_renderer_grouped</block>
168
+ <template>checkout/multishipping/overview/item.phtml</template>
169
+ </action>
170
+ <action method="addRowItemRender" ifconfig="carebyzinc/general/enabled">
171
+ <type>configurable</type>
172
+ <block>checkout/cart_item_renderer_configurable</block>
173
+ <template>checkout/multishipping/overview/item.phtml</template>
174
+ </action>
175
+
176
+
177
+ </reference>
178
+
179
+ </checkout_multishipping_overview>
180
+
181
+ <sales_order_view>
182
+ <reference name="order_items">
183
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
184
+ <type>default</type>
185
+ <block>sales/order_item_renderer_default</block>
186
+ <template>carebyzinc/sales/order/items/renderer/default.phtml</template>
187
+ </action>
188
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
189
+ <type>grouped</type>
190
+ <block>sales/order_item_renderer_grouped</block>
191
+ <template>carebyzinc/sales/order/items/renderer/default.phtml</template>
192
+ </action>
193
+ </reference>
194
+ </sales_order_view>
195
+ <sales_order_print>
196
+ <reference name="sales.order.print">
197
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
198
+ <type>default</type>
199
+ <block>sales/order_item_renderer_default</block>
200
+ <template>carebyzinc/sales/order/items/renderer/default.phtml</template>
201
+ </action>
202
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
203
+ <type>grouped</type>
204
+ <block>sales/order_item_renderer_grouped</block>
205
+ <template>carebyzinc/sales/order/items/renderer/default.phtml</template>
206
+ </action>
207
+ </reference>
208
+ </sales_order_print>
209
+
210
+ <sales_order_invoice>
211
+ <reference name="invoice_items">
212
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
213
+ <type>default</type>
214
+ <block>sales/order_item_renderer_default</block>
215
+ <template>carebyzinc/sales/order/invoice/items/renderer/default.phtml</template>
216
+ </action>
217
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
218
+ <type>grouped</type>
219
+ <block>sales/order_item_renderer_grouped</block>
220
+ <template>carebyzinc/sales/order/invoice/items/renderer/default.phtml</template>
221
+ </action>
222
+ </reference>
223
+ </sales_order_invoice>
224
+ <sales_order_printinvoice>
225
+ <reference name="sales.order.print.invoice">
226
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
227
+ <type>default</type>
228
+ <block>sales/order_item_renderer_default</block>
229
+ <template>carebyzinc/sales/order/invoice/items/renderer/default.phtml</template>
230
+ </action>
231
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
232
+ <type>grouped</type>
233
+ <block>sales/order_item_renderer_grouped</block>
234
+ <template>carebyzinc/sales/order/invoice/items/renderer/default.phtml</template>
235
+ </action>
236
+ </reference>
237
+ </sales_order_printinvoice>
238
+ <sales_order_shipment>
239
+ <reference name="shipment_items">
240
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
241
+ <type>default</type>
242
+ <block>sales/order_item_renderer_default</block>
243
+ <template>carebyzinc/sales/order/shipment/items/renderer/default.phtml</template>
244
+ </action>
245
+
246
+ </reference>
247
+ </sales_order_shipment>
248
+ <sales_order_printshipment>
249
+ <reference name="sales.order.print.shipment">
250
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
251
+ <type>default</type>
252
+ <block>sales/order_item_renderer_default</block>
253
+ <template>carebyzinc/sales/order/shipment/items/renderer/default.phtml</template>
254
+ </action>
255
+
256
+ </reference>
257
+ </sales_order_printshipment>
258
+ <sales_order_creditmemo>
259
+ <reference name="creditmemo_items">
260
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
261
+ <type>default</type>
262
+ <block>sales/order_item_renderer_default</block>
263
+ <template>carebyzinc/sales/order/creditmemo/items/renderer/default.phtml</template>
264
+ </action>
265
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
266
+ <type>grouped</type>
267
+ <block>sales/order_item_renderer_grouped</block>
268
+ <template>carebyzinc/sales/order/creditmemo/items/renderer/default.phtml</template>
269
+ </action>
270
+
271
+ </reference>
272
+ </sales_order_creditmemo>
273
+
274
+ <sales_order_printcreditmemo>
275
+ <reference name="sales.order.print.creditmemo">
276
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
277
+ <type>default</type>
278
+ <block>sales/order_item_renderer_default</block>
279
+ <template>carebyzinc/sales/order/creditmemo/items/renderer/default.phtml</template>
280
+ </action>
281
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
282
+ <type>grouped</type>
283
+ <block>sales/order_item_renderer_grouped</block>
284
+ <template>carebyzinc/sales/order/creditmemo/items/renderer/default.phtml</template>
285
+ </action>
286
+ </reference>
287
+ </sales_order_printcreditmemo>
288
+ <sales_email_order_items>
289
+ <reference name="items">
290
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
291
+ <type>default</type>
292
+ <block>sales/order_email_items_order_default</block>
293
+ <template>carebyzinc/email/order/items/order/default.phtml</template>
294
+ </action>
295
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
296
+ <type>grouped</type>
297
+ <block>sales/order_email_items_order_grouped</block>
298
+ <template>carebyzinc/email/order/items/order/default.phtml</template>
299
+ </action>
300
+ </reference>
301
+ </sales_email_order_items>
302
+
303
+ <sales_email_order_invoice_items>
304
+ <reference name="items">
305
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
306
+ <type>default</type>
307
+ <block>sales/order_email_items_order_default</block>
308
+ <template>carebyzinc/email/order/items/invoice/default.phtml</template>
309
+ </action>
310
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
311
+ <type>grouped</type>
312
+ <block>sales/order_email_items_order_grouped</block>
313
+ <template>carebyzinc/email/order/items/invoice/default.phtml</template>
314
+ </action>
315
+ </reference>
316
+ </sales_email_order_invoice_items>
317
+ <sales_email_order_shipment_items>
318
+ <reference name="items">
319
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
320
+ <type>default</type>
321
+ <block>sales/order_email_items_order_default</block>
322
+ <template>carebyzinc/email/order/items/shipment/default.phtml</template>
323
+ </action>
324
+
325
+ </reference>
326
+
327
+ </sales_email_order_shipment_items>
328
+ <sales_email_order_creditmemo_items>
329
+ <reference name="items">
330
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
331
+ <type>default</type>
332
+ <block>sales/order_email_items_order_default</block>
333
+ <template>carebyzinc/email/order/items/creditmemo/default.phtml</template>
334
+ </action>
335
+ <action method="addItemRender" ifconfig="carebyzinc/general/enabled">
336
+ <type>grouped</type>
337
+ <block>sales/order_email_items_order_grouped</block>
338
+ <template>carebyzinc/email/order/items/creditmemo/default.phtml</template>
339
+ </action>
340
+
341
+ </reference>
342
+
343
+ </sales_email_order_creditmemo_items>
344
+
345
+
346
+ </layout>
app/design/frontend/base/default/template/carebyzinc/carebyzinc.phtml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Care by Zinc in Product Page
4
+ */
5
+
6
+ ?>
7
+ <?php $product_id = Mage::registry('current_product')->getId();
8
+ $product = Mage::getModel('catalog/product')->load($product_id);
9
+ $productType = $product->getTypeId();
10
+ $price = $product->getFinalPrice();
11
+ $helper = Mage::helper('carebyzinc');
12
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1) && ($helper->validatePrice($price) == 'true') && ($helper->checkQuoteVisibility())):
13
+
14
+ $zip = $helper->getZipCode(); ?>
15
+ <div class="product-box">
16
+ <h1 class="product-title"><?php echo $helper->getTitle()?></h1>
17
+ <input type="text" name="zipcode" id="zipcode" value="<?php echo $zip ;?>" placeholder="Enter Zip code here" style="width:21%"/>
18
+ <button class="btn-zinc showCarebyzinc" onclick="showCarebyzinc(); return false;">Get Quote <span id="care-loader" class="care-loader"></span></button>
19
+ <div id="carebyzincCnt" class="product-wrap"></div>
20
+ </div>
21
+ <script>
22
+ //<![CDATA[
23
+ function showCarebyzinc(){
24
+ var val = document.getElementsByClassName("super-attribute-select");
25
+ var customoption = document.getElementsByClassName("product-custom-option");
26
+ var i;
27
+ var configOptions = '';
28
+ if(val.length)
29
+ configOptions = '{';
30
+ for (i = 0; i < val.length; i++) {
31
+ var option = (val[i].name).match(/\d+/)[0];
32
+ configOptions = configOptions+'"'+option+'":'+val[i].value;
33
+ if(i != (val.length-1))
34
+ configOptions = configOptions+',';
35
+ }
36
+ if(val.length)
37
+ configOptions = configOptions+'}';
38
+ var customoptionPrice = 0;
39
+ for (i = 0; i < customoption.length; i++) {
40
+ var option = customoption[i].value;
41
+ var selectedIndex = customoption[i].selectedIndex;
42
+ if(selectedIndex)
43
+ customoptionPrice = customoptionPrice + customoption[i][selectedIndex].getAttribute('price');
44
+ }
45
+ var zip = document.getElementById('zipcode').value;
46
+ if(zip){
47
+
48
+ if(/(^[A-z0-9]{2,10}([\s]{0,1}|[\-]{0,1})[A-z0-9]{2,10}$)/.test(zip)){
49
+ var url = '<?php echo $this->getUrl("carebyzinc/index/pricequote") ?>';
50
+ jQuery( "button" ).addClass( "selected" );
51
+ jQuery("#care-loader").addClass('show');
52
+ new Ajax.Request(url, {
53
+ method: 'post',
54
+ parameters: {pid: <?php echo Mage::registry('current_product')->getId(); ?>,zip:zip,configOptions:configOptions,customoptionPrice:customoptionPrice},
55
+ onComplete: function(transport) {
56
+ var content = JSON.parse(transport.responseText);
57
+ jQuery("#carebyzincCnt").show();
58
+ $('carebyzincCnt').update(content);
59
+ jQuery("#care-loader").removeClass('show');
60
+ jQuery( "button" ).removeClass( "selected" );
61
+ // jQuery(".showCarebyzinc").hide();
62
+ // jQuery("#zipcode").hide();
63
+ }
64
+
65
+ });
66
+ }
67
+ else
68
+ alert('Enter a valid zipcode');
69
+ }else
70
+ alert('Enter a valid zipcode');
71
+ }
72
+ jQuery(".configurable-swatch-list li a").click(function(){
73
+ jQuery("#carebyzincCnt").hide();
74
+ $('carebyzincCnt').update('');
75
+ });
76
+ jQuery("select.super-attribute-select").change(function(){
77
+ jQuery("#carebyzincCnt").hide();
78
+ $('carebyzincCnt').update('');
79
+ });
80
+
81
+
82
+
83
+
84
+ //]]>
85
+ </script>
86
+ <?php endif; ?>
app/design/frontend/base/default/template/carebyzinc/checkout/cart.phtml ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Shopping cart template
30
+ *
31
+ * @var $this Mage_Checkout_Block_Cart
32
+ */
33
+ ?>
34
+ <?php $_priceDisplay = ($this->helper('tax')->displayCartBothPrices()) ? 'display-both-prices' : 'display-single-price'; ?>
35
+ <div class="cart <?php echo $_priceDisplay; ?>">
36
+ <div class="page-title title-buttons">
37
+ <h1><?php echo $this->__('Shopping Cart') ?></h1>
38
+ <?php if(!$this->hasError()): ?>
39
+ <ul class="checkout-types top">
40
+ <?php foreach ($this->getMethods('top_methods') as $method): ?>
41
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
42
+ <li><?php echo $methodHtml; ?></li>
43
+ <?php endif; ?>
44
+ <?php endforeach; ?>
45
+ </ul>
46
+ <?php endif; ?>
47
+ </div>
48
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
49
+ <?php echo $this->getChildHtml('form_before') ?>
50
+ <form action="<?php echo $this->getFormActionUrl() ?>" method="post">
51
+ <?php echo $this->getBlockHtml('formkey'); ?>
52
+ <table id="shopping-cart-table" class="cart-table data-table">
53
+ <col width="1" />
54
+ <col width="1" />
55
+ <col width="1" />
56
+ <col width="1" />
57
+ <col width="1" />
58
+ <col width="1" />
59
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
60
+ <col width="1" />
61
+ <col width="1" />
62
+ <?php endif; ?>
63
+
64
+ <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
65
+ <thead>
66
+ <tr>
67
+ <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product') ?></span></th>
68
+
69
+ <th rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
70
+
71
+ <th class="a-center cart-price-head" colspan="<?php echo $mergedCells; ?>">
72
+ <!-- <div class="cart-price-placeholder">-->
73
+ <span class="nobr"><?php echo $this->__('Price') ?></span>
74
+ <!-- </div>-->
75
+ </th>
76
+
77
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center">
78
+ <?php echo $this->__('Qty') ?>
79
+
80
+ <?php /*if ($this->helper('wishlist')->isAllowInCart()) : ?>
81
+ <span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span>
82
+ <?php endif*/ ?>
83
+
84
+ </th>
85
+
86
+ <th class="a-center cart-total-head" colspan="<?php echo $mergedCells; ?>">
87
+ <!-- <div class="cart-total-placeholder">-->
88
+ <?php echo $this->__('Subtotal') ?>
89
+ <!-- </div>-->
90
+ </th>
91
+
92
+ <th class="a-center" rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
93
+
94
+ </tr>
95
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
96
+ <tr>
97
+ <th class="a-center cart-price-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
98
+ <th class="a-center cart-price-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
99
+ <th class="a-center cart-total-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
100
+ <th class="a-center cart-total-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
101
+ </tr>
102
+ <?php endif; ?>
103
+ </thead>
104
+ <tfoot>
105
+ <tr>
106
+ <td colspan="50" class="a-right cart-footer-actions">
107
+
108
+ <!-- Make this button the first responder rather than empty cart -->
109
+ <button type="submit" style="visibility:hidden;" data-cart-item-update name="update_cart_action" value="update_qty" title="<?php echo $this->quoteEscape($this->__('Update Shopping Cart')); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
110
+
111
+ <button type="submit" name="update_cart_action" data-cart-empty value="empty_cart" title="<?php echo $this->quoteEscape($this->__('Empty Cart')); ?>" class="button2 btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Empty Cart'); ?></span></span></button>
112
+
113
+ <button type="submit" name="update_cart_action" data-cart-item-update value="update_qty" title="<?php echo $this->quoteEscape($this->__('Update Shopping Cart')); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
114
+
115
+ <span class="or">-<?php echo $this->__('or'); ?>-</span>
116
+
117
+ <?php if($this->getContinueShoppingUrl()): ?>
118
+ <button type="button" title="<?php echo $this->quoteEscape($this->__('Continue Shopping')) ?>" class="button2 btn-continue" onclick="setLocation('<?php echo Mage::helper('core')->quoteEscape($this->getContinueShoppingUrl()) ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
119
+ <?php endif; ?>
120
+ <!--[if lt IE 8]>
121
+ <input type="hidden" id="update_cart_action_container" data-cart-item-update />
122
+ <script type="text/javascript">
123
+ //<![CDATA[
124
+ Event.observe(window, 'load', function()
125
+ {
126
+ // Internet Explorer (lt 8) does not support value attribute in button elements
127
+ $emptyCartButton = $('empty_cart_button');
128
+ $cartActionContainer = $('update_cart_action_container');
129
+ if ($emptyCartButton && $cartActionContainer) {
130
+ Event.observe($emptyCartButton, 'click', function()
131
+ {
132
+ $emptyCartButton.setAttribute('name', 'update_cart_action_temp');
133
+ $cartActionContainer.setAttribute('name', 'update_cart_action');
134
+ $cartActionContainer.setValue('empty_cart');
135
+ });
136
+ }
137
+
138
+ });
139
+ //]]>
140
+ </script>
141
+ <![endif]-->
142
+ </td>
143
+ </tr>
144
+ </tfoot>
145
+ <tbody>
146
+ <?php foreach($this->getItems() as $_item): ?>
147
+ <?php echo $this->getItemHtml($_item) ?>
148
+ <?php endforeach ?>
149
+ </tbody>
150
+ </table>
151
+ <script type="text/javascript">decorateTable('shopping-cart-table')</script>
152
+ </form>
153
+
154
+ <?php echo $this->getChildHtml('shopping.cart.table.after'); ?>
155
+ <div class="cart-forms">
156
+ <?php /* Extensions placeholder */ ?>
157
+ <?php echo $this->getChildHtml('checkout_cart_widget') ?>
158
+ <?php echo $this->getChildHtml('coupon') ?>
159
+ <?php echo $this->getChildHtml('checkout.cart.extra') ?>
160
+ <?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
161
+ </div>
162
+ <div class="cart-totals-wrapper">
163
+ <div class="cart-totals">
164
+ <?php echo $this->getChildHtml('totals'); ?>
165
+ <?php if(!$this->hasError()): ?>
166
+ <ul class="checkout-types bottom">
167
+ <?php foreach ($this->getMethods('methods') as $method): ?>
168
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
169
+ <li class="method-<?php echo preg_replace("/[^_a-zA-Z0-9-]/", '-', $method); ?>"><?php echo $methodHtml; ?></li>
170
+ <?php endif; ?>
171
+ <?php endforeach; ?>
172
+ </ul>
173
+ <?php endif; ?>
174
+ </div>
175
+ </div>
176
+ <?php echo $this->getChildHtml('crosssell') ?>
177
+ </div>
178
+ <script>
179
+ //<![CDATA[
180
+ function showCarebyzinc(pid,itemId){
181
+ var zip = document.getElementById('zipcode_'+itemId).value;
182
+ if(zip){
183
+ if(/(^[A-z0-9]{2,10}([\s]{0,1}|[\-]{0,1})[A-z0-9]{2,10}$)/.test(zip)){
184
+ var url = '<?php echo $this->getUrl("carebyzinc/index/priceQuote") ?>';
185
+ var cntid = "carebyzincCnt_"+itemId;
186
+ var loader = "#care-loader_"+itemId;
187
+ jQuery(loader).show();
188
+ new Ajax.Request(url, {
189
+ method: 'post',
190
+ parameters: {pid: pid,itemId:itemId,zip:zip},
191
+ onComplete: function(transport) {
192
+ var content = JSON.parse(transport.responseText);
193
+ $(cntid).update(content);
194
+ jQuery(loader).hide();
195
+ // var id = "#showCarebyzinc_"+itemId;
196
+ // jQuery(id).hide();
197
+ //jQuery("#zipcode_"+itemId).hide();
198
+ }
199
+
200
+ });
201
+ }
202
+ else
203
+ alert('Enter a valid zipcode');
204
+ }else
205
+ alert('Enter a valid zipcode');
206
+ }
207
+
208
+ function updateCareByZinc(itemId)
209
+ {
210
+
211
+ var url = '<?php echo $this->getUrl('carebyzinc/index/updatePriceQuoteinCart') ?>';
212
+ var name = "carebyzinc_option_"+itemId;
213
+ var radio = document.getElementsByName(name);
214
+ var c = -1;
215
+ for(var i=0; i < radio.length; i++){
216
+ if(radio[i].checked) {
217
+ c = i;
218
+ }
219
+ }
220
+ if (c == -1)
221
+ alert('Please select an option.');
222
+ else{
223
+
224
+ var val = document.querySelector('input[name="'+name+'"]:checked').value;
225
+ new Ajax.Request(url, {
226
+ method: 'post',
227
+ parameters: { carebyzinc: val,itemId:itemId },
228
+ onComplete: function(transport) {
229
+ var content = transport.responseText;
230
+ window.location = '';
231
+ }
232
+
233
+ });
234
+ }
235
+ }
236
+ jQuery.noConflict();
237
+ jQuery(document).ready(function() {
238
+ jQuery("a", ".quotelabel").click(
239
+ function(event) {
240
+ event.preventDefault();
241
+ var elementURL = jQuery(this).attr("href");
242
+ jQuery.colorbox({iframe: true, href: elementURL, innerWidth: 645,fastIframe: false, innerHeight: 509,width:"70%"});
243
+ });
244
+ });
245
+ //]]>
246
+ </script>
app/design/frontend/base/default/template/carebyzinc/checkout/cart/item/default.phtml ADDED
@@ -0,0 +1,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <?php
33
+ $product = Mage::getModel('catalog/product')->load($_item->getProductId());
34
+ $productType = $product->getTypeId();
35
+ $flag = 0;
36
+ $model = Mage::getModel('carebyzinc/carebyzinc');
37
+ if($product->getCarebyzinc() != 1)
38
+ $carebyStatus = $model->getwarrantyStatus($_item->getId());
39
+ $helper = Mage::helper('carebyzinc');
40
+
41
+ if(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) || ($productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) )
42
+ $flag = 1;
43
+
44
+ ?>
45
+
46
+ <tr <?php if($flag) echo "style='border-bottom:0px'"; ?>>
47
+ <td class="product-cart-image" rowspan="2">
48
+ <?php if ($this->hasProductUrl()):?>
49
+ <a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image">
50
+ <?php endif;?>
51
+ <img src="<?php echo $this->getProductThumbnail()->resize(180); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />
52
+ <?php if ($this->hasProductUrl()):?>
53
+ </a>
54
+ <?php endif;?>
55
+
56
+ <ul class="cart-links">
57
+ <?php if ($isVisibleProduct): ?>
58
+ <li>
59
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
60
+ </li>
61
+ <?php endif ?>
62
+
63
+ <?php if ($this->helper('wishlist')->isAllowInCart() && $isVisibleProduct) : ?>
64
+ <li>
65
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
66
+ </li>
67
+ <?php endif ?>
68
+ </ul>
69
+ </td>
70
+
71
+ <td class="product-cart-info">
72
+
73
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
74
+
75
+ <h2 class="product-name">
76
+ <?php if ($this->hasProductUrl()):?>
77
+ <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a>
78
+ <?php else: ?>
79
+ <?php echo $this->escapeHtml($this->getProductName()) ?>
80
+ <?php endif; ?>
81
+ </h2>
82
+
83
+ <div class="product-cart-sku">
84
+ <span class="label"><?php echo $this->__('SKU'); ?>:</span> <?php echo $this->escapeHtml($_item->getSku()); ?>
85
+ </div>
86
+
87
+ <?php if ($_options = $this->getOptionList()):?>
88
+ <dl class="item-options">
89
+ <?php foreach ($_options as $_option) : ?>
90
+ <?php if($_option['label'] != 'carebyzinc'):?>
91
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
92
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
93
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
94
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
95
+ <div class="truncated_full_value">
96
+ <dl class="item-options">
97
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
98
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
99
+ </dl>
100
+ </div>
101
+ <?php endif; ?>
102
+ </dd>
103
+ <?php endif;?>
104
+ <?php endforeach; ?>
105
+ </dl>
106
+ <?php endif;?>
107
+
108
+ <?php if ($messages = $this->getMessages()): ?>
109
+ <?php foreach ($messages as $message): ?>
110
+ <p class="item-msg <?php echo $message['type'] ?>">
111
+ * <?php echo $this->escapeHtml($message['text']) ?>
112
+ </p>
113
+ <?php endforeach; ?>
114
+ <?php endif; ?>
115
+
116
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
117
+ <?php if ($addInfoBlock): ?>
118
+ <?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
119
+ <?php endif;?>
120
+
121
+ </td>
122
+
123
+ <?php if ($canApplyMsrp): ?>
124
+ <td class="a-center product-cart-price"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
125
+ <span class="cart-price">
126
+ <span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
127
+ <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
128
+ <a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
129
+
130
+ <script type="text/javascript">
131
+ Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What&#39;s this?") ?>");
132
+ </script>
133
+
134
+ </span>
135
+ </td>
136
+ <?php else: ?>
137
+
138
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
139
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Excl. Tax'); ?>">
140
+
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
142
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
143
+ <?php else: ?>
144
+ <span class="cart-price">
145
+ <?php endif; ?>
146
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
147
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
148
+ <?php else: ?>
149
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
150
+ <?php endif; ?>
151
+
152
+ </span>
153
+
154
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
155
+
156
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
157
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
158
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
159
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
160
+ <?php endforeach; ?>
161
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
162
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
163
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
164
+ <?php endforeach; ?>
165
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
166
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
167
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
168
+ <?php endforeach; ?>
169
+ <?php endif; ?>
170
+ </div>
171
+
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
173
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
174
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
175
+ </div>
176
+ <?php endif; ?>
177
+ <?php endif; ?>
178
+ </td>
179
+ <?php endif; ?><!-- inclusive price starts here -->
180
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
181
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Incl. Tax'); ?>">
182
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
184
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
185
+ <?php else: ?>
186
+ <span class="cart-price">
187
+ <?php endif; ?>
188
+
189
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
190
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
191
+ <?php else: ?>
192
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
193
+ <?php endif; ?>
194
+
195
+ </span>
196
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
197
+
198
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
199
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
200
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
201
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
202
+ <?php endforeach; ?>
203
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
204
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
205
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
206
+ <?php endforeach; ?>
207
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
208
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
209
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
210
+ <?php endforeach; ?>
211
+ <?php endif; ?>
212
+ </div>
213
+
214
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
215
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
216
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
217
+ </div>
218
+ <?php endif; ?>
219
+ <?php endif; ?>
220
+ </td>
221
+ <?php endif; ?>
222
+ <?php endif; ?>
223
+ <td class="product-cart-actions" data-rwd-label="<?php echo $this->__('Qty'); ?>">
224
+ <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4"
225
+ data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>"
226
+ title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" />
227
+
228
+ <button type="submit" name="update_cart_action" data-cart-item-update value="update_qty" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Update')); ?>" class="button btn-update"><span><span><?php echo $this->__('Update'); ?></span></span>
229
+ </button>
230
+
231
+ <ul class="cart-links">
232
+ <?php if ($isVisibleProduct): ?>
233
+ <li>
234
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
235
+ </li>
236
+ <?php endif ?>
237
+
238
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
239
+ <li>
240
+ <?php if ($isVisibleProduct): ?>
241
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
242
+ <?php endif ?>
243
+ </li>
244
+ <?php endif ?>
245
+ </ul>
246
+
247
+ </td>
248
+
249
+ <!--Sub total starts here -->
250
+ <?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
251
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>">
252
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
253
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
254
+ <?php else: ?>
255
+ <span class="cart-price">
256
+ <?php endif; ?>
257
+
258
+ <?php if ($canApplyMsrp): ?>
259
+ <span class="cart-msrp-subtotal">--</span>
260
+ <?php else: ?>
261
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
262
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
263
+ <?php else: ?>
264
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
265
+ <?php endif; ?>
266
+ <?php endif; ?>
267
+
268
+ </span>
269
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
270
+
271
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
272
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
273
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
274
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
275
+ <?php endforeach; ?>
276
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
277
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
278
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
279
+ <?php endforeach; ?>
280
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
281
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
282
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
283
+ <?php endforeach; ?>
284
+ <?php endif; ?>
285
+ </div>
286
+
287
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
288
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
289
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
290
+ </div>
291
+ <?php endif; ?>
292
+ <?php endif; ?>
293
+ </td>
294
+ <?php endif; ?>
295
+ <?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
296
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>">
297
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
298
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
299
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
300
+ <?php else: ?>
301
+ <span class="cart-price">
302
+ <?php endif; ?>
303
+
304
+ <?php if ($canApplyMsrp): ?>
305
+ <span class="cart-msrp-subtotal">--</span>
306
+ <?php else: ?>
307
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
308
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
309
+ <?php else: ?>
310
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
311
+ <?php endif; ?>
312
+ <?php endif; ?>
313
+
314
+ </span>
315
+
316
+
317
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
318
+
319
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
320
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
321
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
322
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
323
+ <?php endforeach; ?>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
325
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
326
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
327
+ <?php endforeach; ?>
328
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
329
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
330
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
331
+ <?php endforeach; ?>
332
+ <?php endif; ?>
333
+ </div>
334
+
335
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
336
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
337
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
338
+ </div>
339
+ <?php endif; ?>
340
+ <?php endif; ?>
341
+ </td>
342
+ <?php endif; ?>
343
+ <td class="a-center product-cart-remove">
344
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
345
+ </td>
346
+ </tr>
347
+ <?php
348
+
349
+ if($flag):
350
+ $careByZinc = $_item->getCarebyzincOption();
351
+ ?>
352
+ <tr><td colspan="5">
353
+ <?php if($careByZinc): ?>
354
+
355
+
356
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
357
+ <div class="product-cart-careby">
358
+ <a href="<?php echo $helper->getDeleteUrl($_item->getId()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Warranty')) ?>" class="remove_warranty"><?php //echo $this->__('Remove Warranty') ?></a>
359
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
360
+ <p class="warranty_desc quotelabel"><?php echo $carebyzincAry['description'] ?></p>
361
+
362
+ </div>
363
+
364
+ <?php else:?>
365
+ <?php
366
+
367
+ if (($product->getCarebyzinc() == 1) && ($helper->validatePrice($_item->getPrice()) == 'true')):
368
+ $zip = $helper->getZipCode();
369
+
370
+ ?>
371
+
372
+ <div class="product-box">
373
+ <h1 class="product-title"><?php echo $helper->getTitle()?></h1>
374
+ <input type="text" name="zipcode_<?php echo $_item->getId(); ?>" id="zipcode_<?php echo $_item->getId(); ?>" value="<?php echo $zip ;?>" placeholder="Enter Zip code here" style="width:21%"/>
375
+
376
+ <button class="btn-zinc showCarebyzinc" id="showCarebyzinc_<?php echo $_item->getId(); ?>" onclick="showCarebyzinc(<?php echo $_item->getProductId(); ?>,<?php echo $_item->getId(); ?>); return false;"><?php echo $this->__('Get Quote')?><span id="care-loader_<?php echo $_item->getId(); ?>" class="care-loader"></span></button>
377
+
378
+ <div id="carebyzincCnt_<?php echo $_item->getId(); ?>" class="carebyzincCnt product-container" style="display:block;">
379
+ <?php
380
+ $product = Mage::getModel('catalog/product')->load($_item->getProductId());
381
+ $itemId = $_item->getId();
382
+ $quoteDataSession = $model->getPriceQuoteinCart($product, $itemId,$zip);
383
+
384
+ ?>
385
+ <?php if(! empty($quoteDataSession)):?>
386
+ <?php if( is_array($quoteDataSession)):
387
+ $quoteData = $quoteDataSession[$itemId];?>
388
+ <ul class="product-list">
389
+ <?php foreach($quoteData as $qitem): ?>
390
+ <li>
391
+ <div class="bx-l">
392
+ <div class="squared input">
393
+ <input type="radio" value="<?php echo $qitem['id']; ?>" id="carebyzinc_<?php echo $itemId.'_'.$qitem['id']; ?>" name="carebyzinc_option_<?php echo $itemId?>" />
394
+ <label for="carebyzinc_<?php echo $itemId.'_'.$qitem['id']; ?>" ></label>
395
+ </div>
396
+ </div>
397
+ <div class="bx-r">
398
+ <h2 class="p-price"><?php echo Mage::helper('core')->currency($qitem['price_per_year']); ?></h2>
399
+ <h3 class="p-name quotelabel"><?php echo $qitem['description']; ?></h3>
400
+
401
+ </div>
402
+ </li>
403
+ <?php endforeach; ?>
404
+ </ul>
405
+ <button type="button" title="Add" class="button" id="button-container_<?php echo $itemId?>" onclick="updateCareByZinc(<?php echo $itemId?>)"><span><span>Add</span></span></button>
406
+ <?php else:
407
+ echo $quoteDataSession;
408
+ ?>
409
+ <?php endif; ?>
410
+ <?php endif; ?>
411
+
412
+
413
+ </div>
414
+ </div>
415
+ <?php endif;?>
416
+ <?php endif;?>
417
+ </td></tr>
418
+ <?php endif;?>
app/design/frontend/base/default/template/carebyzinc/checkout/cart/item/default.phtml-10-08-2016 ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <?php
33
+
34
+ $product = Mage::getModel('catalog/product')->load($_item->getProductId());
35
+ $productType = $product->getTypeId();
36
+ $flag = 0;
37
+ $model = Mage::getModel('carebyzinc/carebyzinc');
38
+ if($product->getCarebyzinc() != 1)
39
+ $carebyStatus = $model->getwarrantyStatus($_item->getId());
40
+
41
+ if($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE)
42
+ $flag = 1;
43
+
44
+ ?>
45
+
46
+ <tr <?php if($flag) echo "style='border-bottom:0px'"; ?>>
47
+ <td class="product-cart-image" rowspan="2">
48
+ <?php if ($this->hasProductUrl()):?>
49
+ <a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image">
50
+ <?php endif;?>
51
+ <img src="<?php echo $this->getProductThumbnail()->resize(180); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />
52
+ <?php if ($this->hasProductUrl()):?>
53
+ </a>
54
+ <?php endif;?>
55
+
56
+ <ul class="cart-links">
57
+ <?php if ($isVisibleProduct): ?>
58
+ <li>
59
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
60
+ </li>
61
+ <?php endif ?>
62
+
63
+ <?php if ($this->helper('wishlist')->isAllowInCart() && $isVisibleProduct) : ?>
64
+ <li>
65
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
66
+ </li>
67
+ <?php endif ?>
68
+ </ul>
69
+ </td>
70
+
71
+ <td class="product-cart-info">
72
+
73
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
74
+
75
+ <h2 class="product-name">
76
+ <?php if ($this->hasProductUrl()):?>
77
+ <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a>
78
+ <?php else: ?>
79
+ <?php echo $this->escapeHtml($this->getProductName()) ?>
80
+ <?php endif; ?>
81
+ </h2>
82
+
83
+ <div class="product-cart-sku">
84
+ <span class="label"><?php echo $this->__('SKU'); ?>:</span> <?php echo $this->escapeHtml($_item->getSku()); ?>
85
+ </div>
86
+
87
+ <?php if ($_options = $this->getOptionList()):?>
88
+ <dl class="item-options">
89
+ <?php foreach ($_options as $_option) : ?>
90
+ <?php if($_option['label'] != 'carebyzinc'):?>
91
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
92
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
93
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
94
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
95
+ <div class="truncated_full_value">
96
+ <dl class="item-options">
97
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
98
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
99
+ </dl>
100
+ </div>
101
+ <?php endif; ?>
102
+ </dd>
103
+ <?php endif;?>
104
+ <?php endforeach; ?>
105
+ </dl>
106
+ <?php endif;?>
107
+
108
+ <?php if ($messages = $this->getMessages()): ?>
109
+ <?php foreach ($messages as $message): ?>
110
+ <p class="item-msg <?php echo $message['type'] ?>">
111
+ * <?php echo $this->escapeHtml($message['text']) ?>
112
+ </p>
113
+ <?php endforeach; ?>
114
+ <?php endif; ?>
115
+
116
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
117
+ <?php if ($addInfoBlock): ?>
118
+ <?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
119
+ <?php endif;?>
120
+
121
+ </td>
122
+
123
+ <?php if ($canApplyMsrp): ?>
124
+ <td class="a-center product-cart-price"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
125
+ <span class="cart-price">
126
+ <span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
127
+ <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
128
+ <a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
129
+
130
+ <script type="text/javascript">
131
+ Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What&#39;s this?") ?>");
132
+ </script>
133
+
134
+ </span>
135
+ </td>
136
+ <?php else: ?>
137
+
138
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
139
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Excl. Tax'); ?>">
140
+
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
142
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
143
+ <?php else: ?>
144
+ <span class="cart-price">
145
+ <?php endif; ?>
146
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
147
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
148
+ <?php else: ?>
149
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
150
+ <?php endif; ?>
151
+
152
+ </span>
153
+
154
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
155
+
156
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
157
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
158
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
159
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
160
+ <?php endforeach; ?>
161
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
162
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
163
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
164
+ <?php endforeach; ?>
165
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
166
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
167
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
168
+ <?php endforeach; ?>
169
+ <?php endif; ?>
170
+ </div>
171
+
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
173
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
174
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
175
+ </div>
176
+ <?php endif; ?>
177
+ <?php endif; ?>
178
+ </td>
179
+ <?php endif; ?><!-- inclusive price starts here -->
180
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
181
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Incl. Tax'); ?>">
182
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
184
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
185
+ <?php else: ?>
186
+ <span class="cart-price">
187
+ <?php endif; ?>
188
+
189
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
190
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
191
+ <?php else: ?>
192
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
193
+ <?php endif; ?>
194
+
195
+ </span>
196
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
197
+
198
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
199
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
200
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
201
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
202
+ <?php endforeach; ?>
203
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
204
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
205
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
206
+ <?php endforeach; ?>
207
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
208
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
209
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
210
+ <?php endforeach; ?>
211
+ <?php endif; ?>
212
+ </div>
213
+
214
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
215
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
216
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
217
+ </div>
218
+ <?php endif; ?>
219
+ <?php endif; ?>
220
+ </td>
221
+ <?php endif; ?>
222
+ <?php endif; ?>
223
+ <td class="product-cart-actions" data-rwd-label="<?php echo $this->__('Qty'); ?>">
224
+ <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4"
225
+ data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>"
226
+ title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" />
227
+
228
+ <button type="submit" name="update_cart_action" data-cart-item-update value="update_qty" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Update')); ?>" class="button btn-update"><span><span><?php echo $this->__('Update'); ?></span></span>
229
+ </button>
230
+
231
+ <ul class="cart-links">
232
+ <?php if ($isVisibleProduct): ?>
233
+ <li>
234
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
235
+ </li>
236
+ <?php endif ?>
237
+
238
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
239
+ <li>
240
+ <?php if ($isVisibleProduct): ?>
241
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
242
+ <?php endif ?>
243
+ </li>
244
+ <?php endif ?>
245
+ </ul>
246
+
247
+ </td>
248
+
249
+ <!--Sub total starts here -->
250
+ <?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
251
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>">
252
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
253
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
254
+ <?php else: ?>
255
+ <span class="cart-price">
256
+ <?php endif; ?>
257
+
258
+ <?php if ($canApplyMsrp): ?>
259
+ <span class="cart-msrp-subtotal">--</span>
260
+ <?php else: ?>
261
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
262
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
263
+ <?php else: ?>
264
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
265
+ <?php endif; ?>
266
+ <?php endif; ?>
267
+
268
+ </span>
269
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
270
+
271
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
272
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
273
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
274
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
275
+ <?php endforeach; ?>
276
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
277
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
278
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
279
+ <?php endforeach; ?>
280
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
281
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
282
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
283
+ <?php endforeach; ?>
284
+ <?php endif; ?>
285
+ </div>
286
+
287
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
288
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
289
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
290
+ </div>
291
+ <?php endif; ?>
292
+ <?php endif; ?>
293
+ </td>
294
+ <?php endif; ?>
295
+ <?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
296
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>">
297
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
298
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
299
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
300
+ <?php else: ?>
301
+ <span class="cart-price">
302
+ <?php endif; ?>
303
+
304
+ <?php if ($canApplyMsrp): ?>
305
+ <span class="cart-msrp-subtotal">--</span>
306
+ <?php else: ?>
307
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
308
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
309
+ <?php else: ?>
310
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
311
+ <?php endif; ?>
312
+ <?php endif; ?>
313
+
314
+ </span>
315
+
316
+
317
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
318
+
319
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
320
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
321
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
322
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
323
+ <?php endforeach; ?>
324
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
325
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
326
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
327
+ <?php endforeach; ?>
328
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
329
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
330
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
331
+ <?php endforeach; ?>
332
+ <?php endif; ?>
333
+ </div>
334
+
335
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
336
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
337
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
338
+ </div>
339
+ <?php endif; ?>
340
+ <?php endif; ?>
341
+ </td>
342
+ <?php endif; ?>
343
+ <td class="a-center product-cart-remove">
344
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
345
+ </td>
346
+ </tr>
347
+ <?php
348
+ $helper = Mage::helper('carebyzinc');
349
+ if($flag):
350
+ $careByZinc = $_item->getCarebyzincOption();
351
+ ?>
352
+ <tr><td colspan="5">
353
+ <?php if($careByZinc): ?>
354
+
355
+
356
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
357
+ <div class="product-cart-careby">
358
+ <a href="<?php echo $helper->getDeleteUrl($_item->getId()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Warranty')) ?>" class="remove_warranty"><?php //echo $this->__('Remove Warranty') ?></a>
359
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
360
+ <p class="warranty_desc quotelabel"><?php echo $carebyzincAry['description'] ?></p>
361
+
362
+ </div>
363
+
364
+ <?php else:?>
365
+ <?php
366
+ if ($product->getCarebyzinc() == 1):
367
+ $zip = $helper->getZipCode();
368
+ ?>
369
+
370
+ <div class="product-box">
371
+ <h1 class="product-title"><?php echo $helper->getTitle()?></h1>
372
+ <input type="text" name="zipcode_<?php echo $_item->getId(); ?>" id="zipcode_<?php echo $_item->getId(); ?>" value="<?php echo $zip ;?>" placeholder="Enter Zip code here" style="width:21%"/>
373
+
374
+ <button class="btn-zinc showCarebyzinc" id="showCarebyzinc_<?php echo $_item->getId(); ?>" onclick="showCarebyzinc(<?php echo $_item->getProductId(); ?>,<?php echo $_item->getId(); ?>); return false;"><?php echo $this->__('Get Quote')?><span id="care-loader_<?php echo $_item->getId(); ?>" class="care-loader"></span></button>
375
+
376
+ <div id="carebyzincCnt_<?php echo $_item->getId(); ?>" class="carebyzincCnt product-container" style="display:block;">
377
+ <?php
378
+ $product = Mage::getModel('catalog/product')->load($_item->getProductId());
379
+ $itemId = $_item->getId();
380
+ $quoteDataSession = $model->getPriceQuoteinCart($product, $itemId,$zip);
381
+
382
+ ?>
383
+ <?php if( is_array($quoteDataSession)):
384
+ $quoteData = $quoteDataSession[$itemId];?>
385
+ <ul class="product-list">
386
+ <?php foreach($quoteData as $qitem): ?>
387
+ <li>
388
+ <div class="bx-l">
389
+ <div class="squared input">
390
+ <input type="radio" value="<?php echo $qitem['id']; ?>" id="carebyzinc_<?php echo $itemId.'_'.$qitem['id']; ?>" name="carebyzinc_option_<?php echo $itemId?>" />
391
+ <label for="carebyzinc_<?php echo $itemId.'_'.$qitem['id']; ?>" ></label>
392
+ </div>
393
+ </div>
394
+ <div class="bx-r">
395
+ <h2 class="p-price"><?php echo Mage::helper('core')->currency($qitem['price_per_year']); ?></h2>
396
+ <h3 class="p-name quotelabel"><?php echo $qitem['description']; ?></h3>
397
+
398
+ </div>
399
+ </li>
400
+ <?php endforeach; ?>
401
+ </ul>
402
+ <button type="button" title="Add" class="button" id="button-container_<?php echo $itemId?>" onclick="updateCareByZinc(<?php echo $itemId?>)"><span><span>Add</span></span></button>
403
+ <?php else:
404
+ echo $quoteDataSession;
405
+ ?>
406
+ <?php endif; ?>
407
+
408
+
409
+
410
+ </div>
411
+ </div>
412
+ <?php endif;?>
413
+ <?php endif;?>
414
+ </td></tr>
415
+ <?php endif;?>
app/design/frontend/base/default/template/carebyzinc/checkout/cart/minicart/default.phtml ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <li class="item" xmlns="http://www.w3.org/1999/html">
33
+ <?php if ($this->hasProductUrl()): ?>
34
+ <a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></a>
35
+ <?php else: ?>
36
+ <span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></span>
37
+ <?php endif; ?>
38
+ <div class="product-details">
39
+ <p class="product-name"><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->escapeHtml($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif; ?></p>
40
+
41
+ <table class="info-wrapper">
42
+ <tbody>
43
+ <tr>
44
+ <th><?php echo $this->__('Price'); ?></th>
45
+ <td>
46
+ <?php if ($canApplyMsrp): ?>
47
+
48
+ <span class="map-cart-sidebar-item"><?php echo $this->__('See price before order confirmation.'); ?></span>
49
+
50
+ <?php else: ?>
51
+
52
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
53
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
54
+ <?php echo $this->__('Excl. Tax'); ?>:
55
+ <?php endif; ?>
56
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
57
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
58
+ <?php else: ?>
59
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
60
+ <?php endif; ?>
61
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
62
+ <br />
63
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
64
+ <small>
65
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
66
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
67
+ <?php endforeach; ?>
68
+ </small>
69
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
70
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
71
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
72
+ <?php endforeach; ?>
73
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
74
+ <small>
75
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
76
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
77
+ <?php endforeach; ?>
78
+ </small>
79
+ <?php endif; ?>
80
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
81
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
82
+ <?php endif; ?>
83
+ <?php endif; ?>
84
+ <?php endif; ?>
85
+
86
+
87
+
88
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
89
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
90
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
91
+ <br /><?php echo $this->__('Incl. Tax'); ?>:
92
+ <?php endif; ?>
93
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
94
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
95
+ <?php else: ?>
96
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
97
+ <?php endif; ?>
98
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
99
+ <br />
100
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
101
+ <small>
102
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
103
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
104
+ <?php endforeach; ?>
105
+ </small>
106
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
107
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
108
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span>
109
+ <?php endforeach; ?>
110
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
111
+ <small>
112
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
113
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
114
+ <?php endforeach; ?>
115
+ </small>
116
+ <?php endif; ?>
117
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
118
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
119
+ <?php endif; ?>
120
+ <?php endif; ?>
121
+ <?php endif; ?>
122
+
123
+ <?php endif; //Can apply MSRP ?>
124
+ </td>
125
+ </tr>
126
+ <tr class="qty-wrapper">
127
+ <th><?php echo $this->__('Qty'); ?></th>
128
+ <td>
129
+ <input
130
+ id="qinput-<?php echo $_item->getId(); ?>"
131
+ data-link="<?php echo $this->getAjaxUpdateUrl() ?>"
132
+ data-item-id="<?php echo $_item->getId(); ?>"
133
+ data-cart-item-id="<?php echo $_item->getSku(); ?>"
134
+ class="qty cart-item-quantity input-text" name=""
135
+ value="<?php echo $this->getQty()?>"
136
+ <?php if ($this->isOnCheckoutPage()) echo 'disabled'; ?>
137
+ />
138
+
139
+ <button id="qbutton-<?php echo $_item->getId(); ?>"
140
+ data-item-id="<?php echo $_item->getId(); ?>"
141
+ disabled="disabled"
142
+ data-update
143
+ data-cart-item-update
144
+ class="button quantity-button">
145
+ <?php echo $this->__('ok'); ?>
146
+ </button>
147
+ </td>
148
+ </tr>
149
+ </tbody>
150
+ </table>
151
+
152
+ <?php if ($isVisibleProduct): ?>
153
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item')) ?>" class="btn-edit">
154
+ <?php echo $this->__('Edit item')?>
155
+ </a>
156
+ |
157
+ <?php if (!$this->isOnCheckoutPage()): ?>
158
+ <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
159
+ data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
160
+ class="remove">
161
+ <?php echo $this->__('Remove Item') ?>
162
+ </a>
163
+ <?php else: ?>
164
+ <span><?php echo $this->__('Remove Item') ?></span>
165
+ <?php endif; ?>
166
+ <?php endif ?>
167
+ <?php
168
+ $productModel = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
169
+ $_options = $this->getOptionList();$i = 1;
170
+ if($productModel->getCarebyzinc() == 1){
171
+ foreach ($_options as $_option) {
172
+ if($_option['label'] != 'carebyzinc')
173
+ $i++;
174
+
175
+
176
+ }
177
+
178
+ }
179
+ ?>
180
+ <?php if($i):
181
+
182
+ if ($_options = $this->getOptionList()):?>
183
+ <div class="truncated">
184
+ <div class="truncated_full_value">
185
+ <dl class="item-options">
186
+ <?php foreach ($_options as $_option) : ?>
187
+ <?php if($_option['label'] != 'carebyzinc'): ?>
188
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
189
+ <dd>
190
+ <?php if (is_array($_option['value'])): ?>
191
+ <?php echo nl2br(implode("\n", $_option['value'])) ?>
192
+ <?php else: ?>
193
+ <?php echo $_option['value'] ?>
194
+ <?php endif; ?>
195
+ </dd>
196
+ <?php endif; ?>
197
+ <?php endforeach; ?>
198
+ <?php $careByZinc = $_item->getCarebyzincOption();?>
199
+ <?php if($careByZinc && $productModel->getCarebyzinc() == 1): ?>
200
+
201
+ <dt><?php echo Mage::helper('carebyzinc')->getTitle() ?></dt>
202
+ <dd>
203
+
204
+
205
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
206
+ <div class="product-cart-careby">
207
+ <p><?php echo $carebyzincAry['description'] ?></p>
208
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
209
+
210
+ </div>
211
+ </dd>
212
+ <?php endif; ?>
213
+
214
+ </dl>
215
+ </div>
216
+ <a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
217
+ </div>
218
+ <?php endif; ?> <?php endif; ?>
219
+ </div>
220
+ </li>
app/design/frontend/base/default/template/carebyzinc/checkout/multishipping/item/default.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <h3 class="product-name"><a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a></h3>
28
+ <?php
29
+ $careByZinc = $this->getItem()->getCarebyzincOption();
30
+ ?>
31
+ <?php if($careByZinc): ?>
32
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
33
+ <div class="product-cart-careby">
34
+ <p><?php echo $carebyzincAry['description'] ?></p>
35
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
36
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
37
+ </div>
38
+
39
+ <?php endif; ?>
40
+ <?php if ($_options = $this->getOptionList()):?>
41
+ <dl class="item-options">
42
+ <?php foreach ($_options as $_option) : ?>
43
+ <?php if($_option['label'] != 'carebyzinc'):?>
44
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
45
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
46
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
47
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
48
+ <div class="truncated_full_value">
49
+ <dl class="item-options">
50
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
51
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
52
+ </dl>
53
+ </div>
54
+ <?php endif; ?>
55
+ </dd>
56
+ <?php endif; ?>
57
+ <?php endforeach; ?>
58
+ </dl>
59
+ <?php endif; ?>
60
+ <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
61
+ <?php echo $addtInfoBlock->setItem($this->getItem())->toHtml() ?>
62
+ <?php endif;?>
app/design/frontend/base/default/template/carebyzinc/checkout/onepage/review/item.phtml ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem()?>
28
+ <tr>
29
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($this->getProductName()) ?></h3>
30
+
31
+ <?php
32
+ $careByZinc = $_item->getCarebyzincOption();
33
+ ?>
34
+ <?php if($careByZinc): ?>
35
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
36
+ <div class="product-cart-careby">
37
+ <p><?php echo $carebyzincAry['description'] ?></p>
38
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
39
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
40
+ </div>
41
+
42
+ <?php endif; ?>
43
+
44
+ <?php if ($_options = $this->getOptionList()):?>
45
+ <dl class="item-options">
46
+ <?php foreach ($_options as $_option) : ?>
47
+ <?php if($_option['label'] != 'carebyzinc'):?>
48
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
49
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
50
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
51
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
52
+ <div class="truncated_full_value">
53
+ <dl class="item-options">
54
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
55
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
56
+ </dl>
57
+ </div>
58
+ <?php endif; ?>
59
+ </dd>
60
+ <?php endif; ?>
61
+ <?php endforeach; ?>
62
+ </dl>
63
+ <?php endif;?>
64
+ <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
65
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
66
+ <?php endif;?>
67
+ </td>
68
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
69
+ <?php $_labelAppend = $this->helper('tax')->displayCartBothPrices() ? ' ' . $this->__('(Excl. Tax)') : ''; ?>
70
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Price') . $_labelAppend ?>">
71
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
72
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
73
+ <?php else: ?>
74
+ <span class="cart-price">
75
+ <?php endif; ?>
76
+
77
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
78
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
79
+ <?php else: ?>
80
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
81
+ <?php endif; ?>
82
+
83
+ </span>
84
+
85
+
86
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
87
+
88
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
89
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
90
+ <small>
91
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
92
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
93
+ <?php endforeach; ?>
94
+ </small>
95
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
96
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
97
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></small></span><br />
98
+ <?php endforeach; ?>
99
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
100
+ <small>
101
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
102
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
103
+ <?php endforeach; ?>
104
+ </small>
105
+ <?php endif; ?>
106
+ </div>
107
+
108
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
109
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
110
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
111
+ </div>
112
+ <?php endif; ?>
113
+ <?php endif; ?>
114
+ </td>
115
+ <?php endif; ?>
116
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
117
+ <?php $_labelAppend = $this->helper('tax')->displayCartBothPrices() ? ' ' . $this->__('(Incl. Tax)') : ''; ?>
118
+ <td data-rwd-label="<?php echo $this->__('Price') . $_labelAppend ?>">
119
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
120
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
121
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
122
+ <?php else: ?>
123
+ <span class="cart-price">
124
+ <?php endif; ?>
125
+
126
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
127
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
128
+ <?php else: ?>
129
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
130
+ <?php endif; ?>
131
+
132
+ </span>
133
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
134
+
135
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
137
+ <small>
138
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
139
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
140
+ <?php endforeach; ?>
141
+ </small>
142
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
143
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
144
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
145
+ <?php endforeach; ?>
146
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
147
+ <small>
148
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
149
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
150
+ <?php endforeach; ?>
151
+ </small>
152
+ <?php endif; ?>
153
+ </div>
154
+
155
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
156
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
157
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
158
+ </div>
159
+ <?php endif; ?>
160
+ <?php endif; ?>
161
+ </td>
162
+ <?php endif; ?>
163
+ <td class="a-center" data-rwd-label="<?php echo $this->__('Qty') ?>"><?php echo $_item->getQty() ?></td>
164
+ <!-- sub total starts here -->
165
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
166
+ <?php $_labelAppend = $this->helper('tax')->displayCartBothPrices() ? ' ' . $this->__('(Excl. Tax)') : ''; ?>
167
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Subtotal') . $_labelAppend ?>">
168
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
169
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
170
+ <?php else: ?>
171
+ <span class="cart-price">
172
+ <?php endif; ?>
173
+
174
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
175
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
176
+ <?php else: ?>
177
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
178
+ <?php endif; ?>
179
+
180
+ </span>
181
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
182
+
183
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
184
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
185
+ <small>
186
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
187
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
188
+ <?php endforeach; ?>
189
+ </small>
190
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
191
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
192
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
193
+ <?php endforeach; ?>
194
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
195
+ <small>
196
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
197
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
198
+ <?php endforeach; ?>
199
+ </small>
200
+ <?php endif; ?>
201
+ </div>
202
+
203
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
204
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
205
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
206
+ </div>
207
+ <?php endif; ?>
208
+ <?php endif; ?>
209
+ </td>
210
+ <?php endif; ?>
211
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
212
+ <?php $_labelAppend = $this->helper('tax')->displayCartBothPrices() ? ' ' . $this->__('(Incl. Tax)') : ''; ?>
213
+ <td data-rwd-label="<?php echo $this->__('Subtotal') . $_labelAppend ?>">
214
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
215
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
216
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
217
+ <?php else: ?>
218
+ <span class="cart-price">
219
+ <?php endif; ?>
220
+
221
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
222
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
223
+ <?php else: ?>
224
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
225
+ <?php endif; ?>
226
+
227
+ </span>
228
+
229
+
230
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
231
+
232
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
233
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
234
+ <small>
235
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
236
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
237
+ <?php endforeach; ?>
238
+ </small>
239
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
240
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
241
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
242
+ <?php endforeach; ?>
243
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
244
+ <small>
245
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
246
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
247
+ <?php endforeach; ?>
248
+ </small>
249
+ <?php endif; ?>
250
+ </div>
251
+
252
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
253
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
254
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
255
+ </div>
256
+ <?php endif; ?>
257
+ <?php endif; ?>
258
+ </td>
259
+ <?php endif; ?>
260
+ </tr>
app/design/frontend/base/default/template/carebyzinc/email/order/items/creditmemo/default.phtml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrder(); ?>
29
+ <tbody>
30
+ <tr>
31
+ <td class="cell-content product-info">
32
+ <p class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></p>
33
+ <p class="sku"><?php echo $this->__('SKU'); ?>: <?php echo $this->escapeHtml($this->getSku($_item)) ?></p>
34
+ <?php if ($this->getItemOptions()): ?>
35
+ <dl style="margin:0; padding:0;">
36
+ <?php foreach ($this->getItemOptions() as $option): ?>
37
+ <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
38
+ <dd style="margin:0; padding:0 0 0 9px;"><?php echo nl2br($option['value']) ?></dd>
39
+ <?php endforeach; ?>
40
+ </dl>
41
+ <?php endif; ?>
42
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption();?>
43
+ <?php if($careByZinc): ?>
44
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
45
+ <div class="product-cart-careby">
46
+ <p><?php echo $carebyzincAry['description'] ?></p>
47
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
48
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
49
+ <?php $order = Mage::getModel('carebyzinc/order')->load($_item->getOrderItem()->getId(),'item_id');?>
50
+ <p><span>Policy Key:</span> <b> <?php echo $order->getCarebyzincKey(); ?></b></p>
51
+ </div>
52
+ <?php endif; ?>
53
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
54
+ <?php if ($addInfoBlock) :?>
55
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
56
+ <?php endif; ?>
57
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
58
+ </td>
59
+ <td class="cell-content align-center"><?php echo $_item->getQty()*1 ?></td>
60
+ <td class="cell-content align-right">
61
+ <?php if ($this->helper('tax')->displaySalesPriceExclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
62
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
63
+ <span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax'); ?>:</span>
64
+ <?php endif; ?>
65
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
66
+ <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
67
+ <?php else: ?>
68
+ <?php echo $_order->formatPrice($_item->getRowTotal()) ?>
69
+ <?php endif; ?>
70
+
71
+
72
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
73
+ <br />
74
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
75
+ <small>
76
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
77
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
78
+ <?php endforeach; ?>
79
+ </small>
80
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
81
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
82
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
83
+ <?php endforeach; ?>
84
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
85
+ <small>
86
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
87
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
88
+ <?php endforeach; ?>
89
+ </small>
90
+ <?php endif; ?>
91
+
92
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
93
+ <br />
94
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
95
+ <?php endif; ?>
96
+ <?php endif; ?>
97
+ <?php endif; ?>
98
+
99
+
100
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
101
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
102
+ <br /><span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax'); ?>:</span>
103
+ <?php endif; ?>
104
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
105
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
106
+ <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
107
+ <?php else: ?>
108
+ <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
109
+ <?php endif; ?>
110
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
111
+ <br />
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
113
+ <small>
114
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
115
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
116
+ <?php endforeach; ?>
117
+ </small>
118
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
119
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
120
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
121
+ <?php endforeach; ?>
122
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
123
+ <small>
124
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
125
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
126
+ <?php endforeach; ?>
127
+ </small>
128
+ <?php endif; ?>
129
+
130
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
131
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
132
+ <?php endif; ?>
133
+ <?php endif; ?>
134
+ <?php endif; ?>
135
+ </td>
136
+ </tr>
137
+ </tbody>
app/design/frontend/base/default/template/carebyzinc/email/order/items/invoice/default.phtml ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrder(); ?>
29
+ <tbody>
30
+ <tr>
31
+ <td class="cell-content product-info">
32
+ <p class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></p>
33
+ <p class="sku"><?php echo $this->__('SKU'); ?>: <?php echo $this->escapeHtml($this->getSku($_item)) ?></p>
34
+
35
+ <?php if ($this->getItemOptions()): ?>
36
+ <dl style="margin:0; padding:0;">
37
+ <?php foreach ($this->getItemOptions() as $option): ?>
38
+ <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
39
+ <dd style="margin:0; padding:0 0 0 9px;"><?php echo nl2br($option['value']) ?></dd>
40
+ <?php endforeach; ?>
41
+ </dl>
42
+ <?php endif; ?>
43
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption();?>
44
+ <?php if($careByZinc): ?>
45
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
46
+ <div class="product-cart-careby">
47
+ <p><?php echo $carebyzincAry['description'] ?></p>
48
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
49
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
50
+ <?php $order = Mage::getModel('carebyzinc/order')->load($_item->getOrderItem()->getId(),'item_id');?>
51
+ <p><span>Policy Key:</span> <b><?php echo $order->getCarebyzincKey(); ?></b></p>
52
+ </div>
53
+ <?php endif; ?>
54
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
55
+ <?php if ($addInfoBlock) :?>
56
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
57
+ <?php endif; ?>
58
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
59
+ </td>
60
+ <td class="cell-content align-center"><?php echo $_item->getQty()*1 ?></td>
61
+ <td class="cell-content align-right">
62
+ <?php if ($this->helper('tax')->displaySalesPriceExclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
63
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
64
+ <span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax'); ?>:</span>
65
+ <?php endif; ?>
66
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
67
+ <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
68
+ <?php else: ?>
69
+ <?php echo $_order->formatPrice($_item->getRowTotal()) ?>
70
+ <?php endif; ?>
71
+
72
+
73
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
74
+ <br />
75
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
76
+ <small>
77
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
78
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
79
+ <?php endforeach; ?>
80
+ </small>
81
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
82
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
83
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
84
+ <?php endforeach; ?>
85
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
86
+ <small>
87
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
88
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
89
+ <?php endforeach; ?>
90
+ </small>
91
+ <?php endif; ?>
92
+
93
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
94
+ <br />
95
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
96
+ <?php endif; ?>
97
+ <?php endif; ?>
98
+ <?php endif; ?>
99
+
100
+
101
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
102
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
103
+ <br /><span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax'); ?>:</span>
104
+ <?php endif; ?>
105
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
107
+ <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
108
+ <?php else: ?>
109
+ <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
110
+ <?php endif; ?>
111
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
112
+ <br />
113
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
114
+ <small>
115
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
116
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
117
+ <?php endforeach; ?>
118
+ </small>
119
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
120
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
121
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
122
+ <?php endforeach; ?>
123
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
124
+ <small>
125
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
126
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
127
+ <?php endforeach; ?>
128
+ </small>
129
+ <?php endif; ?>
130
+
131
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
132
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
133
+ <?php endif; ?>
134
+ <?php endif; ?>
135
+ <?php endif; ?>
136
+ </td>
137
+ </tr>
138
+ </tbody>
app/design/frontend/base/default/template/carebyzinc/email/order/items/order/default.phtml ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrder() ?>
29
+ <tbody>
30
+ <tr>
31
+ <td class="cell-content product-info">
32
+ <p class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></p>
33
+ <p class="sku"><?php echo $this->__('SKU'); ?>: <?php echo $this->escapeHtml($this->getSku($_item)) ?></p>
34
+
35
+ <?php if ($this->getItemOptions()): ?>
36
+ <dl style="margin:0; padding:0;">
37
+ <?php foreach ($this->getItemOptions() as $option): ?>
38
+ <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
39
+ <dd style="margin:0; padding:0 0 0 9px;">
40
+ <?php echo nl2br($option['value']) ?>
41
+ </dd>
42
+ <?php endforeach; ?>
43
+ </dl>
44
+ <?php endif; ?>
45
+ <?php $careByZinc = $_item->getCarebyzincOption();?>
46
+ <?php if($careByZinc): ?>
47
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
48
+ <div class="product-cart-careby">
49
+ <p><?php echo $carebyzincAry['description'] ?></p>
50
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
51
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
52
+ <?php $order = Mage::getModel('carebyzinc/order')->load($_item->getId(),'item_id');?>
53
+ <p><span>Policy Key:</span> <b><?php echo $order->getCarebyzincKey(); ?></b></p>
54
+ </div>
55
+ <?php endif; ?>
56
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
57
+ <?php if ($addInfoBlock) :?>
58
+ <?php echo $addInfoBlock->setItem($_item)->toHtml(); ?>
59
+ <?php endif; ?>
60
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
61
+ </td>
62
+ <td class="cell-content align-center"><?php echo $_item->getQtyOrdered()*1 ?></td>
63
+ <td class="cell-content align-right">
64
+ <?php if ($this->helper('tax')->displaySalesPriceExclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
65
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
66
+ <span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax'); ?>:</span>
67
+ <?php endif; ?>
68
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
69
+ <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
70
+ <?php else: ?>
71
+ <?php echo $_order->formatPrice($_item->getRowTotal()) ?>
72
+ <?php endif; ?>
73
+
74
+
75
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
76
+ <br />
77
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
78
+ <small>
79
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
80
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
81
+ <?php endforeach; ?>
82
+ </small>
83
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
84
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
85
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
86
+ <?php endforeach; ?>
87
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
88
+ <small>
89
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
90
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
91
+ <?php endforeach; ?>
92
+ </small>
93
+ <?php endif; ?>
94
+
95
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
96
+ <br />
97
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
98
+ <?php endif; ?>
99
+ <?php endif; ?>
100
+ <?php endif; ?>
101
+
102
+
103
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
104
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
105
+ <br /><span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax'); ?>:</span>
106
+ <?php endif; ?>
107
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
108
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
109
+ <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
110
+ <?php else: ?>
111
+ <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
112
+ <?php endif; ?>
113
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
114
+ <br />
115
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
116
+ <small>
117
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
118
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
119
+ <?php endforeach; ?>
120
+ </small>
121
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
122
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
123
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
124
+ <?php endforeach; ?>
125
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
126
+ <small>
127
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
128
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
129
+ <?php endforeach; ?>
130
+ </small>
131
+ <?php endif; ?>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
134
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
135
+ <?php endif; ?>
136
+ <?php endif; ?>
137
+ <?php endif; ?>
138
+ </td>
139
+ </tr>
140
+ <?php if ($_item->getGiftMessageId() && $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_item->getGiftMessageId())): ?>
141
+ <tr>
142
+ <td colspan="4" style=" border-bottom:2px solid #CCCCCC; padding:3px 9px;">
143
+ <strong style="color:#444444; font-size:11px;"><?php echo $this->__('Gift Message') ?></strong>
144
+ <?php echo $this->__('From:'); ?> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?><br />
145
+ <?php echo $this->__('To:'); ?> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?><br />
146
+ <strong><?php echo $this->__('Message:'); ?></strong><br /><?php echo $this->escapeHtml($_giftMessage->getMessage()) ?>
147
+ </td>
148
+ </tr>
149
+ <?php endif; ?>
150
+ </tbody>
app/design/frontend/base/default/template/carebyzinc/email/order/items/shipment/default.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <tbody>
29
+ <tr>
30
+ <td class="cell-content product-info">
31
+ <p class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></p>
32
+ <?php if ($this->getItemOptions()): ?>
33
+ <dl style="margin:0; padding:0;">
34
+ <?php foreach ($this->getItemOptions() as $option): ?>
35
+ <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
36
+ <dd style="margin:0; padding:0 0 0 9px;"><?php echo nl2br($option['value']) ?></dd>
37
+ <?php endforeach; ?>
38
+ </dl>
39
+ <?php endif; ?>
40
+ <?php $careByZinc = $_item->getOrderItem()->getCarebyzincOption();?>
41
+ <?php if($careByZinc): ?>
42
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
43
+ <div class="product-cart-careby">
44
+ <p><?php echo $carebyzincAry['description'] ?></p>
45
+ <p class="care-price"><?php echo $this->helper('checkout')->formatPrice($carebyzincAry['price_per_year']) ?></p>
46
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
47
+ <?php $order = Mage::getModel('carebyzinc/order')->load($_item->getOrderItem()->getId(),'item_id');?>
48
+ <p><span>Policy Key:</span> <b> <?php echo $order->getCarebyzincKey(); ?></b></p>
49
+ </div>
50
+ <?php endif; ?>
51
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
52
+ <?php if ($addInfoBlock) :?>
53
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
54
+ <?php endif; ?>
55
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
56
+ </td>
57
+ <td class="cell-content align-center"><?php echo $this->escapeHtml($this->getSku($_item)) ?></td>
58
+ <td class="cell-content align-right"><?php echo $_item->getQty()*1 ?></td>
59
+ </tr>
60
+ </tbody>
app/design/frontend/base/default/template/carebyzinc/options/cart.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $quoteData = $this->getQuoteData();
2
+ $itemId = $this->getItemId();
3
+ ?>
4
+ <?php if(! empty($quoteData)): ?>
5
+
6
+ <?php if( is_array($quoteData)): ?>
7
+ <ul class="product-list">
8
+ <?php foreach($quoteData as $item): ?>
9
+ <li>
10
+ <div class="bx-l">
11
+ <div class="squared input">
12
+ <input type="radio" value="<?php echo $item['id']; ?>" id="carebyzinc_<?php echo $itemId.'_'.$item['id']; ?>" name="carebyzinc_option_<?php echo $itemId?>" />
13
+ <label for="carebyzinc_<?php echo $itemId.'_'.$item['id']; ?>"></label>
14
+ </div>
15
+ </div>
16
+ <div class="bx-r">
17
+ <h2 class="p-price"><?php echo Mage::helper('core')->currency($item['price_per_year']); ?></h2>
18
+ <h3 class="p-name quotelabel"><?php echo $item['description']; ?></h3>
19
+ </div>
20
+ </li>
21
+ <?php endforeach; ?>
22
+ </ul>
23
+ <button type="button" title="Add" class="button" id="button-container_<?php echo $itemId?>" onclick="updateCareByZinc(<?php echo $itemId?>)"><span><span>Add</span></span></button>
24
+ <?php else:
25
+ echo $quoteData;
26
+ ?>
27
+ <?php endif; ?>
28
+ <?php else:
29
+ echo 'No quotes available';
30
+ ?>
31
+ <?php endif; ?>
app/design/frontend/base/default/template/carebyzinc/options/default.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $quoteData = $this->getQuoteData();?>
2
+ <?php if(! empty($quoteData)): ?>
3
+ <?php if( is_array($quoteData)): ?>
4
+ <ul class="product-list">
5
+ <?php foreach($quoteData as $item): ?>
6
+ <li>
7
+ <div class="bx-l">
8
+ <div class="squared input">
9
+ <input type="radio" value="<?php echo $item['id']; ?>" id="carebyzinc_<?php echo $item['id']; ?>" name="carebyzinc_option" />
10
+ <label for="carebyzinc_<?php echo $item['id']; ?>"></label>
11
+ </div>
12
+ </div>
13
+ <div class="bx-r">
14
+ <h2 class="p-price"><?php echo Mage::helper('core')->currency($item['price_per_year']); ?></h2>
15
+ <h3 class="p-name quotelabel"><?php echo $item['description']; ?></h3>
16
+ </div>
17
+ </li>
18
+ <?php endforeach; ?>
19
+ </ul>
20
+
21
+ <script>
22
+ jQuery.noConflict();
23
+ jQuery(document).ready(function() {
24
+ jQuery("a", ".quotelabel").click(
25
+ function(event) {
26
+ event.preventDefault();
27
+ var elementURL = jQuery(this).attr("href");
28
+ jQuery.colorbox({iframe: true, href: elementURL, innerWidth: 645,fastIframe: false, innerHeight: 509,width:"70%"});
29
+ });
30
+ });
31
+ </script>
32
+ <?php else:
33
+ echo $quoteData;
34
+ ?>
35
+ <?php endif; ?>
36
+ <?php else:
37
+ echo 'No quotes available';
38
+ ?>
39
+ <?php endif; ?>
app/design/frontend/base/default/template/carebyzinc/sales/order/creditmemo/items/renderer/default.phtml ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
29
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
30
+ <td><h4 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h4>
31
+ <?php echo $this->getChildHtml('carebyzinc') ?>
32
+ <?php
33
+ $careByZinc = $this->getItem()->getOrderItem()->getCarebyzincOption();
34
+ ?>
35
+ <?php if($careByZinc): ?>
36
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
37
+ <div class="product-cart-careby">
38
+ <p><?php echo $carebyzincAry['description'] ?></p>
39
+ <p class="care-price"><?php echo $this->getOrder()->formatPrice($carebyzincAry['price_per_year']) ?></p>
40
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
41
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
42
+ <p><span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?></p>
43
+ </div>
44
+
45
+ <?php endif; ?>
46
+ <?php if ($_options = $this->getItemOptions()): ?>
47
+ <dl class="item-options">
48
+ <?php foreach ($_options as $_option) : ?>
49
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
50
+ <?php if (!$this->getPrintStatus()): ?>
51
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
52
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
53
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
54
+ <div class="truncated_full_value">
55
+ <dl class="item-options">
56
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
57
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
58
+ </dl>
59
+ </div>
60
+ <?php endif; ?>
61
+ </dd>
62
+ <?php else: ?>
63
+ <dd><?php echo $this->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
64
+ <?php endif; ?>
65
+ <?php endforeach; ?>
66
+ </dl>
67
+ <?php endif; ?>
68
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
69
+ <?php if ($addInfoBlock) : ?>
70
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
71
+ <?php endif; ?>
72
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
73
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?>
74
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link"
75
+ onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
76
+ <?php endif; ?>
77
+ </td>
78
+ <td data-rwd-label="<?php echo $this->__('SKU') ?>"><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
79
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Price') ?>">
80
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
81
+ <span class="price-excl-tax">
82
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
83
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
84
+ <span class="cart-price">
85
+ <?php endif; ?>
86
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
87
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
88
+ </span>
89
+ <?php endif; ?>
90
+ <?php endif; ?>
91
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
92
+ <span class="cart-tax-total"
93
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
94
+ <?php else: ?>
95
+ <span class="cart-price">
96
+ <?php endif; ?>
97
+
98
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
99
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
100
+ <?php else: ?>
101
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
102
+ <?php endif; ?>
103
+
104
+ </span>
105
+
106
+
107
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
108
+
109
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
110
+ style="display:none;">
111
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
112
+ <small>
113
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
114
+ <span class="nobr"><?php echo $tax['title']; ?>
115
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
116
+ <?php endforeach; ?>
117
+ </small>
118
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
119
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
120
+ <span class="nobr"><small><?php echo $tax['title']; ?>
121
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
122
+ <?php endforeach; ?>
123
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
124
+ <small>
125
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
126
+ <span class="nobr"><?php echo $tax['title']; ?>
127
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
128
+ <?php endforeach; ?>
129
+ </small>
130
+ <?php endif; ?>
131
+ </span>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <span class="cart-tax-total"
135
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
136
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
137
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?></span>
138
+ </span>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ <br/>
143
+ <?php endif; ?>
144
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
145
+ <span class="price-incl-tax">
146
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
147
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
148
+ <span class="cart-price">
149
+ <?php endif; ?>
150
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
151
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
152
+ </span>
153
+ <?php endif; ?>
154
+ <?php endif; ?>
155
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
156
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
157
+ <span class="cart-tax-total"
158
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
159
+ <?php else: ?>
160
+ <span class="cart-price">
161
+ <?php endif; ?>
162
+
163
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
164
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
165
+ <?php else: ?>
166
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxDisposition()) ?>
167
+ <?php endif; ?>
168
+
169
+ </span>
170
+
171
+
172
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
173
+
174
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
175
+ style="display:none;">
176
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
177
+ <small>
178
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
179
+ <span class="nobr"><?php echo $tax['title']; ?>
180
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
181
+ <?php endforeach; ?>
182
+ </small>
183
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
184
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
185
+ <span class="nobr"><small><?php echo $tax['title']; ?>
186
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
187
+ <?php endforeach; ?>
188
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
189
+ <small>
190
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
191
+ <span class="nobr"><?php echo $tax['title']; ?>
192
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
193
+ <?php endforeach; ?>
194
+ </small>
195
+ <?php endif; ?>
196
+ </span>
197
+
198
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
199
+ <span class="cart-tax-total"
200
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
201
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
202
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
203
+ </span>
204
+ <?php endif; ?>
205
+ <?php endif; ?>
206
+ </span>
207
+ <?php endif; ?>
208
+ </td>
209
+ <td class="a-center" data-rwd-label="<?php echo $this->__('Qty') ?>"><?php echo $_item->getQty() * 1 ?></td>
210
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Subtotal') ?>">
211
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
212
+ <span class="price-excl-tax">
213
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
214
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
215
+ <span class="cart-price">
216
+ <?php endif; ?>
217
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
218
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
219
+ </span>
220
+ <?php endif; ?>
221
+ <?php endif; ?>
222
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
223
+ <span class="cart-tax-total"
224
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
225
+ <?php else: ?>
226
+ <span class="cart-price">
227
+ <?php endif; ?>
228
+
229
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
230
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?>
231
+ <?php else: ?>
232
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
233
+ <?php endif; ?>
234
+
235
+ </span>
236
+
237
+
238
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
239
+
240
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
241
+ style="display:none;">
242
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
243
+ <small>
244
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
245
+ <span class="nobr"><?php echo $tax['title']; ?>
246
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
247
+ <?php endforeach; ?>
248
+ </small>
249
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
250
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
251
+ <span class="nobr"><small><?php echo $tax['title']; ?>
252
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
253
+ <?php endforeach; ?>
254
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
255
+ <small>
256
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
257
+ <span class="nobr"><?php echo $tax['title']; ?>
258
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
259
+ <?php endforeach; ?>
260
+ </small>
261
+ <?php endif; ?>
262
+ </span>
263
+
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
265
+ <span class="cart-tax-total"
266
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
267
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
268
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?></span>
269
+ </span>
270
+ <?php endif; ?>
271
+ <?php endif; ?>
272
+ </span>
273
+ <br/>
274
+ <?php endif; ?>
275
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
276
+ <span class="price-incl-tax">
277
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
278
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
279
+ <span class="cart-price">
280
+ <?php endif; ?>
281
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
282
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
283
+ </span>
284
+ <?php endif; ?>
285
+ <?php endif; ?>
286
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
287
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
288
+ <span class="cart-tax-total"
289
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
290
+ <?php else: ?>
291
+ <span class="cart-price">
292
+ <?php endif; ?>
293
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
294
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
295
+ <?php else: ?>
296
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxRowDisposition()) ?>
297
+ <?php endif; ?>
298
+
299
+ </span>
300
+
301
+
302
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
303
+
304
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
305
+ style="display:none;">
306
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
307
+ <small>
308
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
309
+ <span class="nobr"><?php echo $tax['title']; ?>
310
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
311
+ <?php endforeach; ?>
312
+ </small>
313
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
314
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
315
+ <span class="nobr"><small><?php echo $tax['title']; ?>
316
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
317
+ <?php endforeach; ?>
318
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
319
+ <small>
320
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
321
+ <span class="nobr"><?php echo $tax['title']; ?>
322
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
323
+ <?php endforeach; ?>
324
+ </small>
325
+ <?php endif; ?>
326
+ </span>
327
+
328
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
329
+ <span class="cart-tax-total"
330
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
331
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
332
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
333
+ </span>
334
+ <?php endif; ?>
335
+ <?php endif; ?>
336
+
337
+
338
+
339
+ </span>
340
+ <?php endif; ?>
341
+ </td>
342
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Discount Amount') ?>"><?php echo $_order->formatPrice(-$_item->getDiscountAmount()) ?></td>
343
+ <td class="last a-right" data-rwd-label="<?php echo $this->__('Row Total') ?>">
344
+ <?php echo $_order->formatPrice($_item->getRowTotal() - $_item->getDiscountAmount() + $_item->getTaxAmount() + $_item->getWeeeTaxAppliedRowAmount()) ?>
345
+ </td>
346
+ </tr>
app/design/frontend/base/default/template/carebyzinc/sales/order/invoice/items/renderer/default.phtml ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
29
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
30
+ <td><h4 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h4>
31
+ <?php
32
+ $careByZinc = $this->getItem()->getOrderItem()->getCarebyzincOption();
33
+ ?>
34
+ <?php if($careByZinc): ?>
35
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
36
+ <div class="product-cart-careby">
37
+ <p><?php echo $carebyzincAry['description'] ?></p>
38
+ <p class="care-price"><?php echo $this->getOrder()->formatPrice($carebyzincAry['price_per_year']) ?></p>
39
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
40
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
41
+ <p><span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?></p>
42
+ </div>
43
+
44
+ <?php endif; ?>
45
+
46
+ <?php if ($_options = $this->getItemOptions()): ?>
47
+ <dl class="item-options">
48
+ <?php foreach ($_options as $_option) : ?>
49
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
50
+ <?php if (!$this->getPrintStatus()): ?>
51
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
52
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
53
+ <?php echo $_formatedOptionValue['value'] ?>
54
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
55
+ <div class="truncated_full_value">
56
+ <dl class="item-options">
57
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
58
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
59
+ </dl>
60
+ </div>
61
+ <?php endif; ?>
62
+ </dd>
63
+ <?php else: ?>
64
+ <dd><?php echo $this->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
65
+ <?php endif; ?>
66
+ <?php endforeach; ?>
67
+ </dl>
68
+ <?php endif; ?>
69
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
70
+ <?php if ($addInfoBlock) : ?>
71
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
72
+ <?php endif; ?>
73
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
74
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?>
75
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link"
76
+ onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
77
+ <?php endif; ?>
78
+ </td>
79
+ <td data-rwd-label="<?php echo $this->__('SKU') ?>"><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
80
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Price') ?>">
81
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
82
+ <span class="price-excl-tax">
83
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
84
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
85
+ <span class="cart-price">
86
+ <?php endif; ?>
87
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
88
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ </span>
90
+ <?php endif; ?>
91
+ <?php endif; ?>
92
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
93
+ <span class="cart-tax-total"
94
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
95
+ <?php else: ?>
96
+ <span class="cart-price">
97
+ <?php endif; ?>
98
+
99
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
100
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
101
+ <?php else: ?>
102
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
103
+ <?php endif; ?>
104
+
105
+ </span>
106
+
107
+
108
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
109
+
110
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
111
+ style="display:none;">
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
113
+ <small>
114
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
115
+ <span class="nobr"><?php echo $tax['title']; ?>
116
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
117
+ <?php endforeach; ?>
118
+ </small>
119
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
120
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
121
+ <span class="nobr"><small><?php echo $tax['title']; ?>
122
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
123
+ <?php endforeach; ?>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
125
+ <small>
126
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
127
+ <span class="nobr"><?php echo $tax['title']; ?>
128
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
129
+ <?php endforeach; ?>
130
+ </small>
131
+ <?php endif; ?>
132
+ </span>
133
+
134
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
135
+ <span class="cart-tax-total"
136
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
137
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
138
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?></span>
139
+ </span>
140
+ <?php endif; ?>
141
+ <?php endif; ?>
142
+ </span>
143
+ <br/>
144
+ <?php endif; ?>
145
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
146
+ <span class="price-incl-tax">
147
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
148
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
149
+ <span class="cart-price">
150
+ <?php endif; ?>
151
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
152
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
153
+ </span>
154
+ <?php endif; ?>
155
+ <?php endif; ?>
156
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
157
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
158
+ <span class="cart-tax-total"
159
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
160
+ <?php else: ?>
161
+ <span class="cart-price">
162
+ <?php endif; ?>
163
+
164
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
165
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
166
+ <?php else: ?>
167
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxDisposition()) ?>
168
+ <?php endif; ?>
169
+
170
+ </span>
171
+
172
+
173
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
174
+
175
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
176
+ style="display:none;">
177
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
178
+ <small>
179
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
180
+ <span class="nobr"><?php echo $tax['title']; ?>
181
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
182
+ <?php endforeach; ?>
183
+ </small>
184
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
185
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
186
+ <span class="nobr"><small><?php echo $tax['title']; ?>
187
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
188
+ <?php endforeach; ?>
189
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
190
+ <small>
191
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
192
+ <span class="nobr"><?php echo $tax['title']; ?>
193
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
194
+ <?php endforeach; ?>
195
+ </small>
196
+ <?php endif; ?>
197
+ </span>
198
+
199
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
200
+ <span class="cart-tax-total"
201
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
202
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
203
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
204
+ </span>
205
+ <?php endif; ?>
206
+ <?php endif; ?>
207
+ </span>
208
+ <?php endif; ?>
209
+ </td>
210
+ <td class="a-center" data-rwd-label="<?php echo $this->__('Qty') ?>">
211
+ <span class="nobr">
212
+ <?php echo $this->__('Invoiced:'); ?> <strong><?php echo $_item->getQty() * 1 ?></strong><br>
213
+ </span>
214
+ </td>
215
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Subtotal') ?>">
216
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
217
+ <span class="price-excl-tax">
218
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
219
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
220
+ <span class="cart-price">
221
+ <?php endif; ?>
222
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
223
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
224
+ </span>
225
+ <?php endif; ?>
226
+ <?php endif; ?>
227
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
228
+ <span class="cart-tax-total"
229
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
230
+ <?php else: ?>
231
+ <span class="cart-price">
232
+ <?php endif; ?>
233
+
234
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
235
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?>
236
+ <?php else: ?>
237
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
238
+ <?php endif; ?>
239
+
240
+ </span>
241
+
242
+
243
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
244
+
245
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
246
+ style="display:none;">
247
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
248
+ <small>
249
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
250
+ <span class="nobr"><?php echo $tax['title']; ?>
251
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
252
+ <?php endforeach; ?>
253
+ </small>
254
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
255
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
256
+ <span class="nobr"><small><?php echo $tax['title']; ?>
257
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
258
+ <?php endforeach; ?>
259
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
260
+ <small>
261
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
262
+ <span class="nobr"><?php echo $tax['title']; ?>
263
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
264
+ <?php endforeach; ?>
265
+ </small>
266
+ <?php endif; ?>
267
+ </span>
268
+
269
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
270
+ <span class="cart-tax-total"
271
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
272
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
273
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?></span>
274
+ </span>
275
+ <?php endif; ?>
276
+ <?php endif; ?>
277
+ </span>
278
+ <br/>
279
+ <?php endif; ?>
280
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
281
+ <span class="price-incl-tax">
282
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
283
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
284
+ <span class="cart-price">
285
+ <?php endif; ?>
286
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
287
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
288
+ </span>
289
+ <?php endif; ?>
290
+ <?php endif; ?>
291
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
292
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
293
+ <span class="cart-tax-total"
294
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
295
+ <?php else: ?>
296
+ <span class="cart-price">
297
+ <?php endif; ?>
298
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
299
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
300
+ <?php else: ?>
301
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxRowDisposition()) ?>
302
+ <?php endif; ?>
303
+
304
+ </span>
305
+
306
+
307
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
308
+
309
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
310
+ style="display:none;">
311
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
312
+ <small>
313
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
314
+ <span class="nobr"><?php echo $tax['title']; ?>
315
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
316
+ <?php endforeach; ?>
317
+ </small>
318
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
319
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
320
+ <span class="nobr"><small><?php echo $tax['title']; ?>
321
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
322
+ <?php endforeach; ?>
323
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
324
+ <small>
325
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
326
+ <span class="nobr"><?php echo $tax['title']; ?>
327
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
328
+ <?php endforeach; ?>
329
+ </small>
330
+ <?php endif; ?>
331
+ </span>
332
+
333
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
334
+ <span class="cart-tax-total"
335
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
336
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
337
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
338
+ </span>
339
+ <?php endif; ?>
340
+ <?php endif; ?>
341
+
342
+
343
+
344
+ </span>
345
+ <?php endif; ?>
346
+ </td>
347
+ </tr>
app/design/frontend/base/default/template/carebyzinc/sales/order/items/renderer/default.phtml ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
29
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
30
+
31
+
32
+ <?php
33
+ $careByZinc = $_item->getCarebyzincOption();
34
+ ?>
35
+ <?php if($careByZinc): ?>
36
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
37
+ <div class="product-cart-careby">
38
+ <p><?php echo $carebyzincAry['description'] ?></p>
39
+ <p class="care-price"><?php echo $this->getOrder()->formatPrice($carebyzincAry['price_per_year']) ?></p>
40
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
41
+ <?php $order = Mage::getModel('carebyzinc/order')->load($_item->getId(),'item_id');?>
42
+ <p><span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?></p>
43
+ </div>
44
+
45
+ <?php endif; ?>
46
+
47
+
48
+ <?php if($_options = $this->getItemOptions()): ?>
49
+ <dl class="item-options">
50
+ <?php foreach ($_options as $_option) : ?>
51
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
52
+ <?php if (!$this->getPrintStatus()): ?>
53
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
54
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
55
+ <?php echo $_formatedOptionValue['value'] ?>
56
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
57
+ <div class="truncated_full_value">
58
+ <dl class="item-options">
59
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
60
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
61
+ </dl>
62
+ </div>
63
+ <?php endif; ?>
64
+ </dd>
65
+ <?php else: ?>
66
+ <dd>
67
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
68
+ </dd>
69
+ <?php endif; ?>
70
+ <?php endforeach; ?>
71
+ </dl>
72
+ <?php endif; ?>
73
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
74
+ <?php if ($addtInfoBlock) :?>
75
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
76
+ <?php endif; ?>
77
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
78
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
79
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
80
+ <?php endif; ?>
81
+ </td>
82
+ <td data-rwd-label="<?php echo $this->__('SKU') ?>"><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
83
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Price') ?>">
84
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
85
+ <span class="price-excl-tax">
86
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
87
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
88
+ <span class="cart-price">
89
+ <?php endif; ?>
90
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
91
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
92
+ </span>
93
+ <?php endif; ?>
94
+ <?php endif; ?>
95
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
96
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
97
+ <?php else: ?>
98
+ <span class="cart-price">
99
+ <?php endif; ?>
100
+
101
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
102
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
103
+ <?php else: ?>
104
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
105
+ <?php endif; ?>
106
+
107
+ </span>
108
+
109
+
110
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
111
+
112
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
113
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
114
+ <small>
115
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
116
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
117
+ <?php endforeach; ?>
118
+ </small>
119
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
120
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
121
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
122
+ <?php endforeach; ?>
123
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
124
+ <small>
125
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
126
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
127
+ <?php endforeach; ?>
128
+ </small>
129
+ <?php endif; ?>
130
+ </span>
131
+
132
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
133
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
134
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span>
135
+ </span>
136
+ <?php endif; ?>
137
+ <?php endif; ?>
138
+ </span>
139
+ <br />
140
+ <?php endif; ?>
141
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
142
+ <span class="price-incl-tax">
143
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
144
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
145
+ <span class="cart-price">
146
+ <?php endif; ?>
147
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
148
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
149
+ </span>
150
+ <?php endif; ?>
151
+ <?php endif; ?>
152
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
153
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
154
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
155
+ <?php else: ?>
156
+ <span class="cart-price">
157
+ <?php endif; ?>
158
+
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
160
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
161
+ <?php else: ?>
162
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
163
+ <?php endif; ?>
164
+
165
+ </span>
166
+
167
+
168
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
169
+
170
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
171
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
172
+ <small>
173
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
174
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
175
+ <?php endforeach; ?>
176
+ </small>
177
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
178
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
179
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
180
+ <?php endforeach; ?>
181
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
182
+ <small>
183
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
184
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
185
+ <?php endforeach; ?>
186
+ </small>
187
+ <?php endif; ?>
188
+ </span>
189
+
190
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
191
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
192
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
193
+ </span>
194
+ <?php endif; ?>
195
+ <?php endif; ?>
196
+ </span>
197
+ <?php endif; ?>
198
+ </td>
199
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Qty') ?>">
200
+ <span class="nobr">
201
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
202
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
203
+ <?php endif; ?>
204
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
205
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
206
+ <?php endif; ?>
207
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
208
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
209
+ <?php endif; ?>
210
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
211
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
212
+ <?php endif; ?>
213
+ </span>
214
+ </td>
215
+ <td class="a-right" data-rwd-label="<?php echo $this->__('Subtotal') ?>">
216
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
217
+ <span class="price-excl-tax">
218
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
219
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
220
+ <span class="cart-price">
221
+ <?php endif; ?>
222
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
223
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
224
+ </span>
225
+ <?php endif; ?>
226
+ <?php endif; ?>
227
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
228
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
229
+ <?php else: ?>
230
+ <span class="cart-price">
231
+ <?php endif; ?>
232
+
233
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
234
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
235
+ <?php else: ?>
236
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
237
+ <?php endif; ?>
238
+
239
+ </span>
240
+
241
+
242
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
243
+
244
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
245
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
246
+ <small>
247
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
248
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
249
+ <?php endforeach; ?>
250
+ </small>
251
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
252
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
253
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
254
+ <?php endforeach; ?>
255
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
256
+ <small>
257
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
258
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
259
+ <?php endforeach; ?>
260
+ </small>
261
+ <?php endif; ?>
262
+ </span>
263
+
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
265
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
266
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span>
267
+ </span>
268
+ <?php endif; ?>
269
+ <?php endif; ?>
270
+ </span>
271
+ <br />
272
+ <?php endif; ?>
273
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
274
+ <span class="price-incl-tax">
275
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
276
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
277
+ <span class="cart-price">
278
+ <?php endif; ?>
279
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
280
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
281
+ </span>
282
+ <?php endif; ?>
283
+ <?php endif; ?>
284
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
285
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
286
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
287
+ <?php else: ?>
288
+ <span class="cart-price">
289
+ <?php endif; ?>
290
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
291
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
292
+ <?php else: ?>
293
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
294
+ <?php endif; ?>
295
+
296
+ </span>
297
+
298
+
299
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
300
+
301
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
302
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
303
+ <small>
304
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
305
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
306
+ <?php endforeach; ?>
307
+ </small>
308
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
309
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
310
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
311
+ <?php endforeach; ?>
312
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
313
+ <small>
314
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
315
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
316
+ <?php endforeach; ?>
317
+ </small>
318
+ <?php endif; ?>
319
+ </span>
320
+
321
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
322
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
323
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
324
+ </span>
325
+ <?php endif; ?>
326
+ <?php endif; ?>
327
+
328
+
329
+
330
+ </span>
331
+ <?php endif; ?>
332
+ </td>
333
+ <!--
334
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
335
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
336
+ <?php endif; ?>
337
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
338
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
339
+ <?php endif; ?>
340
+ -->
341
+ </tr>
app/design/frontend/base/default/template/carebyzinc/sales/order/shipment/items/renderer/default.phtml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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@magento.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.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
29
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
30
+ <td><h4 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h4>
31
+ <?php
32
+ $careByZinc = $this->getItem()->getOrderItem()->getCarebyzincOption();
33
+ ?>
34
+ <?php if($careByZinc): ?>
35
+ <?php $carebyzincAry = (array) unserialize($careByZinc); ?>
36
+ <div class="product-cart-careby">
37
+ <p><?php echo $carebyzincAry['description'] ?></p>
38
+ <p class="care-price"><?php echo $this->getOrder()->formatPrice($carebyzincAry['price_per_year']) ?></p>
39
+ <p class="care-prov"><span>Provider:</span> <?php echo $carebyzincAry['provider'] ?></p>
40
+ <?php $order = Mage::getModel('carebyzinc/order')->load($this->getItem()->getOrderItem()->getId(),'item_id');?>
41
+ <p><span>Policy Key:</span> <?php echo $order->getCarebyzincKey(); ?></p>
42
+ </div>
43
+
44
+ <?php endif; ?>
45
+ <?php if($_options = $this->getItemOptions()): ?>
46
+ <dl class="item-options">
47
+ <?php foreach ($_options as $_option) : ?>
48
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
49
+ <?php if (!$this->getPrintStatus()): ?>
50
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
51
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
52
+ <?php echo $_formatedOptionValue['value'] ?>
53
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
54
+ <div class="truncated_full_value">
55
+ <dl class="item-options">
56
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
57
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
58
+ </dl>
59
+ </div>
60
+ <?php endif; ?>
61
+ </dd>
62
+ <?php else: ?>
63
+ <dd><?php echo $this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?></dd>
64
+ <?php endif; ?>
65
+ <?php endforeach; ?>
66
+ </dl>
67
+ <?php endif; ?>
68
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
69
+ <?php if ($addInfoBlock) :?>
70
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
71
+ <?php endif; ?>
72
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
73
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?>
74
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
75
+ <?php endif; ?>
76
+ </td>
77
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
78
+ <td class="a-center"><?php echo $_item->getQty()*1 ?></td>
79
+ </tr>
app/etc/modules/Zinc_Carebyzinc.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Zinc_Carebyzinc>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Zinc_Carebyzinc>
8
+ </modules>
9
+ </config>
js/carebyzinc/jquery.colorbox.js ADDED
@@ -0,0 +1,1105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Colorbox 1.6.4
3
+ license: MIT
4
+ http://www.jacklmoore.com/colorbox
5
+ */
6
+ (function ($, document, window) {
7
+ var
8
+ // Default settings object.
9
+ // See http://jacklmoore.com/colorbox for details.
10
+ defaults = {
11
+ // data sources
12
+ html: false,
13
+ photo: false,
14
+ iframe: false,
15
+ inline: false,
16
+
17
+ // behavior and appearance
18
+ transition: "elastic",
19
+ speed: 300,
20
+ fadeOut: 300,
21
+ width: false,
22
+ initialWidth: "auto",
23
+ innerWidth: false,
24
+ maxWidth: false,
25
+ height: false,
26
+ initialHeight: "auto",
27
+ innerHeight: false,
28
+ maxHeight: false,
29
+ scalePhotos: true,
30
+ scrolling: true,
31
+ opacity: 0.9,
32
+ preloading: true,
33
+ className: false,
34
+ overlayClose: true,
35
+ escKey: true,
36
+ arrowKey: true,
37
+ top: false,
38
+ bottom: false,
39
+ left: false,
40
+ right: false,
41
+ fixed: false,
42
+ data: undefined,
43
+ closeButton: true,
44
+ fastIframe: true,
45
+ open: false,
46
+ reposition: true,
47
+ loop: true,
48
+ slideshow: false,
49
+ slideshowAuto: true,
50
+ slideshowSpeed: 2500,
51
+ slideshowStart: "start slideshow",
52
+ slideshowStop: "stop slideshow",
53
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
54
+
55
+ // alternate image paths for high-res displays
56
+ retinaImage: false,
57
+ retinaUrl: false,
58
+ retinaSuffix: '@2x.$1',
59
+
60
+ // internationalization
61
+ current: "image {current} of {total}",
62
+ previous: "previous",
63
+ next: "next",
64
+ close: "close",
65
+ xhrError: "This content failed to load.",
66
+ imgError: "This image failed to load.",
67
+
68
+ // accessbility
69
+ returnFocus: true,
70
+ trapFocus: true,
71
+
72
+ // callbacks
73
+ onOpen: false,
74
+ onLoad: false,
75
+ onComplete: false,
76
+ onCleanup: false,
77
+ onClosed: false,
78
+
79
+ rel: function() {
80
+ return this.rel;
81
+ },
82
+ href: function() {
83
+ // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
84
+ return $(this).attr('href');
85
+ },
86
+ title: function() {
87
+ return this.title;
88
+ },
89
+ createImg: function() {
90
+ var img = new Image();
91
+ var attrs = $(this).data('cbox-img-attrs');
92
+
93
+ if (typeof attrs === 'object') {
94
+ $.each(attrs, function(key, val){
95
+ img[key] = val;
96
+ });
97
+ }
98
+
99
+ return img;
100
+ },
101
+ createIframe: function() {
102
+ var iframe = document.createElement('iframe');
103
+ var attrs = $(this).data('cbox-iframe-attrs');
104
+
105
+ if (typeof attrs === 'object') {
106
+ $.each(attrs, function(key, val){
107
+ iframe[key] = val;
108
+ });
109
+ }
110
+
111
+ if ('frameBorder' in iframe) {
112
+ iframe.frameBorder = 0;
113
+ }
114
+ if ('allowTransparency' in iframe) {
115
+ iframe.allowTransparency = "true";
116
+ }
117
+ iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
118
+ iframe.allowFullscreen = true;
119
+
120
+ return iframe;
121
+ }
122
+ },
123
+
124
+ // Abstracting the HTML and event identifiers for easy rebranding
125
+ colorbox = 'colorbox',
126
+ prefix = 'cbox',
127
+ boxElement = prefix + 'Element',
128
+
129
+ // Events
130
+ event_open = prefix + '_open',
131
+ event_load = prefix + '_load',
132
+ event_complete = prefix + '_complete',
133
+ event_cleanup = prefix + '_cleanup',
134
+ event_closed = prefix + '_closed',
135
+ event_purge = prefix + '_purge',
136
+
137
+ // Cached jQuery Object Variables
138
+ $overlay,
139
+ $box,
140
+ $wrap,
141
+ $content,
142
+ $topBorder,
143
+ $leftBorder,
144
+ $rightBorder,
145
+ $bottomBorder,
146
+ $related,
147
+ $window,
148
+ $loaded,
149
+ $loadingBay,
150
+ $loadingOverlay,
151
+ $title,
152
+ $current,
153
+ $slideshow,
154
+ $next,
155
+ $prev,
156
+ $close,
157
+ $groupControls,
158
+ $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
159
+
160
+ // Variables for cached values or use across multiple functions
161
+ settings,
162
+ interfaceHeight,
163
+ interfaceWidth,
164
+ loadedHeight,
165
+ loadedWidth,
166
+ index,
167
+ photo,
168
+ open,
169
+ active,
170
+ closing,
171
+ loadingTimer,
172
+ publicMethod,
173
+ div = "div",
174
+ requests = 0,
175
+ previousCSS = {},
176
+ init;
177
+
178
+ // ****************
179
+ // HELPER FUNCTIONS
180
+ // ****************
181
+
182
+ // Convenience function for creating new jQuery objects
183
+ function $tag(tag, id, css) {
184
+ var element = document.createElement(tag);
185
+
186
+ if (id) {
187
+ element.id = prefix + id;
188
+ }
189
+
190
+ if (css) {
191
+ element.style.cssText = css;
192
+ }
193
+
194
+ return $(element);
195
+ }
196
+
197
+ // Get the window height using innerHeight when available to avoid an issue with iOS
198
+ // http://bugs.jquery.com/ticket/6724
199
+ function winheight() {
200
+ return window.innerHeight ? window.innerHeight : $(window).height();
201
+ }
202
+
203
+ function Settings(element, options) {
204
+ if (options !== Object(options)) {
205
+ options = {};
206
+ }
207
+
208
+ this.cache = {};
209
+ this.el = element;
210
+
211
+ this.value = function(key) {
212
+ var dataAttr;
213
+
214
+ if (this.cache[key] === undefined) {
215
+ dataAttr = $(this.el).attr('data-cbox-'+key);
216
+
217
+ if (dataAttr !== undefined) {
218
+ this.cache[key] = dataAttr;
219
+ } else if (options[key] !== undefined) {
220
+ this.cache[key] = options[key];
221
+ } else if (defaults[key] !== undefined) {
222
+ this.cache[key] = defaults[key];
223
+ }
224
+ }
225
+
226
+ return this.cache[key];
227
+ };
228
+
229
+ this.get = function(key) {
230
+ var value = this.value(key);
231
+ return $.isFunction(value) ? value.call(this.el, this) : value;
232
+ };
233
+ }
234
+
235
+ // Determine the next and previous members in a group.
236
+ function getIndex(increment) {
237
+ var
238
+ max = $related.length,
239
+ newIndex = (index + increment) % max;
240
+
241
+ return (newIndex < 0) ? max + newIndex : newIndex;
242
+ }
243
+
244
+ // Convert '%' and 'px' values to integers
245
+ function setSize(size, dimension) {
246
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
247
+ }
248
+
249
+ // Checks an href to see if it is a photo.
250
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
251
+ function isImage(settings, url) {
252
+ return settings.get('photo') || settings.get('photoRegex').test(url);
253
+ }
254
+
255
+ function retinaUrl(settings, url) {
256
+ return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
257
+ }
258
+
259
+ function trapFocus(e) {
260
+ if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
261
+ e.stopPropagation();
262
+ $box.focus();
263
+ }
264
+ }
265
+
266
+ function setClass(str) {
267
+ if (setClass.str !== str) {
268
+ $box.add($overlay).removeClass(setClass.str).addClass(str);
269
+ setClass.str = str;
270
+ }
271
+ }
272
+
273
+ function getRelated(rel) {
274
+ index = 0;
275
+
276
+ if (rel && rel !== false && rel !== 'nofollow') {
277
+ $related = $('.' + boxElement).filter(function () {
278
+ var options = $.data(this, colorbox);
279
+ var settings = new Settings(this, options);
280
+ return (settings.get('rel') === rel);
281
+ });
282
+ index = $related.index(settings.el);
283
+
284
+ // Check direct calls to Colorbox.
285
+ if (index === -1) {
286
+ $related = $related.add(settings.el);
287
+ index = $related.length - 1;
288
+ }
289
+ } else {
290
+ $related = $(settings.el);
291
+ }
292
+ }
293
+
294
+ function trigger(event) {
295
+ // for external use
296
+ $(document).trigger(event);
297
+ // for internal use
298
+ $events.triggerHandler(event);
299
+ }
300
+
301
+ var slideshow = (function(){
302
+ var active,
303
+ className = prefix + "Slideshow_",
304
+ click = "click." + prefix,
305
+ timeOut;
306
+
307
+ function clear () {
308
+ clearTimeout(timeOut);
309
+ }
310
+
311
+ function set() {
312
+ if (settings.get('loop') || $related[index + 1]) {
313
+ clear();
314
+ timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
315
+ }
316
+ }
317
+
318
+ function start() {
319
+ $slideshow
320
+ .html(settings.get('slideshowStop'))
321
+ .unbind(click)
322
+ .one(click, stop);
323
+
324
+ $events
325
+ .bind(event_complete, set)
326
+ .bind(event_load, clear);
327
+
328
+ $box.removeClass(className + "off").addClass(className + "on");
329
+ }
330
+
331
+ function stop() {
332
+ clear();
333
+
334
+ $events
335
+ .unbind(event_complete, set)
336
+ .unbind(event_load, clear);
337
+
338
+ $slideshow
339
+ .html(settings.get('slideshowStart'))
340
+ .unbind(click)
341
+ .one(click, function () {
342
+ publicMethod.next();
343
+ start();
344
+ });
345
+
346
+ $box.removeClass(className + "on").addClass(className + "off");
347
+ }
348
+
349
+ function reset() {
350
+ active = false;
351
+ $slideshow.hide();
352
+ clear();
353
+ $events
354
+ .unbind(event_complete, set)
355
+ .unbind(event_load, clear);
356
+ $box.removeClass(className + "off " + className + "on");
357
+ }
358
+
359
+ return function(){
360
+ if (active) {
361
+ if (!settings.get('slideshow')) {
362
+ $events.unbind(event_cleanup, reset);
363
+ reset();
364
+ }
365
+ } else {
366
+ if (settings.get('slideshow') && $related[1]) {
367
+ active = true;
368
+ $events.one(event_cleanup, reset);
369
+ if (settings.get('slideshowAuto')) {
370
+ start();
371
+ } else {
372
+ stop();
373
+ }
374
+ $slideshow.show();
375
+ }
376
+ }
377
+ };
378
+
379
+ }());
380
+
381
+
382
+ function launch(element) {
383
+ var options;
384
+
385
+ if (!closing) {
386
+
387
+ options = $(element).data(colorbox);
388
+
389
+ settings = new Settings(element, options);
390
+
391
+ getRelated(settings.get('rel'));
392
+
393
+ if (!open) {
394
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
395
+
396
+ setClass(settings.get('className'));
397
+
398
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
399
+ $box.css({visibility:'hidden', display:'block', opacity:''});
400
+
401
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
402
+ $content.css({width:'', height:''}).append($loaded);
403
+
404
+ // Cache values needed for size calculations
405
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
406
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
407
+ loadedHeight = $loaded.outerHeight(true);
408
+ loadedWidth = $loaded.outerWidth(true);
409
+
410
+ // Opens inital empty Colorbox prior to content being loaded.
411
+ var initialWidth = setSize(settings.get('initialWidth'), 'x');
412
+ var initialHeight = setSize(settings.get('initialHeight'), 'y');
413
+ var maxWidth = settings.get('maxWidth');
414
+ var maxHeight = settings.get('maxHeight');
415
+
416
+ settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0);
417
+ settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0);
418
+
419
+ $loaded.css({width:'', height:settings.h});
420
+ publicMethod.position();
421
+
422
+ trigger(event_open);
423
+ settings.get('onOpen');
424
+
425
+ $groupControls.add($title).hide();
426
+
427
+ $box.focus();
428
+
429
+ if (settings.get('trapFocus')) {
430
+ // Confine focus to the modal
431
+ // Uses event capturing that is not supported in IE8-
432
+ if (document.addEventListener) {
433
+
434
+ document.addEventListener('focus', trapFocus, true);
435
+
436
+ $events.one(event_closed, function () {
437
+ document.removeEventListener('focus', trapFocus, true);
438
+ });
439
+ }
440
+ }
441
+
442
+ // Return focus on closing
443
+ if (settings.get('returnFocus')) {
444
+ $events.one(event_closed, function () {
445
+ $(settings.el).focus();
446
+ });
447
+ }
448
+ }
449
+
450
+ var opacity = parseFloat(settings.get('opacity'));
451
+ $overlay.css({
452
+ opacity: opacity === opacity ? opacity : '',
453
+ cursor: settings.get('overlayClose') ? 'pointer' : '',
454
+ visibility: 'visible'
455
+ }).show();
456
+
457
+ if (settings.get('closeButton')) {
458
+ $close.html(settings.get('close')).appendTo($content);
459
+ } else {
460
+ $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
461
+ }
462
+
463
+ load();
464
+ }
465
+ }
466
+
467
+ // Colorbox's markup needs to be added to the DOM prior to being called
468
+ // so that the browser will go ahead and load the CSS background images.
469
+ function appendHTML() {
470
+ if (!$box) {
471
+ init = false;
472
+ $window = $(window);
473
+ $box = $tag(div).attr({
474
+ id: colorbox,
475
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
476
+ role: 'dialog',
477
+ tabindex: '-1'
478
+ }).hide();
479
+ $overlay = $tag(div, "Overlay").hide();
480
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
481
+ $wrap = $tag(div, "Wrapper");
482
+ $content = $tag(div, "Content").append(
483
+ $title = $tag(div, "Title"),
484
+ $current = $tag(div, "Current"),
485
+ $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
486
+ $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
487
+ $slideshow = $('<button type="button"/>').attr({id:prefix+'Slideshow'}),
488
+ $loadingOverlay
489
+ );
490
+
491
+ $close = $('<button type="button"/>').attr({id:prefix+'Close'});
492
+
493
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
494
+ $tag(div).append(
495
+ $tag(div, "TopLeft"),
496
+ $topBorder = $tag(div, "TopCenter"),
497
+ $tag(div, "TopRight")
498
+ ),
499
+ $tag(div, false, 'clear:left').append(
500
+ $leftBorder = $tag(div, "MiddleLeft"),
501
+ $content,
502
+ $rightBorder = $tag(div, "MiddleRight")
503
+ ),
504
+ $tag(div, false, 'clear:left').append(
505
+ $tag(div, "BottomLeft"),
506
+ $bottomBorder = $tag(div, "BottomCenter"),
507
+ $tag(div, "BottomRight")
508
+ )
509
+ ).find('div div').css({'float': 'left'});
510
+
511
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
512
+
513
+ $groupControls = $next.add($prev).add($current).add($slideshow);
514
+ }
515
+ if (document.body && !$box.parent().length) {
516
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
517
+ }
518
+ }
519
+
520
+ // Add Colorbox's event bindings
521
+ function addBindings() {
522
+ function clickHandler(e) {
523
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
524
+ // See: http://jacklmoore.com/notes/click-events/
525
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
526
+ e.preventDefault();
527
+ launch(this);
528
+ }
529
+ }
530
+
531
+ if ($box) {
532
+ if (!init) {
533
+ init = true;
534
+
535
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
536
+ $next.click(function () {
537
+ publicMethod.next();
538
+ });
539
+ $prev.click(function () {
540
+ publicMethod.prev();
541
+ });
542
+ $close.click(function () {
543
+ publicMethod.close();
544
+ });
545
+ $overlay.click(function () {
546
+ if (settings.get('overlayClose')) {
547
+ publicMethod.close();
548
+ }
549
+ });
550
+
551
+ // Key Bindings
552
+ $(document).bind('keydown.' + prefix, function (e) {
553
+ var key = e.keyCode;
554
+ if (open && settings.get('escKey') && key === 27) {
555
+ e.preventDefault();
556
+ publicMethod.close();
557
+ }
558
+ if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
559
+ if (key === 37) {
560
+ e.preventDefault();
561
+ $prev.click();
562
+ } else if (key === 39) {
563
+ e.preventDefault();
564
+ $next.click();
565
+ }
566
+ }
567
+ });
568
+
569
+ if ($.isFunction($.fn.on)) {
570
+ // For jQuery 1.7+
571
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
572
+ } else {
573
+ // For jQuery 1.3.x -> 1.6.x
574
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
575
+ // This is not here for jQuery 1.9, it's here for legacy users.
576
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
577
+ }
578
+ }
579
+ return true;
580
+ }
581
+ return false;
582
+ }
583
+
584
+ // Don't do anything if Colorbox already exists.
585
+ if ($[colorbox]) {
586
+ return;
587
+ }
588
+
589
+ // Append the HTML when the DOM loads
590
+ $(appendHTML);
591
+
592
+
593
+ // ****************
594
+ // PUBLIC FUNCTIONS
595
+ // Usage format: $.colorbox.close();
596
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
597
+ // ****************
598
+
599
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
600
+ var settings;
601
+ var $obj = this;
602
+
603
+ options = options || {};
604
+
605
+ if ($.isFunction($obj)) { // assume a call to $.colorbox
606
+ $obj = $('<a/>');
607
+ options.open = true;
608
+ }
609
+
610
+ if (!$obj[0]) { // colorbox being applied to empty collection
611
+ return $obj;
612
+ }
613
+
614
+ appendHTML();
615
+
616
+ if (addBindings()) {
617
+
618
+ if (callback) {
619
+ options.onComplete = callback;
620
+ }
621
+
622
+ $obj.each(function () {
623
+ var old = $.data(this, colorbox) || {};
624
+ $.data(this, colorbox, $.extend(old, options));
625
+ }).addClass(boxElement);
626
+
627
+ settings = new Settings($obj[0], options);
628
+
629
+ if (settings.get('open')) {
630
+ launch($obj[0]);
631
+ }
632
+ }
633
+
634
+ return $obj;
635
+ };
636
+
637
+ publicMethod.position = function (speed, loadedCallback) {
638
+ var
639
+ css,
640
+ top = 0,
641
+ left = 0,
642
+ offset = $box.offset(),
643
+ scrollTop,
644
+ scrollLeft;
645
+
646
+ $window.unbind('resize.' + prefix);
647
+
648
+ // remove the modal so that it doesn't influence the document width/height
649
+ $box.css({top: -9e4, left: -9e4});
650
+
651
+ scrollTop = $window.scrollTop();
652
+ scrollLeft = $window.scrollLeft();
653
+
654
+ if (settings.get('fixed')) {
655
+ offset.top -= scrollTop;
656
+ offset.left -= scrollLeft;
657
+ $box.css({position: 'fixed'});
658
+ } else {
659
+ top = scrollTop;
660
+ left = scrollLeft;
661
+ $box.css({position: 'absolute'});
662
+ }
663
+
664
+ // keeps the top and left positions within the browser's viewport.
665
+ if (settings.get('right') !== false) {
666
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
667
+ } else if (settings.get('left') !== false) {
668
+ left += setSize(settings.get('left'), 'x');
669
+ } else {
670
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
671
+ }
672
+
673
+ if (settings.get('bottom') !== false) {
674
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
675
+ } else if (settings.get('top') !== false) {
676
+ top += setSize(settings.get('top'), 'y');
677
+ } else {
678
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
679
+ }
680
+
681
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
682
+
683
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
684
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
685
+ // it can invoke an obscure IE bug when using iframes.
686
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
687
+
688
+ function modalDimensions() {
689
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
690
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
691
+ }
692
+
693
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
694
+
695
+ // setting the speed to 0 if the content hasn't changed size or position
696
+ if (speed) {
697
+ var tempSpeed = 0;
698
+ $.each(css, function(i){
699
+ if (css[i] !== previousCSS[i]) {
700
+ tempSpeed = speed;
701
+ return;
702
+ }
703
+ });
704
+ speed = tempSpeed;
705
+ }
706
+
707
+ previousCSS = css;
708
+
709
+ if (!speed) {
710
+ $box.css(css);
711
+ }
712
+
713
+ $box.dequeue().animate(css, {
714
+ duration: speed || 0,
715
+ complete: function () {
716
+ modalDimensions();
717
+
718
+ active = false;
719
+
720
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
721
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
722
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
723
+
724
+ if (settings.get('reposition')) {
725
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
726
+ $window.bind('resize.' + prefix, publicMethod.position);
727
+ }, 1);
728
+ }
729
+
730
+ if ($.isFunction(loadedCallback)) {
731
+ loadedCallback();
732
+ }
733
+ },
734
+ step: modalDimensions
735
+ });
736
+ };
737
+
738
+ publicMethod.resize = function (options) {
739
+ var scrolltop;
740
+
741
+ if (open) {
742
+ options = options || {};
743
+
744
+ if (options.width) {
745
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
746
+ }
747
+
748
+ if (options.innerWidth) {
749
+ settings.w = setSize(options.innerWidth, 'x');
750
+ }
751
+
752
+ $loaded.css({width: settings.w});
753
+
754
+ if (options.height) {
755
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
756
+ }
757
+
758
+ if (options.innerHeight) {
759
+ settings.h = setSize(options.innerHeight, 'y');
760
+ }
761
+
762
+ if (!options.innerHeight && !options.height) {
763
+ scrolltop = $loaded.scrollTop();
764
+ $loaded.css({height: "auto"});
765
+ settings.h = $loaded.height();
766
+ }
767
+
768
+ $loaded.css({height: settings.h});
769
+
770
+ if(scrolltop) {
771
+ $loaded.scrollTop(scrolltop);
772
+ }
773
+
774
+ publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
775
+ }
776
+ };
777
+
778
+ publicMethod.prep = function (object) {
779
+ if (!open) {
780
+ return;
781
+ }
782
+
783
+ var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
784
+
785
+ $loaded.remove();
786
+
787
+ $loaded = $tag(div, 'LoadedContent').append(object);
788
+
789
+ function getWidth() {
790
+ settings.w = settings.w || $loaded.width();
791
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
792
+ return settings.w;
793
+ }
794
+ function getHeight() {
795
+ settings.h = settings.h || $loaded.height();
796
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
797
+ return settings.h;
798
+ }
799
+
800
+ $loaded.hide()
801
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
802
+ .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
803
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
804
+ .prependTo($content);
805
+
806
+ $loadingBay.hide();
807
+
808
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
809
+
810
+ $(photo).css({'float': 'none'});
811
+
812
+ setClass(settings.get('className'));
813
+
814
+ callback = function () {
815
+ var total = $related.length,
816
+ iframe,
817
+ complete;
818
+
819
+ if (!open) {
820
+ return;
821
+ }
822
+
823
+ function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
824
+ if ($.support.opacity === false) {
825
+ $box[0].style.removeAttribute('filter');
826
+ }
827
+ }
828
+
829
+ complete = function () {
830
+ clearTimeout(loadingTimer);
831
+ $loadingOverlay.hide();
832
+ trigger(event_complete);
833
+ settings.get('onComplete');
834
+ };
835
+
836
+
837
+ $title.html(settings.get('title')).show();
838
+ $loaded.show();
839
+
840
+ if (total > 1) { // handle grouping
841
+ if (typeof settings.get('current') === "string") {
842
+ $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
843
+ }
844
+
845
+ $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
846
+ $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
847
+
848
+ slideshow();
849
+
850
+ // Preloads images within a rel group
851
+ if (settings.get('preloading')) {
852
+ $.each([getIndex(-1), getIndex(1)], function(){
853
+ var img,
854
+ i = $related[this],
855
+ settings = new Settings(i, $.data(i, colorbox)),
856
+ src = settings.get('href');
857
+
858
+ if (src && isImage(settings, src)) {
859
+ src = retinaUrl(settings, src);
860
+ img = document.createElement('img');
861
+ img.src = src;
862
+ }
863
+ });
864
+ }
865
+ } else {
866
+ $groupControls.hide();
867
+ }
868
+
869
+ if (settings.get('iframe')) {
870
+
871
+ iframe = settings.get('createIframe');
872
+
873
+ if (!settings.get('scrolling')) {
874
+ iframe.scrolling = "no";
875
+ }
876
+
877
+ $(iframe)
878
+ .attr({
879
+ src: settings.get('href'),
880
+ 'class': prefix + 'Iframe'
881
+ })
882
+ .one('load', complete)
883
+ .appendTo($loaded);
884
+
885
+ $events.one(event_purge, function () {
886
+ iframe.src = "//about:blank";
887
+ });
888
+
889
+ if (settings.get('fastIframe')) {
890
+ $(iframe).trigger('load');
891
+ }
892
+ } else {
893
+ complete();
894
+ }
895
+
896
+ if (settings.get('transition') === 'fade') {
897
+ $box.fadeTo(speed, 1, removeFilter);
898
+ } else {
899
+ removeFilter();
900
+ }
901
+ };
902
+
903
+ if (settings.get('transition') === 'fade') {
904
+ $box.fadeTo(speed, 0, function () {
905
+ publicMethod.position(0, callback);
906
+ });
907
+ } else {
908
+ publicMethod.position(speed, callback);
909
+ }
910
+ };
911
+
912
+ function load () {
913
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
914
+
915
+ active = true;
916
+
917
+ photo = false;
918
+
919
+ trigger(event_purge);
920
+ trigger(event_load);
921
+ settings.get('onLoad');
922
+
923
+ settings.h = settings.get('height') ?
924
+ setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
925
+ settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
926
+
927
+ settings.w = settings.get('width') ?
928
+ setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
929
+ settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
930
+
931
+ // Sets the minimum dimensions for use in image scaling
932
+ settings.mw = settings.w;
933
+ settings.mh = settings.h;
934
+
935
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
936
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
937
+ if (settings.get('maxWidth')) {
938
+ settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
939
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
940
+ }
941
+ if (settings.get('maxHeight')) {
942
+ settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
943
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
944
+ }
945
+
946
+ href = settings.get('href');
947
+
948
+ loadingTimer = setTimeout(function () {
949
+ $loadingOverlay.show();
950
+ }, 100);
951
+
952
+ if (settings.get('inline')) {
953
+ var $target = $(href).eq(0);
954
+ // Inserts an empty placeholder where inline content is being pulled from.
955
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
956
+ $inline = $('<div>').hide().insertBefore($target);
957
+
958
+ $events.one(event_purge, function () {
959
+ $inline.replaceWith($target);
960
+ });
961
+
962
+ prep($target);
963
+ } else if (settings.get('iframe')) {
964
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
965
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
966
+ prep(" ");
967
+ } else if (settings.get('html')) {
968
+ prep(settings.get('html'));
969
+ } else if (isImage(settings, href)) {
970
+
971
+ href = retinaUrl(settings, href);
972
+
973
+ photo = settings.get('createImg');
974
+
975
+ $(photo)
976
+ .addClass(prefix + 'Photo')
977
+ .bind('error.'+prefix,function () {
978
+ prep($tag(div, 'Error').html(settings.get('imgError')));
979
+ })
980
+ .one('load', function () {
981
+ if (request !== requests) {
982
+ return;
983
+ }
984
+
985
+ // A small pause because some browsers will occassionaly report a
986
+ // img.width and img.height of zero immediately after the img.onload fires
987
+ setTimeout(function(){
988
+ var percent;
989
+
990
+ if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
991
+ photo.height = photo.height / window.devicePixelRatio;
992
+ photo.width = photo.width / window.devicePixelRatio;
993
+ }
994
+
995
+ if (settings.get('scalePhotos')) {
996
+ setResize = function () {
997
+ photo.height -= photo.height * percent;
998
+ photo.width -= photo.width * percent;
999
+ };
1000
+ if (settings.mw && photo.width > settings.mw) {
1001
+ percent = (photo.width - settings.mw) / photo.width;
1002
+ setResize();
1003
+ }
1004
+ if (settings.mh && photo.height > settings.mh) {
1005
+ percent = (photo.height - settings.mh) / photo.height;
1006
+ setResize();
1007
+ }
1008
+ }
1009
+
1010
+ if (settings.h) {
1011
+ photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
1012
+ }
1013
+
1014
+ if ($related[1] && (settings.get('loop') || $related[index + 1])) {
1015
+ photo.style.cursor = 'pointer';
1016
+
1017
+ $(photo).bind('click.'+prefix, function () {
1018
+ publicMethod.next();
1019
+ });
1020
+ }
1021
+
1022
+ photo.style.width = photo.width + 'px';
1023
+ photo.style.height = photo.height + 'px';
1024
+ prep(photo);
1025
+ }, 1);
1026
+ });
1027
+
1028
+ photo.src = href;
1029
+
1030
+ } else if (href) {
1031
+ $loadingBay.load(href, settings.get('data'), function (data, status) {
1032
+ if (request === requests) {
1033
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
1034
+ }
1035
+ });
1036
+ }
1037
+ }
1038
+
1039
+ // Navigates to the next page/image in a set.
1040
+ publicMethod.next = function () {
1041
+ if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
1042
+ index = getIndex(1);
1043
+ launch($related[index]);
1044
+ }
1045
+ };
1046
+
1047
+ publicMethod.prev = function () {
1048
+ if (!active && $related[1] && (settings.get('loop') || index)) {
1049
+ index = getIndex(-1);
1050
+ launch($related[index]);
1051
+ }
1052
+ };
1053
+
1054
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1055
+ publicMethod.close = function () {
1056
+ if (open && !closing) {
1057
+
1058
+ closing = true;
1059
+ open = false;
1060
+ trigger(event_cleanup);
1061
+ settings.get('onCleanup');
1062
+ $window.unbind('.' + prefix);
1063
+ $overlay.fadeTo(settings.get('fadeOut') || 0, 0);
1064
+
1065
+ $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
1066
+ $box.hide();
1067
+ $overlay.hide();
1068
+ trigger(event_purge);
1069
+ $loaded.remove();
1070
+
1071
+ setTimeout(function () {
1072
+ closing = false;
1073
+ trigger(event_closed);
1074
+ settings.get('onClosed');
1075
+ }, 1);
1076
+ });
1077
+ }
1078
+ };
1079
+
1080
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
1081
+ publicMethod.remove = function () {
1082
+ if (!$box) { return; }
1083
+
1084
+ $box.stop();
1085
+ $[colorbox].close();
1086
+ $box.stop(false, true).remove();
1087
+ $overlay.remove();
1088
+ closing = false;
1089
+ $box = null;
1090
+ $('.' + boxElement)
1091
+ .removeData(colorbox)
1092
+ .removeClass(boxElement);
1093
+
1094
+ $(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
1095
+ };
1096
+
1097
+ // A method for fetching the current element Colorbox is referencing.
1098
+ // returns a jQuery object.
1099
+ publicMethod.element = function () {
1100
+ return $(settings.el);
1101
+ };
1102
+
1103
+ publicMethod.settings = defaults;
1104
+
1105
+ }(jQuery, document, window));
js/carebyzinc/product.js ADDED
@@ -0,0 +1,812 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magento.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magento.com for more information.
19
+ *
20
+ * @category Varien
21
+ * @package js
22
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ if(typeof Product=='undefined') {
26
+ var Product = {};
27
+ }
28
+
29
+ /********************* IMAGE ZOOMER ***********************/
30
+
31
+ Product.Zoom = Class.create();
32
+ /**
33
+ * Image zoom control
34
+ *
35
+ * @author Magento Core Team <core@magentocommerce.com>
36
+ */
37
+ Product.Zoom.prototype = {
38
+ initialize: function(imageEl, trackEl, handleEl, zoomInEl, zoomOutEl, hintEl){
39
+ this.containerEl = $(imageEl).parentNode;
40
+ this.imageEl = $(imageEl);
41
+ this.handleEl = $(handleEl);
42
+ this.trackEl = $(trackEl);
43
+ this.hintEl = $(hintEl);
44
+
45
+ this.containerDim = Element.getDimensions(this.containerEl);
46
+ this.imageDim = Element.getDimensions(this.imageEl);
47
+
48
+ this.imageDim.ratio = this.imageDim.width/this.imageDim.height;
49
+
50
+ this.floorZoom = 1;
51
+
52
+ if (this.imageDim.width > this.imageDim.height) {
53
+ this.ceilingZoom = this.imageDim.width / this.containerDim.width;
54
+ } else {
55
+ this.ceilingZoom = this.imageDim.height / this.containerDim.height;
56
+ }
57
+
58
+ if (this.imageDim.width <= this.containerDim.width
59
+ && this.imageDim.height <= this.containerDim.height) {
60
+ this.trackEl.up().hide();
61
+ this.hintEl.hide();
62
+ this.containerEl.removeClassName('product-image-zoom');
63
+ return;
64
+ }
65
+
66
+ this.imageX = 0;
67
+ this.imageY = 0;
68
+ this.imageZoom = 1;
69
+
70
+ this.sliderSpeed = 0;
71
+ this.sliderAccel = 0;
72
+ this.zoomBtnPressed = false;
73
+
74
+ this.showFull = false;
75
+
76
+ this.selects = document.getElementsByTagName('select');
77
+
78
+ this.draggable = new Draggable(imageEl, {
79
+ starteffect:false,
80
+ reverteffect:false,
81
+ endeffect:false,
82
+ snap:this.contain.bind(this)
83
+ });
84
+
85
+ this.slider = new Control.Slider(handleEl, trackEl, {
86
+ axis:'horizontal',
87
+ minimum:0,
88
+ maximum:Element.getDimensions(this.trackEl).width,
89
+ alignX:0,
90
+ increment:1,
91
+ sliderValue:0,
92
+ onSlide:this.scale.bind(this),
93
+ onChange:this.scale.bind(this)
94
+ });
95
+
96
+ this.scale(0);
97
+
98
+ Event.observe(this.imageEl, 'dblclick', this.toggleFull.bind(this));
99
+
100
+ Event.observe($(zoomInEl), 'mousedown', this.startZoomIn.bind(this));
101
+ Event.observe($(zoomInEl), 'mouseup', this.stopZooming.bind(this));
102
+ Event.observe($(zoomInEl), 'mouseout', this.stopZooming.bind(this));
103
+
104
+ Event.observe($(zoomOutEl), 'mousedown', this.startZoomOut.bind(this));
105
+ Event.observe($(zoomOutEl), 'mouseup', this.stopZooming.bind(this));
106
+ Event.observe($(zoomOutEl), 'mouseout', this.stopZooming.bind(this));
107
+ },
108
+
109
+ toggleFull: function () {
110
+ this.showFull = !this.showFull;
111
+
112
+ //Hide selects for IE6 only
113
+ if (typeof document.body.style.maxHeight == "undefined") {
114
+ for (i=0; i<this.selects.length; i++) {
115
+ this.selects[i].style.visibility = this.showFull ? 'hidden' : 'visible';
116
+ }
117
+ }
118
+ val_scale = !this.showFull ? this.slider.value : 1;
119
+ this.scale(val_scale);
120
+
121
+ this.trackEl.style.visibility = this.showFull ? 'hidden' : 'visible';
122
+ this.containerEl.style.overflow = this.showFull ? 'visible' : 'hidden';
123
+ this.containerEl.style.zIndex = this.showFull ? '1000' : '9';
124
+
125
+ return this;
126
+ },
127
+
128
+ scale: function (v) {
129
+ var centerX = (this.containerDim.width*(1-this.imageZoom)/2-this.imageX)/this.imageZoom;
130
+ var centerY = (this.containerDim.height*(1-this.imageZoom)/2-this.imageY)/this.imageZoom;
131
+ var overSize = (this.imageDim.width > this.containerDim.width || this.imageDim.height > this.containerDim.height);
132
+
133
+ this.imageZoom = this.floorZoom+(v*(this.ceilingZoom-this.floorZoom));
134
+
135
+ if (overSize) {
136
+ if (this.imageDim.width > this.imageDim.height) {
137
+ this.imageEl.style.width = (this.imageZoom*this.containerDim.width)+'px';
138
+ } else {
139
+ this.imageEl.style.height = (this.imageZoom*this.containerDim.height)+'px';
140
+ }
141
+ if (this.containerDim.ratio) {
142
+ if (this.imageDim.width > this.imageDim.height) {
143
+ this.imageEl.style.height = (this.imageZoom*this.containerDim.width*this.containerDim.ratio)+'px'; // for safari
144
+ } else {
145
+ this.imageEl.style.width = (this.imageZoom*this.containerDim.height*this.containerDim.ratio)+'px'; // for safari
146
+ }
147
+ }
148
+ } else {
149
+ this.slider.setDisabled();
150
+ }
151
+
152
+ this.imageX = this.containerDim.width*(1-this.imageZoom)/2-centerX*this.imageZoom;
153
+ this.imageY = this.containerDim.height*(1-this.imageZoom)/2-centerY*this.imageZoom;
154
+
155
+ this.contain(this.imageX, this.imageY, this.draggable);
156
+
157
+ return true;
158
+ },
159
+
160
+ startZoomIn: function()
161
+ {
162
+ if (!this.slider.disabled) {
163
+ this.zoomBtnPressed = true;
164
+ this.sliderAccel = .002;
165
+ this.periodicalZoom();
166
+ this.zoomer = new PeriodicalExecuter(this.periodicalZoom.bind(this), .05);
167
+ }
168
+ return this;
169
+ },
170
+
171
+ startZoomOut: function()
172
+ {
173
+ if (!this.slider.disabled) {
174
+ this.zoomBtnPressed = true;
175
+ this.sliderAccel = -.002;
176
+ this.periodicalZoom();
177
+ this.zoomer = new PeriodicalExecuter(this.periodicalZoom.bind(this), .05);
178
+ }
179
+ return this;
180
+ },
181
+
182
+ stopZooming: function()
183
+ {
184
+ if (!this.zoomer || this.sliderSpeed==0) {
185
+ return;
186
+ }
187
+ this.zoomBtnPressed = false;
188
+ this.sliderAccel = 0;
189
+ },
190
+
191
+ periodicalZoom: function()
192
+ {
193
+ if (!this.zoomer) {
194
+ return this;
195
+ }
196
+
197
+ if (this.zoomBtnPressed) {
198
+ this.sliderSpeed += this.sliderAccel;
199
+ } else {
200
+ this.sliderSpeed /= 1.5;
201
+ if (Math.abs(this.sliderSpeed)<.001) {
202
+ this.sliderSpeed = 0;
203
+ this.zoomer.stop();
204
+ this.zoomer = null;
205
+ }
206
+ }
207
+ this.slider.value += this.sliderSpeed;
208
+
209
+ this.slider.setValue(this.slider.value);
210
+ this.scale(this.slider.value);
211
+
212
+ return this;
213
+ },
214
+
215
+ contain: function (x,y,draggable) {
216
+
217
+ var dim = Element.getDimensions(draggable.element);
218
+
219
+ var xMin = 0, xMax = this.containerDim.width-dim.width;
220
+ var yMin = 0, yMax = this.containerDim.height-dim.height;
221
+
222
+ x = x>xMin ? xMin : x;
223
+ x = x<xMax ? xMax : x;
224
+ y = y>yMin ? yMin : y;
225
+ y = y<yMax ? yMax : y;
226
+
227
+ if (this.containerDim.width > dim.width) {
228
+ x = (this.containerDim.width/2) - (dim.width/2);
229
+ }
230
+
231
+ if (this.containerDim.height > dim.height) {
232
+ y = (this.containerDim.height/2) - (dim.height/2);
233
+ }
234
+
235
+ this.imageX = x;
236
+ this.imageY = y;
237
+
238
+ this.imageEl.style.left = this.imageX+'px';
239
+ this.imageEl.style.top = this.imageY+'px';
240
+
241
+ return [x,y];
242
+ }
243
+ }
244
+
245
+ /**************************** CONFIGURABLE PRODUCT **************************/
246
+ Product.Config = Class.create();
247
+ Product.Config.prototype = {
248
+ initialize: function(config){
249
+ this.config = config;
250
+ this.taxConfig = this.config.taxConfig;
251
+ this.settings = $$('.super-attribute-select');
252
+ this.state = new Hash();
253
+ this.priceTemplate = new Template(this.config.template);
254
+ this.prices = config.prices;
255
+
256
+ this.settings.each(function(element){
257
+ Event.observe(element, 'change', this.configure.bind(this))
258
+ }.bind(this));
259
+
260
+ // fill state
261
+ this.settings.each(function(element){
262
+ var attributeId = element.id.replace(/[a-z]*/, '');
263
+ if(attributeId && this.config.attributes[attributeId]) {
264
+ element.config = this.config.attributes[attributeId];
265
+ element.attributeId = attributeId;
266
+ this.state[attributeId] = false;
267
+ }
268
+ }.bind(this))
269
+
270
+ // Init settings dropdown
271
+ var childSettings = [];
272
+ for(var i=this.settings.length-1;i>=0;i--){
273
+ var prevSetting = this.settings[i-1] ? this.settings[i-1] : false;
274
+ var nextSetting = this.settings[i+1] ? this.settings[i+1] : false;
275
+ if(i==0){
276
+ this.fillSelect(this.settings[i])
277
+ }
278
+ else {
279
+ this.settings[i].disabled=true;
280
+ }
281
+ $(this.settings[i]).childSettings = childSettings.clone();
282
+ $(this.settings[i]).prevSetting = prevSetting;
283
+ $(this.settings[i]).nextSetting = nextSetting;
284
+ childSettings.push(this.settings[i]);
285
+ }
286
+
287
+ // Set default values - from config and overwrite them by url values
288
+ if (config.defaultValues) {
289
+ this.values = config.defaultValues;
290
+ }
291
+
292
+ var separatorIndex = window.location.href.indexOf('#');
293
+ if (separatorIndex != -1) {
294
+ var paramsStr = window.location.href.substr(separatorIndex+1);
295
+ var urlValues = paramsStr.toQueryParams();
296
+ if (!this.values) {
297
+ this.values = {};
298
+ }
299
+ for (var i in urlValues) {
300
+ this.values[i] = urlValues[i];
301
+ }
302
+ }
303
+
304
+ this.configureForValues();
305
+ document.observe("dom:loaded", this.configureForValues.bind(this));
306
+ },
307
+
308
+ configureForValues: function () {
309
+ if (this.values) {
310
+ this.settings.each(function(element){
311
+ var attributeId = element.attributeId;
312
+ element.value = (typeof(this.values[attributeId]) == 'undefined')? '' : this.values[attributeId];
313
+ this.configureElement(element);
314
+ }.bind(this));
315
+ }
316
+ },
317
+
318
+ configure: function(event){
319
+ var element = Event.element(event);
320
+ this.configureElement(element);
321
+ },
322
+
323
+ configureElement : function(element) {
324
+ this.reloadOptionLabels(element);
325
+ if(element.value){
326
+ this.state[element.config.id] = element.value;
327
+ if(element.nextSetting){
328
+ element.nextSetting.disabled = false;
329
+ this.fillSelect(element.nextSetting);
330
+ this.resetChildren(element.nextSetting);
331
+ }
332
+ }
333
+ else {
334
+ this.resetChildren(element);
335
+ }
336
+ this.reloadPrice();
337
+ // Calculator.updatePrice();
338
+ },
339
+
340
+ reloadOptionLabels: function(element){
341
+ var selectedPrice;
342
+ if(element.options[element.selectedIndex].config){
343
+ selectedPrice = parseFloat(element.options[element.selectedIndex].config.price)
344
+ }
345
+ else{
346
+ selectedPrice = 0;
347
+ }
348
+ for(var i=0;i<element.options.length;i++){
349
+ if(element.options[i].config){
350
+ element.options[i].text = this.getOptionLabel(element.options[i].config, element.options[i].config.price-selectedPrice);
351
+ }
352
+ }
353
+ },
354
+
355
+ resetChildren : function(element){
356
+ if(element.childSettings) {
357
+ for(var i=0;i<element.childSettings.length;i++){
358
+ element.childSettings[i].selectedIndex = 0;
359
+ element.childSettings[i].disabled = true;
360
+ if(element.config){
361
+ this.state[element.config.id] = false;
362
+ }
363
+ }
364
+ }
365
+ },
366
+
367
+ fillSelect: function(element){
368
+ var attributeId = element.id.replace(/[a-z]*/, '');
369
+ var options = this.getAttributeOptions(attributeId);
370
+ this.clearSelect(element);
371
+ element.options[0] = new Option('', '');
372
+ element.options[0].innerHTML = this.config.chooseText;
373
+
374
+ var prevConfig = false;
375
+ if(element.prevSetting){
376
+ prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];
377
+ }
378
+
379
+ if(options) {
380
+ var index = 1;
381
+ for(var i=0;i<options.length;i++){
382
+ var allowedProducts = [];
383
+ if(prevConfig) {
384
+ for(var j=0;j<options[i].products.length;j++){
385
+ if(prevConfig.config.allowedProducts
386
+ && prevConfig.config.allowedProducts.indexOf(options[i].products[j])>-1){
387
+ allowedProducts.push(options[i].products[j]);
388
+ }
389
+ }
390
+ } else {
391
+ allowedProducts = options[i].products.clone();
392
+ }
393
+
394
+ if(allowedProducts.size()>0){
395
+ options[i].allowedProducts = allowedProducts;
396
+ element.options[index] = new Option(this.getOptionLabel(options[i], options[i].price), options[i].id);
397
+ element.options[index].config = options[i];
398
+ index++;
399
+ }
400
+ }
401
+ }
402
+ },
403
+
404
+ getOptionLabel: function(option, price){
405
+ var price = parseFloat(price);
406
+ if (this.taxConfig.includeTax) {
407
+ var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;
408
+ var excl = price - tax;
409
+ var incl = excl*(1+(this.taxConfig.currentTax/100));
410
+ } else {
411
+ var tax = price * (this.taxConfig.currentTax / 100);
412
+ var excl = price;
413
+ var incl = excl + tax;
414
+ }
415
+
416
+ if (this.taxConfig.showIncludeTax || this.taxConfig.showBothPrices) {
417
+ price = incl;
418
+ } else {
419
+ price = excl;
420
+ }
421
+
422
+ var str = option.label;
423
+ if(price){
424
+ if (this.taxConfig.showBothPrices) {
425
+ str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
426
+ } else {
427
+ str+= ' ' + this.formatPrice(price, true);
428
+ }
429
+ }
430
+ return str;
431
+ },
432
+
433
+ formatPrice: function(price, showSign){
434
+ var str = '';
435
+ price = parseFloat(price);
436
+ if(showSign){
437
+ if(price<0){
438
+ str+= '-';
439
+ price = -price;
440
+ }
441
+ else{
442
+ str+= '+';
443
+ }
444
+ }
445
+
446
+ var roundedPrice = (Math.round(price*100)/100).toString();
447
+
448
+ if (this.prices && this.prices[roundedPrice]) {
449
+ str+= this.prices[roundedPrice];
450
+ }
451
+ else {
452
+ str+= this.priceTemplate.evaluate({price:price.toFixed(2)});
453
+ }
454
+ return str;
455
+ },
456
+
457
+ clearSelect: function(element){
458
+ for(var i=element.options.length-1;i>=0;i--){
459
+ element.remove(i);
460
+ }
461
+ },
462
+
463
+ getAttributeOptions: function(attributeId){
464
+ if(this.config.attributes[attributeId]){
465
+ return this.config.attributes[attributeId].options;
466
+ }
467
+ },
468
+
469
+ reloadPrice: function(){
470
+ var price = 0;
471
+ var oldPrice = 0;
472
+ for(var i=this.settings.length-1;i>=0;i--){
473
+ var selected = this.settings[i].options[this.settings[i].selectedIndex];
474
+ if(selected.config){
475
+ price += parseFloat(selected.config.price);
476
+ oldPrice += parseFloat(selected.config.oldPrice);
477
+ }
478
+ }
479
+
480
+ optionsPrice.changePrice('config', {'price': price, 'oldPrice': oldPrice});
481
+ optionsPrice.reload();
482
+
483
+ return price;
484
+
485
+ if($('product-price-'+this.config.productId)){
486
+ $('product-price-'+this.config.productId).innerHTML = price;
487
+ }
488
+ this.reloadOldPrice();
489
+ },
490
+
491
+ reloadOldPrice: function(){
492
+ if ($('old-price-'+this.config.productId)) {
493
+
494
+ var price = parseFloat(this.config.oldPrice);
495
+ for(var i=this.settings.length-1;i>=0;i--){
496
+ var selected = this.settings[i].options[this.settings[i].selectedIndex];
497
+ if(selected.config){
498
+ var parsedOldPrice = parseFloat(selected.config.oldPrice);
499
+ price += isNaN(parsedOldPrice) ? 0 : parsedOldPrice;
500
+ }
501
+ }
502
+ if (price < 0)
503
+ price = 0;
504
+ price = this.formatPrice(price);
505
+
506
+ if($('old-price-'+this.config.productId)){
507
+ $('old-price-'+this.config.productId).innerHTML = price;
508
+ }
509
+
510
+ }
511
+ }
512
+ }
513
+
514
+
515
+ /**************************** SUPER PRODUCTS ********************************/
516
+
517
+ Product.Super = {};
518
+ Product.Super.Configurable = Class.create();
519
+
520
+ Product.Super.Configurable.prototype = {
521
+ initialize: function(container, observeCss, updateUrl, updatePriceUrl, priceContainerId) {
522
+ this.container = $(container);
523
+ this.observeCss = observeCss;
524
+ this.updateUrl = updateUrl;
525
+ this.updatePriceUrl = updatePriceUrl;
526
+ this.priceContainerId = priceContainerId;
527
+ this.registerObservers();
528
+ },
529
+ registerObservers: function() {
530
+ var elements = this.container.getElementsByClassName(this.observeCss);
531
+ elements.each(function(element){
532
+ Event.observe(element, 'change', this.update.bindAsEventListener(this));
533
+ }.bind(this));
534
+ return this;
535
+ },
536
+ update: function(event) {
537
+ var elements = this.container.getElementsByClassName(this.observeCss);
538
+ var parameters = Form.serializeElements(elements, true);
539
+
540
+ new Ajax.Updater(this.container, this.updateUrl + '?ajax=1', {
541
+ parameters:parameters,
542
+ onComplete:this.registerObservers.bind(this)
543
+ });
544
+ var priceContainer = $(this.priceContainerId);
545
+ if(priceContainer) {
546
+ new Ajax.Updater(priceContainer, this.updatePriceUrl + '?ajax=1', {
547
+ parameters:parameters
548
+ });
549
+ }
550
+ }
551
+ }
552
+
553
+ /**************************** PRICE RELOADER ********************************/
554
+ Product.OptionsPrice = Class.create();
555
+ Product.OptionsPrice.prototype = {
556
+ initialize: function(config) {
557
+ this.productId = config.productId;
558
+ this.priceFormat = config.priceFormat;
559
+ this.includeTax = config.includeTax;
560
+ this.defaultTax = config.defaultTax;
561
+ this.currentTax = config.currentTax;
562
+ this.productPrice = config.productPrice;
563
+ this.showIncludeTax = config.showIncludeTax;
564
+ this.showBothPrices = config.showBothPrices;
565
+ this.productOldPrice = config.productOldPrice;
566
+ this.priceInclTax = config.priceInclTax;
567
+ this.priceExclTax = config.priceExclTax;
568
+ this.skipCalculate = config.skipCalculate; /** @deprecated after 1.5.1.0 */
569
+ this.duplicateIdSuffix = config.idSuffix;
570
+ this.specialTaxPrice = config.specialTaxPrice;
571
+ this.tierPrices = config.tierPrices;
572
+ this.tierPricesInclTax = config.tierPricesInclTax;
573
+
574
+ this.oldPlusDisposition = config.oldPlusDisposition;
575
+ this.plusDisposition = config.plusDisposition;
576
+ this.plusDispositionTax = config.plusDispositionTax;
577
+
578
+ this.oldMinusDisposition = config.oldMinusDisposition;
579
+ this.minusDisposition = config.minusDisposition;
580
+
581
+ this.exclDisposition = config.exclDisposition;
582
+
583
+ this.optionPrices = {};
584
+ this.customPrices = {};
585
+ this.containers = {};
586
+
587
+ this.displayZeroPrice = true;
588
+
589
+ this.initPrices();
590
+ },
591
+
592
+ setDuplicateIdSuffix: function(idSuffix) {
593
+ this.duplicateIdSuffix = idSuffix;
594
+ },
595
+
596
+ initPrices: function() {
597
+ this.containers[0] = 'product-price-' + this.productId;
598
+ this.containers[1] = 'bundle-price-' + this.productId;
599
+ this.containers[2] = 'price-including-tax-' + this.productId;
600
+ this.containers[3] = 'price-excluding-tax-' + this.productId;
601
+ this.containers[4] = 'old-price-' + this.productId;
602
+ },
603
+
604
+ changePrice: function(key, price) {
605
+ this.optionPrices[key] = price;
606
+ },
607
+
608
+ addCustomPrices: function(key, price) {
609
+ $("carebyzincCnt").hide();
610
+ $('carebyzincCnt').update('');
611
+ this.customPrices[key] = price;
612
+ },
613
+ getOptionPrices: function() {
614
+ var price = 0;
615
+ var nonTaxable = 0;
616
+ var oldPrice = 0;
617
+ var priceInclTax = 0;
618
+ var currentTax = this.currentTax;
619
+ $H(this.optionPrices).each(function(pair) {
620
+ if ('undefined' != typeof(pair.value.price) && 'undefined' != typeof(pair.value.oldPrice)) {
621
+ price += parseFloat(pair.value.price);
622
+ oldPrice += parseFloat(pair.value.oldPrice);
623
+ } else if (pair.key == 'nontaxable') {
624
+ nonTaxable = pair.value;
625
+ } else if (pair.key == 'priceInclTax') {
626
+ priceInclTax += pair.value;
627
+ } else if (pair.key == 'optionsPriceInclTax') {
628
+ priceInclTax += pair.value * (100 + currentTax) / 100;
629
+ } else {
630
+ price += parseFloat(pair.value);
631
+ oldPrice += parseFloat(pair.value);
632
+ }
633
+ });
634
+ var result = [price, nonTaxable, oldPrice, priceInclTax];
635
+ return result;
636
+ },
637
+
638
+ reload: function() {
639
+ var price;
640
+ var formattedPrice;
641
+ var optionPrices = this.getOptionPrices();
642
+ var nonTaxable = optionPrices[1];
643
+ var optionOldPrice = optionPrices[2];
644
+ var priceInclTax = optionPrices[3];
645
+ optionPrices = optionPrices[0];
646
+
647
+ $H(this.containers).each(function(pair) {
648
+ var _productPrice;
649
+ var _plusDisposition;
650
+ var _minusDisposition;
651
+ var _priceInclTax;
652
+ if ($(pair.value)) {
653
+ if (pair.value == 'old-price-'+this.productId && this.productOldPrice != this.productPrice) {
654
+ _productPrice = this.productOldPrice;
655
+ _plusDisposition = this.oldPlusDisposition;
656
+ _minusDisposition = this.oldMinusDisposition;
657
+ } else {
658
+ _productPrice = this.productPrice;
659
+ _plusDisposition = this.plusDisposition;
660
+ _minusDisposition = this.minusDisposition;
661
+ }
662
+ _priceInclTax = priceInclTax;
663
+
664
+ if (pair.value == 'old-price-'+this.productId && optionOldPrice !== undefined) {
665
+ price = optionOldPrice+parseFloat(_productPrice);
666
+ } else if (this.specialTaxPrice == 'true' && this.priceInclTax !== undefined && this.priceExclTax !== undefined) {
667
+ price = optionPrices+parseFloat(this.priceExclTax);
668
+ _priceInclTax += this.priceInclTax;
669
+ } else {
670
+ price = optionPrices+parseFloat(_productPrice);
671
+ _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
672
+ }
673
+
674
+ if (this.specialTaxPrice == 'true') {
675
+ var excl = price;
676
+ var incl = _priceInclTax;
677
+ } else if (this.includeTax == 'true') {
678
+ // tax = tax included into product price by admin
679
+ var tax = price / (100 + this.defaultTax) * this.defaultTax;
680
+ var excl = price - tax;
681
+ var incl = excl*(1+(this.currentTax/100));
682
+ } else {
683
+ var tax = price * (this.currentTax / 100);
684
+ var excl = price;
685
+ var incl = excl + tax;
686
+ }
687
+
688
+ var subPrice = 0;
689
+ var subPriceincludeTax = 0;
690
+ Object.values(this.customPrices).each(function(el){
691
+ if (el.excludeTax && el.includeTax) {
692
+ subPrice += parseFloat(el.excludeTax);
693
+ subPriceincludeTax += parseFloat(el.includeTax);
694
+ } else {
695
+ subPrice += parseFloat(el.price);
696
+ subPriceincludeTax += parseFloat(el.price);
697
+ }
698
+ });
699
+ excl += subPrice;
700
+ incl += subPriceincludeTax;
701
+
702
+ if (typeof this.exclDisposition == 'undefined') {
703
+ excl += parseFloat(_plusDisposition);
704
+ }
705
+
706
+ incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax);
707
+ excl -= parseFloat(_minusDisposition);
708
+ incl -= parseFloat(_minusDisposition);
709
+
710
+ //adding nontaxlable part of options
711
+ excl += parseFloat(nonTaxable);
712
+ incl += parseFloat(nonTaxable);
713
+
714
+ if (pair.value == 'price-including-tax-'+this.productId) {
715
+ price = incl;
716
+ } else if (pair.value == 'price-excluding-tax-'+this.productId) {
717
+ price = excl;
718
+ } else if (pair.value == 'old-price-'+this.productId) {
719
+ if (this.showIncludeTax || this.showBothPrices) {
720
+ price = incl;
721
+ } else {
722
+ price = excl;
723
+ }
724
+ } else {
725
+ if (this.showIncludeTax) {
726
+ price = incl;
727
+ } else {
728
+ price = excl;
729
+ }
730
+ }
731
+
732
+ if (price < 0) price = 0;
733
+
734
+ if (price > 0 || this.displayZeroPrice) {
735
+ formattedPrice = this.formatPrice(price);
736
+ } else {
737
+ formattedPrice = '';
738
+ }
739
+
740
+ if ($(pair.value).select('.price')[0]) {
741
+ $(pair.value).select('.price')[0].innerHTML = formattedPrice;
742
+ if ($(pair.value+this.duplicateIdSuffix) && $(pair.value+this.duplicateIdSuffix).select('.price')[0]) {
743
+ $(pair.value+this.duplicateIdSuffix).select('.price')[0].innerHTML = formattedPrice;
744
+ }
745
+ } else {
746
+ $(pair.value).innerHTML = formattedPrice;
747
+ if ($(pair.value+this.duplicateIdSuffix)) {
748
+ $(pair.value+this.duplicateIdSuffix).innerHTML = formattedPrice;
749
+ }
750
+ }
751
+ };
752
+ }.bind(this));
753
+
754
+ if (typeof(skipTierPricePercentUpdate) === "undefined" && typeof(this.tierPrices) !== "undefined") {
755
+ for (var i = 0; i < this.tierPrices.length; i++) {
756
+ $$('.benefit').each(function(el) {
757
+ var parsePrice = function(html) {
758
+ var format = this.priceFormat;
759
+ var decimalSymbol = format.decimalSymbol === undefined ? "," : format.decimalSymbol;
760
+ var regexStr = '[^0-9-' + decimalSymbol + ']';
761
+ //remove all characters except number and decimal symbol
762
+ html = html.replace(new RegExp(regexStr, 'g'), '');
763
+ html = html.replace(decimalSymbol, '.');
764
+ return parseFloat(html);
765
+ }.bind(this);
766
+
767
+ var updateTierPriceInfo = function(priceEl, tierPriceDiff, tierPriceEl, benefitEl) {
768
+ if (typeof(tierPriceEl) === "undefined") {
769
+ //tierPrice is not shown, e.g., MAP, no need to update the tier price info
770
+ return;
771
+ }
772
+ var price = parsePrice(priceEl.innerHTML);
773
+ var tierPrice = price + tierPriceDiff;
774
+
775
+ tierPriceEl.innerHTML = this.formatPrice(tierPrice);
776
+
777
+ var $percent = Selector.findChildElements(benefitEl, ['.percent.tier-' + i]);
778
+ $percent.each(function(el) {
779
+ el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice));
780
+ });
781
+ }.bind(this);
782
+
783
+ var tierPriceElArray = $$('.tier-price.tier-' + i + ' .price');
784
+ if (this.showBothPrices) {
785
+ var containerExclTax = $(this.containers[3]);
786
+ var tierPriceExclTaxDiff = this.tierPrices[i];
787
+ var tierPriceExclTaxEl = tierPriceElArray[0];
788
+ updateTierPriceInfo(containerExclTax, tierPriceExclTaxDiff, tierPriceExclTaxEl, el);
789
+ var containerInclTax = $(this.containers[2]);
790
+ var tierPriceInclTaxDiff = this.tierPricesInclTax[i];
791
+ var tierPriceInclTaxEl = tierPriceElArray[1];
792
+ updateTierPriceInfo(containerInclTax, tierPriceInclTaxDiff, tierPriceInclTaxEl, el);
793
+ } else if (this.showIncludeTax) {
794
+ var container = $(this.containers[0]);
795
+ var tierPriceInclTaxDiff = this.tierPricesInclTax[i];
796
+ var tierPriceInclTaxEl = tierPriceElArray[0];
797
+ updateTierPriceInfo(container, tierPriceInclTaxDiff, tierPriceInclTaxEl, el);
798
+ } else {
799
+ var container = $(this.containers[0]);
800
+ var tierPriceExclTaxDiff = this.tierPrices[i];
801
+ var tierPriceExclTaxEl = tierPriceElArray[0];
802
+ updateTierPriceInfo(container, tierPriceExclTaxDiff, tierPriceExclTaxEl, el);
803
+ }
804
+ }, this);
805
+ }
806
+ }
807
+
808
+ },
809
+ formatPrice: function(price) {
810
+ return formatCurrency(price, this.priceFormat);
811
+ }
812
+ }
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>zinc</name>
4
+ <version>1.0.3</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Zinc is an application to allow merchants cross sell warranties and product protections online without ever have to worry about the technology and contract work behind them.</summary>
10
+ <description>Zinc allows merchants to display warranty and product protection quotes next to the product being sold. Customers can add those policies to their purchases at point of sale, and Zinc follow up to complete the sale. Merchants earn additional margin while Zinc takes care of all the heavy lifting to execute the contract and handle the claims.</description>
11
+ <notes>Zinc allows merchants to display warranty and product protection quotes next to the product being sold. Customers can add those policies to their purchases at point of sale, and Zinc follow up to complete the sale. Merchants earn additional margin while Zinc takes care of all the heavy lifting to execute the contract and handle the claims.</notes>
12
+ <authors><author><name>ZincPlatform</name><user>ZincPlatform</user><email>sam.li@zincplatform.com</email></author></authors>
13
+ <date>2016-08-18</date>
14
+ <time>04:11:02</time>
15
+ <contents><target name="magelocal"><dir name="Zinc"><dir name="Carebyzinc"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Grid.php" hash="a1a97f2ea591ad821ea54a77f5c4cc28"/><dir name="Renderer"><file name="Category.php" hash="35314c66e1c37f7ebb2ce2a5257e7d88"/></dir></dir></dir><dir name="Order"><file name="Grid.php" hash="e320db07d090731de9e0cc98153d2473"/></dir><file name="Order.php" hash="8ad16b270a3d721125f598582d59065b"/><dir name="Product"><dir name="Edit"><file name="Form.php" hash="676122e90b68bfec48e7d8c32b330ea8"/><dir name="Tab"><file name="Form.php" hash="aac4c1be4ef687610012e6aad6d89fb4"/></dir><file name="Tabs.php" hash="db637798104873a38241fe683f511e27"/></dir><file name="Edit.php" hash="504cc82857251201ff83bd10544d5927"/><file name="Grid.php" hash="4224f8f3a53a9fe014e20d087bfb26c9"/></dir><file name="Product.php" hash="e603838ed67849456c5230395d081e1b"/><dir name="System"><dir name="Config"><file name="Tokenvalidate.php" hash="24e6f31db4da9d1bbb1b8380b42d1f05"/></dir></dir></dir><file name="Carebyzinc.php" hash="e7cab3fcb5c8792677a7db8d39603d6a"/></dir><dir name="Helper"><file name="Data.php" hash="7bc4f9b6dd31133114e441559f08d3bc"/></dir><dir name="Model"><file name="Carebyzinc.php" hash="021aa626104faa52421d46e1fe8e5591"/><dir name="Checkout"><file name="Cart.php" hash="afae7a9eb76266e60a825880db280a9e"/></dir><dir name="Entity"><file name="Category.php" hash="cfca0b90e178b2f695236925d4318df1"/><file name="Subcategory.php" hash="3dc00a09a3caee211fed08ebeb4e9c5e"/></dir><dir name="Mysql4"><dir name="Order"><file name="Collection.php" hash="73eb61cc74cfdd568f1644c664a25ed6"/></dir><file name="Order.php" hash="fdc62f0551b1714f7c0e7fec8e87495c"/></dir><file name="Observer.php" hash="00a0f1b4ac0ad91956622ed19558d86d"/><file name="Order.php" hash="1f82b148059a74038e2d5189a0c8fdaf"/><dir name="Sales"><file name="Quote.php" hash="65cb7a95b7c01e1ee259e9ab38e73ece"/></dir><dir name="System"><dir name="Config"><file name="Source.php" hash="2e29cb2b89d849ca20bcfde1648c6dd9"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CarebyzincController.php" hash="c9825829c818b62124fad08a6eafe9d6"/><file name="OrderController.php" hash="abb2466958fa6f7b9ed13b5675e06f5c"/><file name="ProductController.php" hash="4175dbf2b87dda0757080060d9916a89"/></dir><file name="CartController.php" hash="24758faa94cbd54c9646085142332483"/><file name="IndexController.php" hash="83fb9491996678544874cadc6282c5d7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="06cfc2ccc3fe727bee732ff3dd6df96f"/><file name="config.xml" hash="5e330ca3b268930f0537c0f4cee48971"/><file name="system.xml" hash="c7f7abfbec8e977642d9bb875a73d16e"/></dir><dir name="sql"><dir name="carebyzinc_setup"><file name="mysql4-install-0.1.0.php" hash="c342593327c1d0428217b315dcdced1c"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="108da13421767fab0083f7c4cc9b16e2"/><file name="mysql4-upgrade-0.2.0-1.0.0.php" hash="10ebb8695adeba50e281b39ad0cf20ed"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="2ba025c3d3405e3be85c4940f82c85b7"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="fd29cdd9a47b882ecea7de944d8e4d38"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="ac78f6811e781b4a03233188918658d3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zinc_Carebyzinc.xml" hash="cda422c48c3f76e04d5dd609b1da33bf"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="carebyzinc"><dir name="order"><dir name="creditmemo"><dir name="create"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="a4895ad08ec75605c3dc6678647762ca"/></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="20c580806b7240e3d19cc0a7dce46142"/></dir></dir></dir></dir><dir name="invoice"><dir name="create"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="77e6e5fdb4be945178d09c1815ab14b2"/></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="a984189e5dd627aa3497458aea7c9cb6"/></dir></dir></dir></dir><dir name="shipment"><dir name="create"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="a3f4b3b21862422e0675a3411df545a7"/></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="e9f0d61dc484f8b3179608f941bbc827"/></dir></dir></dir></dir><dir name="view"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="ba480a97ff97df6fae56931a5d878e26"/></dir></dir></dir></dir><dir name="system"><file name="tokenvalidate.phtml" hash="c8f6847678e6327cc168d19bb1f889f9"/></dir></dir></dir><dir name="layout"><file name="zinc_carebyzinc.xml" hash="755c6fa9b8ebea40cf085cb4781b735a"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="carebyzinc"><file name="carebyzinc.phtml" hash="93e7be82387291f24aaeb91dd16bbea0"/><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="a4c5b53ccaafff95a0d4b7fb157417a5"/><file name="default.phtml-10-08-2016" hash="6d30023d9d5d10122bb19504adb8a78d"/></dir><dir name="minicart"><file name="default.phtml" hash="059d0ac79a1c4ac4b668882e5d5e189a"/></dir></dir><file name="cart.phtml" hash="f3b231f03951e0e18adfecc7ad563c31"/><dir name="multishipping"><dir name="item"><file name="default.phtml" hash="302298bf393f3c0d94b26ea7ee39096d"/></dir></dir><dir name="onepage"><dir name="review"><file name="item.phtml" hash="d5448146086a1f01e9ce193575a481bf"/></dir></dir></dir><dir name="email"><dir name="order"><dir name="items"><dir name="creditmemo"><file name="default.phtml" hash="05f2240b619bccd7b126b8140174749b"/></dir><dir name="invoice"><file name="default.phtml" hash="f709eb917fd5de6a82ff0a04a4413459"/></dir><dir name="order"><file name="default.phtml" hash="bbb4a160b0ae393d2d2e7ef81705463c"/></dir><dir name="shipment"><file name="default.phtml" hash="806df424ce07c15195bfd5fc4b8da192"/></dir></dir></dir></dir><dir name="options"><file name="cart.phtml" hash="0c847ef443520ffdad30c10424a5ce37"/><file name="default.phtml" hash="f9807435fc04e76610d265a0e5da5f11"/></dir><dir name="sales"><dir name="order"><dir name="creditmemo"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="aa9efe3d2eac3422ea96c4a5e54c738d"/></dir></dir></dir><dir name="invoice"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="1ae13d107b76d113360afe8526ecc286"/></dir></dir></dir><dir name="items"><dir name="renderer"><file name="default.phtml" hash="ba81982f366ea2d222c2615a0e90c3e4"/></dir></dir><dir name="shipment"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="e8ac8a72cb4a4e9b5d5fc75b4d542225"/></dir></dir></dir></dir></dir></dir></dir><dir name="layout"><file name="zinc_carebyzinc.xml" hash="416ecb557e7ccb03fab996dcfc216d26"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="carebyzinc"><dir name="css"><file name="carebyzinc.css" hash="61a00a3992f44bd396cc71dfaac0fa8d"/><file name="colorbox.css" hash="4b7379294ea68f88b0bba06cd803a646"/><dir name="images"><file name="border.png" hash="b593eef877678cd14706323d199e047d"/><file name="cancel.png" hash="7d54d20abee3ff4e694a98798f261d09"/><file name="care-preloader.gif" hash="eba7ca3ef216ece9ab9974f0cc524536"/><file name="controls.png" hash="05ad6ec2cbc17a7f3d1b1aac6dbe770d"/><file name="loading.gif" hash="f1d7268ba36b264f8b33b5b2bf0f108c"/><file name="loading_background.png" hash="7649e6a7c32b6d29ce63255a30b7405a"/><file name="overlay.png" hash="8918e1f6fbaae9e65880f3eff6fa3713"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="carebyzinc"><file name="jquery.colorbox.js" hash="931988f42363a4824812885ffc27d99e"/><file name="product.js" hash="007f9365ae78449497daa03e83169fd3"/></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>
skin/frontend/base/default/carebyzinc/css/carebyzinc.css ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Zinc_Carebyzinc v1.0.0 (http://www.zincplatform.com)
3
+ * Copyright 2016-2017
4
+ *
5
+ */
6
+ .product-box { margin-bottom: 20px; }
7
+ .product-container { border: 1px solid #efefef; border-radius: 2px;display: none; }
8
+ .checkout-cart-index .product-container { border-width: 0; }
9
+ .checkout-cart-index .product-box { border: 1px solid #efefef; }
10
+ .product-title { font-size: 16px;text-transform: capitalize; /*border-bottom: 1px solid #efefef;*/ padding: 10px 5px 0; margin-bottom: 10px;display: inline-block;}
11
+ .product-wrap { border: 1px solid #ccc;padding: 10px;border-radius: 2px; display: none; }
12
+ .product-list { list-style-type: none;padding-left: 0; margin: 0;}
13
+ .bx-l,.bx-r { float: left; position: relative; }
14
+ .bx-l { width: 25px; }
15
+ .bx-r { width: -webkit-calc(100% - 25px); width: -moz-calc(100% - 25px); width: calc(100% - 25px); }
16
+ .product-list .input input[type=radio] ,.squared input[type=radio] { visibility: hidden; }
17
+ .product-list li { color: #535353;border-bottom: 1px solid #f7f7f7;padding: 5px 5px;transition: all .2s; }
18
+ .product-list li:last-child { border-bottom: 0; }
19
+ .product-list li:hover{ background: #f7f7f7; }
20
+ .product-list li:after { clear: both; content: '.'; display: block; visibility: hidden; height: 0; }
21
+ .product-list li .p-name { font-size: 13px;text-transform: capitalize;margin: 0; display: inline-block;}
22
+ .product-list li .p-price,.care-price { font-size: 15px;color: #007ead;font-weight: 600; display: inline-block;/* margin: 2px 0; margin-left: 15px;*/}
23
+ .care-price { /*color: #636363;*/ color:#007ead; }
24
+ .product-list li .p-provider,.care-prov { text-transform: lowercase; font-size: 11px;font-weight: normal; font-style: italic;}
25
+ .product-list li .p-provider span ,.care-prov span { text-transform: uppercase;position: relative; font-weight: 600; }
26
+ .product-list li .p-provider span:after { content: ":";position: relative; margin: 0 5px; font-weight: bold;}
27
+ .squared { width: 20px; margin-right: 10px; position: relative; }
28
+ .squared label {
29
+ cursor: pointer;
30
+ position: absolute;
31
+ width: 15px;
32
+ height: 15px;
33
+ top: 3px;
34
+ left: 0;
35
+ border-radius: 15px;
36
+ /*-webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
37
+ -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);
38
+ box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);*/
39
+ background: -webkit-linear-gradient(top, #0291c6 0%, #006d95 100%);
40
+ background: -moz-linear-gradient(top, #0291c6 0%, #006d95 100%);
41
+ background: -o-linear-gradient(top, #0291c6 0%, #006d95 100%);
42
+ background: -ms-linear-gradient(top, #0291c6 0%, #006d95 100%);
43
+ background: linear-gradient(top, #0291c6 0%, #006d95 100%);
44
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d',GradientType=0 );
45
+ }
46
+ .squared label:after {
47
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
48
+ filter: alpha(opacity=0);
49
+ opacity: 0;
50
+ content: '';
51
+ position: absolute;
52
+ width: 7px;
53
+ height: 4px;
54
+ background: transparent;
55
+ top: 5px;
56
+ left: 4px;
57
+ border: 2px solid #fcfff4;
58
+ border-top: none;
59
+ border-right: none;
60
+ -webkit-transform: rotate(-45deg);
61
+ -moz-transform: rotate(-45deg);
62
+ -o-transform: rotate(-45deg);
63
+ -ms-transform: rotate(-45deg);
64
+ transform: rotate(-45deg);
65
+ }
66
+ .squared label:hover::after {
67
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
68
+ filter: alpha(opacity=30);
69
+ opacity: 0.3;
70
+ }
71
+ .squared input[type=radio]:checked + label:after {
72
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
73
+ filter: alpha(opacity=100);
74
+ opacity: 1;
75
+ }
76
+ .btn-zinc { background:#037daa;border:none;outline:none;color:#fff;border-radius:2px;padding:5px 10px;font-size:14px;margin-top: 0px;cursor: pointer; position: relative;}
77
+ .btn-zinc:hover,.btn-zinc:active { background: #017099; }
78
+ .btn-zinc.selected { background: #868686; }
79
+
80
+
81
+ .product-container .button { margin: auto;color: #fff !important; margin-bottom: 5px;background: #3399cc !important; margin-top: 5px; border-radius: 2px; padding: 7px 20px !important; font-size: 15px;margin-left: 30px;}
82
+ .remove_warranty { background: url(images/cancel.png) no-repeat; display: inline-block; width: 13px; height: 13px; background-size: 100%; }
83
+ .product-cart-careby .warranty_desc { font-weight: bolder;display: inline-block; /*color: #3399cc;*/}
84
+
85
+ .care-loader { background: rgba(255, 255, 255, 0.8) url(images/care-preloader.gif) no-repeat center center; height: 100%; width: 100%; display:none; background-size: 20px; position: absolute; top: 0; left: 0; }
86
+ #care-loader.show { display: inline-block; }
87
+ /*#care-loader.hide { display: inline-block; }*/
88
+ /*.care-loader { display: none; }*/
89
+ .product-cart-careby { padding-left: 15px; }
90
+
91
+
92
+ @media only screen and (max-width: 599px) {
93
+ .product-list li .p-price .price, .care-price .price { font-weight: 600 !important; }
94
+ .product-list li .p-price, .care-price { display: block;margin-left: 0; }
95
+ }
96
+ .desc_popup{
97
+ margin: 12px 10px;
98
+ padding-top: 7px;
99
+ display:none;
100
+ }
101
+ .product-list li .p-price,.care-price { margin: 0 7px 0 2px;}
skin/frontend/base/default/carebyzinc/css/colorbox.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Colorbox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
6
+ #cboxWrapper {max-width:none;}
7
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
8
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9
+ #cboxContent{position:relative;}
10
+ #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11
+ #cboxTitle{margin:0;}
12
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14
+ .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15
+ .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17
+
18
+ /*
19
+ User Style:
20
+ Change the following styles to modify the appearance of Colorbox. They are
21
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
22
+ */
23
+ #cboxOverlay{background:url(images/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);}
24
+ #colorbox{outline:0;}
25
+ #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
26
+ #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
27
+ #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
28
+ #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
29
+ #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
30
+ #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
31
+ #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
32
+ #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
33
+ #cboxContent{background:#fff; overflow:hidden;}
34
+ .cboxIframe{background:#fff;}
35
+ #cboxError{padding:50px; border:1px solid #ccc;}
36
+ #cboxLoadedContent{margin-bottom:28px;}
37
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
38
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
39
+ #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
40
+ #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
41
+
42
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
43
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
44
+
45
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
46
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
47
+
48
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
49
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
50
+ #cboxPrevious:hover{background-position:-75px -25px;}
51
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
52
+ #cboxNext:hover{background-position:-50px -25px;}
53
+ #cboxClose{position:absolute; top:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
54
+ #cboxClose:hover{background-position:-25px -25px;}
55
+
56
+ /*
57
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
58
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
59
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
60
+ */
61
+ .cboxIE #cboxTopLeft,
62
+ .cboxIE #cboxTopCenter,
63
+ .cboxIE #cboxTopRight,
64
+ .cboxIE #cboxBottomLeft,
65
+ .cboxIE #cboxBottomCenter,
66
+ .cboxIE #cboxBottomRight,
67
+ .cboxIE #cboxMiddleLeft,
68
+ .cboxIE #cboxMiddleRight {
69
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
70
+ }
71
+
skin/frontend/base/default/carebyzinc/css/images/border.png ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/cancel.png ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/care-preloader.gif ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/controls.png ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/loading.gif ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/loading_background.png ADDED
Binary file
skin/frontend/base/default/carebyzinc/css/images/overlay.png ADDED
Binary file