PrescriptionPayment - Version 0.0.1

Version Notes

Stable version. Please check https://github.com/codedge/prescriptionpayment for updates

Download this release

Release Info

Developer Holger Lösken
Extension PrescriptionPayment
Version 0.0.1
Comparing to
See all releases


Version 0.0.1

app/design/adminhtml/default/default/template/prescriptionpayment/notifications.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @package Ce_PrescriptionPayment
16
+ * @copyright Copyright (c) 2013 codedge (http://www.codedge.de)
17
+ * @author Holger Lösken <post@codedge.de>
18
+ *
19
+ * @see Ce_PrescriptionPayment_Block_Adminhtml_Notifications
20
+ */
21
+ ?>
22
+ <?php if ($message = $this->getMessage()) : ?>
23
+ <div class="notification-global">
24
+ <span>
25
+ <strong class="label">
26
+ <?php echo $this->__('Prescription Payment')?>:
27
+ </strong>
28
+ <?php echo $message ?>!
29
+ </span>
30
+ </div>
31
+ <?php endif; ?>
app/design/frontend/default/default/template/prescriptionpayment/choose_payment.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @package Ce_PrescriptionPayment
16
+ * @copyright Copyright (c) 2013 codedge (http://www.codedge.de)
17
+ * @author Holger Lösken <post@codedge.de>
18
+ */
19
+
20
+ /**
21
+ * Select if you pay by prescription
22
+ *
23
+ * @see Ce_PrescriptionPayment_Block_Items
24
+ */
25
+ ?>
26
+
27
+ <div class="block">
28
+ <div class="block-title">
29
+ <h3>
30
+ <strong>
31
+ <?php echo $this->__('Do you want to pay by prescription?'); ?>
32
+ </strong>
33
+ </h3>
34
+ </div>
35
+ <div class="block-content">
36
+ <p class="empty">
37
+ <input type="radio" name="prescriptionpayment_choose_payment" value="0" <?php if(!$this->payByPrescription()){echo 'checked="checked"';} ?>>
38
+ <?php echo $this->__('No, I don\'t want to pay by prescription'); ?>
39
+ <br />
40
+ <input type="radio" name="prescriptionpayment_choose_payment" value="1" <?php if($this->payByPrescription()){echo 'checked="checked"';} ?>>
41
+ <?php echo $this->__('Yes, I want to pay by prescription'); ?>
42
+ <input type="hidden" name="proceedtocheckout" value="1"/>
43
+ </p>
44
+ </div>
45
+ </div>
app/design/frontend/default/default/template/prescriptionpayment/item/default.phtml ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
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
+ <tr>
33
+ <td><?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?></a><?php endif;?></td>
34
+ <td>
35
+ <h2 class="product-name">
36
+ <?php if ($this->hasProductUrl()):?>
37
+ <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->htmlEscape($this->getProductName()) ?></a>
38
+ <?php else: ?>
39
+ <?php echo $this->htmlEscape($this->getProductName()) ?>
40
+ <?php endif; ?>
41
+ </h2>
42
+ <?php if ($_options = $this->getOptionList()):?>
43
+ <dl class="item-options">
44
+ <?php foreach ($_options as $_option) : ?>
45
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
46
+ <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
47
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
48
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
49
+ <div class="truncated_full_value">
50
+ <dl class="item-options">
51
+ <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
52
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
53
+ </dl>
54
+ </div>
55
+ <?php endif; ?>
56
+ </dd>
57
+ <?php endforeach; ?>
58
+ </dl>
59
+ <?php endif;?>
60
+ <?php if ($messages = $this->getMessages()): ?>
61
+ <?php foreach ($messages as $message): ?>
62
+ <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $this->escapeHtml($message['text']) ?></p>
63
+ <?php endforeach; ?>
64
+ <?php endif; ?>
65
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
66
+ <?php if ($addInfoBlock): ?>
67
+ <?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
68
+ <?php endif;?>
69
+ </td>
70
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
71
+ <td class="a-center">
72
+ <?php if ($isVisibleProduct): ?>
73
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move'); ?></a>
74
+ <?php endif ?>
75
+ </td>
76
+ <?php endif ?>
77
+
78
+ <?php if ($canApplyMsrp): ?>
79
+ <td class="a-right"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
80
+ <span class="cart-price">
81
+ <span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
82
+ <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
83
+ <a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
84
+ <script type="text/javascript">
85
+ Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What's this?") ?>");
86
+ </script>
87
+ </span>
88
+ </td>
89
+ <?php else: ?>
90
+
91
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
92
+ <td class="a-right">
93
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
94
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
95
+ <?php else: ?>
96
+ <span class="cart-price">
97
+ <?php endif; ?>
98
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
99
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
100
+ <?php else: ?>
101
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
102
+ <?php endif; ?>
103
+
104
+ </span>
105
+
106
+
107
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
108
+
109
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
110
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
111
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
112
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
113
+ <?php endforeach; ?>
114
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
115
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
116
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
117
+ <?php endforeach; ?>
118
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
119
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
120
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
121
+ <?php endforeach; ?>
122
+ <?php endif; ?>
123
+ </div>
124
+
125
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
126
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
127
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
128
+ </div>
129
+ <?php endif; ?>
130
+ <?php endif; ?>
131
+ </td>
132
+ <?php endif; ?>
133
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
134
+ <td>
135
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
137
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
138
+ <?php else: ?>
139
+ <span class="cart-price">
140
+ <?php endif; ?>
141
+
142
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
143
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
144
+ <?php else: ?>
145
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
146
+ <?php endif; ?>
147
+
148
+ </span>
149
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
150
+
151
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
152
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
153
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
154
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
155
+ <?php endforeach; ?>
156
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
157
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
158
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
159
+ <?php endforeach; ?>
160
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
161
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
162
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
163
+ <?php endforeach; ?>
164
+ <?php endif; ?>
165
+ </div>
166
+
167
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
168
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
169
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
170
+ </div>
171
+ <?php endif; ?>
172
+ <?php endif; ?>
173
+ </td>
174
+ <?php endif; ?>
175
+ <?php endif; ?>
176
+ <td class="a-center">
177
+ <span name="cart[<?php echo $_item->getId() ?>][qty]" class="input-text qty"><?php echo $this->getQty() ?></span>
178
+ </td>
179
+ <?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
180
+ <td class="a-right">
181
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
182
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
183
+ <?php else: ?>
184
+ <span class="cart-price">
185
+ <?php endif; ?>
186
+
187
+ <?php if ($canApplyMsrp): ?>
188
+ <span class="cart-msrp-subtotal">--</span>
189
+ <?php else: ?>
190
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
191
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
192
+ <?php else: ?>
193
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
194
+ <?php endif; ?>
195
+ <?php endif; ?>
196
+
197
+ </span>
198
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
199
+
200
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
201
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
202
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
203
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
204
+ <?php endforeach; ?>
205
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
206
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
207
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
208
+ <?php endforeach; ?>
209
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
210
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
211
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
212
+ <?php endforeach; ?>
213
+ <?php endif; ?>
214
+ </div>
215
+
216
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
217
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
218
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
219
+ </div>
220
+ <?php endif; ?>
221
+ <?php endif; ?>
222
+ </td>
223
+ <?php endif; ?>
224
+ <?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
225
+ <td>
226
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
227
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
228
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
229
+ <?php else: ?>
230
+ <span class="cart-price">
231
+ <?php endif; ?>
232
+
233
+ <?php if ($canApplyMsrp): ?>
234
+ <span class="cart-msrp-subtotal">--</span>
235
+ <?php else: ?>
236
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
237
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
238
+ <?php else: ?>
239
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
240
+ <?php endif; ?>
241
+ <?php endif; ?>
242
+
243
+ </span>
244
+
245
+
246
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
247
+
248
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
249
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
250
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
251
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
252
+ <?php endforeach; ?>
253
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
254
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
255
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
256
+ <?php endforeach; ?>
257
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
258
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
259
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
260
+ <?php endforeach; ?>
261
+ <?php endif; ?>
262
+ </div>
263
+
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
265
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
266
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
267
+ </div>
268
+ <?php endif; ?>
269
+ <?php endif; ?>
270
+ </td>
271
+ <?php endif; ?>
272
+ <td class="a-center">
273
+ <input type="checkbox" value="<?php echo $_item->getId() ?>" name="prescriptionpayment_select[]" title="<?php echo $this->__('Select item for prescription payment') ?>" class="input-text prescriptionpayment" />
274
+ </td>
275
+ </tr>
app/design/frontend/default/default/template/prescriptionpayment/onepage_link.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @package Ce_PrescriptionPayment
16
+ * @copyright Copyright (c) 2013 codedge (http://www.codedge.de)
17
+ * @author Holger Lösken <post@codedge.de>
18
+ */
19
+ ?>
20
+ <?php if ($this->isPossibleOnepageCheckout()):?>
21
+ <button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button prescription-proceed-checkout btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?>><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
22
+ <script type="text/javascript">
23
+ if (typeof jQuery != 'undefined') {
24
+ jQuery('.prescription-proceed-checkout').click(function() {
25
+ if(jQuery("input[name='prescriptionpayment_choose_payment']:checked").val() == 1) {
26
+
27
+ var n = jQuery("input[name='prescriptionpayment_select[]']:checked").length;
28
+ if(n == 0) {
29
+ alert('<?php echo $this->__('Please select at least one item!')?>');
30
+ } else {
31
+ jQuery('#prescriptionpayment-form').submit();
32
+ }
33
+ } else {
34
+ jQuery('#prescriptionpayment-form').submit();
35
+ }
36
+ });
37
+ }
38
+ </script>
39
+ <?php endif?>
app/design/frontend/default/default/template/prescriptionpayment/selectitems.phtml ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @package Ce_PrescriptionPayment
16
+ * @copyright Copyright (c) 2013 codedge (http://www.codedge.de)
17
+ * @author Holger Lösken <post@codedge.de>
18
+ */
19
+
20
+ /**
21
+ * Shopping cart template
22
+ *
23
+ * @see Ce_PrescriptionPayment_Block_Items
24
+ */
25
+ ?>
26
+ <div class="cart">
27
+ <div class="page-title title-buttons">
28
+ <h1><?php echo $this->__('Choose your products for prescription payment') ?></h1>
29
+ <?php if(!$this->hasError()): ?>
30
+ <ul class="checkout-types">
31
+ <?php foreach ($this->getMethods('top_methods') as $method): ?>
32
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
33
+ <li><?php echo $methodHtml; ?></li>
34
+ <?php endif; ?>
35
+ <?php endforeach; ?>
36
+ </ul>
37
+ <?php endif; ?>
38
+ </div>
39
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
40
+ <?php echo $this->getChildHtml('form_before') ?>
41
+ <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
42
+ <?php echo $this->getChildHtml('choosepayment') ?>
43
+ <fieldset>
44
+ <table id="shopping-cart-table" class="data-table cart-table">
45
+ <col width="1" />
46
+ <col />
47
+ <col width="1" />
48
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
49
+ <col width="1" />
50
+ <?php endif ?>
51
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
52
+ <col width="1" />
53
+ <?php endif; ?>
54
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
55
+ <col width="1" />
56
+ <?php endif; ?>
57
+ <col width="1" />
58
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
59
+ <col width="1" />
60
+ <?php endif; ?>
61
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
62
+ <col width="1" />
63
+ <?php endif; ?>
64
+ <col width="1" />
65
+
66
+ <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
67
+ <thead>
68
+ <tr>
69
+ <th rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
70
+ <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
71
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
72
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span></th>
73
+ <?php endif ?>
74
+ <th class="a-center" colspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Unit Price') ?></span></th>
75
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
76
+ <th class="a-center" colspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Subtotal') ?></th>
77
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center"><?php echo $this->__('Prescription Payment') ?></th>
78
+ </tr>
79
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
80
+ <tr>
81
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
82
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
83
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
84
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
85
+ </tr>
86
+ <?php endif; ?>
87
+ </thead>
88
+ <tfoot>
89
+ <tr>
90
+ <td colspan="50" class="a-right">
91
+ <button type="button" title="<?php echo $this->__('Back to shopping cart') ?>" class="button btn-continue" onclick="setLocation('<?php echo Mage::getUrl('checkout/cart') ?>')"><span><span><?php echo $this->__('Back to shopping cart') ?></span></span></button>
92
+ <button type="button" class="button btn-update" title="<?php echo $this->__('Select all items for prescription payment'); ?>" name="select_all_prescription" ><span><?php echo $this->__('Select all'); ?></span></button>
93
+ </td>
94
+ </tr>
95
+ </tfoot>
96
+ <tbody>
97
+ <?php foreach($this->getItems() as $_item): ?>
98
+ <?php echo $this->getItemHtml($_item) ?>
99
+ <?php endforeach ?>
100
+ </tbody>
101
+ </table>
102
+ <script type="text/javascript">decorateTable('shopping-cart-table')</script>
103
+ </fieldset>
104
+ </form>
105
+ <div class="cart-collaterals">
106
+ <div class="col2-set">
107
+ <div class="block block-prescriptionpayment hint">
108
+ <div class="block-title">
109
+ <h3><strong>Hinweis zur Rezeptbezahlung</strong></h3>
110
+ </div>
111
+ <div class="block-content">
112
+ <p class="empty">
113
+ <strong>
114
+ <?php echo $this->__('Please send the prescriptions for the selected items to the following address') ?>:
115
+ </strong><br />
116
+ <?php echo nl2br(Mage::getStoreConfig('general/store_information/address')); ?>
117
+ <br /><br />
118
+ Der Versand kann erst erfolgen, wenn das Rezept sowie der zu zahlende Restbetrag bei uns eingegangen ist.
119
+ </p>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+ <script type="text/javascript">
127
+ if (typeof jQuery != 'undefined') {
128
+ jQuery(document).ready(function() {
129
+ // Check radio buttons after load
130
+ if(jQuery("input[name='prescriptionpayment_choose_payment']:checked").val() == 0) {
131
+ jQuery('#prescriptionpayment-form fieldset, .block-prescriptionpayment').css('display', 'none');
132
+ } else {
133
+ jQuery('#prescriptionpayment-form fieldset, .block-prescriptionpayment').css('display', 'block');
134
+ }
135
+
136
+ jQuery("input[name='prescriptionpayment_choose_payment']").click(function() {
137
+ if(jQuery(this).val() == 0) {
138
+ jQuery('#prescriptionpayment-form fieldset, .block-prescriptionpayment').css('display', 'none');
139
+ } else {
140
+ jQuery('#prescriptionpayment-form fieldset, .block-prescriptionpayment').css('display', 'block');
141
+ }
142
+ });
143
+
144
+ // Select all items
145
+ jQuery("button[name='select_all_prescription']").click(function() {
146
+ jQuery('#prescriptionpayment-form').find(':checkbox').each(function () {
147
+ jQuery(this).prop('checked', 'checked');
148
+ });
149
+ });
150
+ });
151
+ }
152
+ </script>
app/etc/modules/Ce_PrescriptionPayment.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ce_PrescriptionPayment>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Payment />
9
+ </depends>
10
+ </Ce_PrescriptionPayment>
11
+ </modules>
12
+ </config>
app/locale/de_DE/Ce_PrescriptionPayment.csv ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Attribute code","Attribut Code"
2
+ "Attribute label","Attributbezeichnung"
3
+ "Attribute option label for 'Yes'","Bezeichnung der Option für 'Ja'"
4
+ "Back to shopping cart","Zurück zum Warenkorb"
5
+ "Choose your products for prescription payment","Wählen Sie Ihre Produkte für die Rezeptbezahlung"
6
+ "Do you want to pay by prescription?","Möchten Sie per Rezept bezahlen?"
7
+ "For the following articles it is possible to pay them by prescription","Für folgende Artikel ist es möglich, diese als Sprechstundenbedarf SGB per Rezept zu bezahlen"
8
+ "Prescription Payment","Rezeptbezahlung"
9
+ "Sort order","Reihenfolge"
10
+ "Payment from applicable countries","Zahlung aus erlaubten Ländern"
11
+ "Payment from Specific countries","Zahlung von bestimmten Ländern"
12
+ "Please enter the attribute code for the prescription payment method","Bitte geben Sie den Attribut Code für die Rezeptbezahlung ein"
13
+ "Please select at least one item!","Bitte wählen Sie mindestens einen Artikel aus!"
14
+ "Prefer the configuration of configurable product instead of single product","Einstellungen des konfigurierbaren Produktes bevorzugen vor einfachen Produkt"
15
+ "Maximum Order Total","Maximalwert für Gesamtbestellung"
16
+ "Minimum Order Total","Mindestwert für Gesamtbestellung"
17
+ "New order status","Status neuer Bestellungen"
18
+ "No","Nein"
19
+ "No, I don't want to pay by prescription","Nein, ich möchte nicht per Rezept bezahlen"
20
+ "Please send the prescriptions for the selected items to the following address","Bitte senden Sie das Rezept für die ausgewählten Sprechstundenbedarfsartikel an folgende Adresse"
21
+ "Select all","Alle auswählen"
22
+ "Select item for prescription payment","Produkt für Rezeptbezahlung auswählen"
23
+ "Select all items for prescription payment","Alle Produkte für Rezeptbezahlung auswählen"
24
+ "Set the label for the attribute option when it is 'true'","Setzen Sie hier den Wert, wenn die Option 'wahr' ist"
25
+ "Title","Titel"
26
+ "Use configurable product settings","Einstellung des konfigurierbaren Produktes nutzen"
27
+ "Yes","Ja"
28
+ "Yes, I want to pay by prescription","Ja, ich möchte per Rezept bezahlen"
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>PrescriptionPayment</name>
4
+ <version>0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license>OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension enables the shop owner to let the customer select which items shall be paid via a prescription.</summary>
10
+ <description>This is a payment method extension for the ecommerce platform Magento. Use it preferably if you maintain a shop for medical things where it should be possible to pay via a prescription.&#xD;
11
+ &#xD;
12
+ It enables the shop owner to let the customer select which items shall be paid via a prescription. Those items value will be set to 0.00. All other items can be paid via other payment methods (f. ex. PayPal).</description>
13
+ <notes>Stable version. Please check https://github.com/codedge/prescriptionpayment for updates</notes>
14
+ <authors><author><name>Holger L&#xF6;sken</name><user>cod2edge</user><email>post@codedge.de</email></author></authors>
15
+ <date>2013-05-12</date>
16
+ <time>19:43:41</time>
17
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="notifications.phtml" hash="3bc8c15a8be0a7beb42578ea3747b3f2"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="choose_payment.phtml" hash="293339e56babbfbfa6440b9f5c2aeeed"/><dir name="item"><file name="default.phtml" hash="5fd5f616a714102c5fc55ffb7fa4ae37"/></dir><file name="onepage_link.phtml" hash="80beb697df60eae9a012561553354bdd"/><file name="selectitems.phtml" hash="4d6b8bcf0db5e2b199defb8c9ad49703"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Ce_PrescriptionPayment.csv" hash="5deab60afac98eb4eb4893d056dc24dd"/></dir></target><target name="mageetc"><dir name="modules"><file name="Ce_PrescriptionPayment.xml" hash="00be1ebba9d1706e92c55f18eea40e70"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.2.0</min><max>5.4.9</max></php></required></dependencies>
20
+ </package>