| 2 |
lars |
1 |
<!-- $Id$ BEGIN -->
|
|
|
2 |
{$pi = $smarty.session.SHOP.BASKET->paymentInfo}
|
|
|
3 |
<style>
|
|
|
4 |
a.payment-button {
|
|
|
5 |
color: #000;
|
|
|
6 |
background-color: #fff;
|
|
|
7 |
border: 1px solid #ccc;
|
|
|
8 |
display: flex;
|
|
|
9 |
justify-content: center;
|
|
|
10 |
align-items: center;
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
#paypal-button-container {
|
|
|
14 |
width:100%;
|
|
|
15 |
text-align:center;
|
|
|
16 |
}
|
|
|
17 |
.payment-button-container{
|
|
|
18 |
width: 100%;
|
|
|
19 |
max-width: 750px;
|
|
|
20 |
margin: 0 auto;
|
|
|
21 |
}
|
|
|
22 |
.payment-button{
|
|
|
23 |
position: relative;
|
|
|
24 |
display:block;
|
|
|
25 |
width:100%;
|
|
|
26 |
height:55px;
|
|
|
27 |
text-align:center;
|
|
|
28 |
border-radius:4px;
|
|
|
29 |
background-color:#eee;
|
|
|
30 |
margin-bottom:17px;
|
|
|
31 |
cursor: pointer;
|
|
|
32 |
overflow:hidden;
|
|
|
33 |
}
|
|
|
34 |
.payment-button:hover{
|
|
|
35 |
filter: brightness(0.95);
|
|
|
36 |
}
|
|
|
37 |
.payment-button img{
|
|
|
38 |
/*
|
|
|
39 |
position: absolute;
|
|
|
40 |
top: 50%;
|
|
|
41 |
left: 50%;
|
|
|
42 |
transform: translate(-50%,-50%);
|
|
|
43 |
*/
|
|
|
44 |
cursor: pointer;
|
|
|
45 |
}
|
|
|
46 |
@media only screen and (max-width: 500px){
|
|
|
47 |
.payment-button{
|
|
|
48 |
height:45px;
|
|
|
49 |
margin-bottom:14px;
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
</style>
|
|
|
54 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
55 |
<script src="https://www.paypal.com/sdk/js?client-id={$ini.PayPalPlus.clientId}&intent=authorize¤cy=EUR&components=buttons,marks&locale=de_DE"></script>
|
|
|
56 |
<div id="paypal-button-container"></div>
|
|
|
57 |
<div id="additional-button-container" class="payment-button-container">
|
|
|
58 |
<a id="Vorkasse" class="additional payment-button"><img src="/images/webelemente/za_vorkasse.png" alt=""></a>
|
|
|
59 |
{foreach $versandOptionen as $opt}
|
|
|
60 |
{if $opt.rufname=="vorkasse"}
|
|
|
61 |
{elseif $opt.rufname=="crefopay"}
|
|
|
62 |
<a id="crefopay" class="additional payment-button"><img src="/images/webelemente/za_crefopay.png" alt=""></a>
|
|
|
63 |
{elseif $opt.rufname=="selbstabholung"}
|
|
|
64 |
<a id="Barzahlung" class="additional payment-button"><img src="/images/webelemente/za_selbstabholung.png" alt=""></a>
|
|
|
65 |
{elseif $opt.rufname=="nachnahme"}
|
|
|
66 |
<a id="Nachnahme" class="additional payment-button"><img src="/images/webelemente/za_nachnahme.png" alt=""></a>
|
|
|
67 |
{elseif $opt.rufname=="sofortueberweisung"}
|
|
|
68 |
<a id="sofortüberweisung" class="additional payment-button"><img src="/images/webelemente/za_sofortueberweisung.png" alt=""></a>
|
|
|
69 |
{elseif $opt.rufname=="easycredit"}
|
|
|
70 |
{if $smarty.session.SHOP.SUMME >= 200 && $smarty.session.SHOP.SUMME <=10000}
|
|
|
71 |
<a id="easycredit" class="additional payment-button"><img src="/images/webelemente/za_easycredit.png" alt=""></a>
|
|
|
72 |
{/if}
|
|
|
73 |
{/if}
|
|
|
74 |
{/foreach}
|
|
|
75 |
{if $ini.PayPalCheckout.invoicePayment==1 && $pi.Total >= 5 && $pi.Total <=2500}
|
|
|
76 |
<a id="PaypalRechnungskauf" class="additional payment-button"><img src="/images/webelemente/za_rechnung.png" alt=""></a>
|
|
|
77 |
{/if}
|
|
|
78 |
</div>
|
|
|
79 |
<script>
|
|
|
80 |
{$summe=$pi.Total}
|
|
|
81 |
{foreach $smarty.session.SHOP.BASKET->items as $bItem}
|
|
|
82 |
{if $bItem->code}
|
|
|
83 |
{$discount=($bItem->price*-1)}
|
|
|
84 |
{$summe=$summe+$discount}
|
|
|
85 |
{/if}
|
|
|
86 |
{/foreach}
|
|
|
87 |
paypal.Buttons({
|
|
|
88 |
createOrder: (data, actions) => {
|
|
|
89 |
return actions.order.create({
|
|
|
90 |
purchase_units: [{
|
|
|
91 |
shipping:{
|
|
|
92 |
"name": {
|
|
|
93 |
"full_name": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_Vorname_pst} {$smarty.session.SHOP.buy.Persdata.liefer_Nachname_pst}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_Vorname} {$smarty.session.SHOP.buy.Persdata.liefer_Nachname}"{/if}
|
|
|
94 |
},
|
|
|
95 |
"address": {
|
|
|
96 |
"address_line_1": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_Strasse_pst} {$smarty.session.SHOP.buy.Persdata.liefer_Hausnummer_pst}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_Strasse} {$smarty.session.SHOP.buy.Persdata.liefer_Hausnummer}"{/if},
|
|
|
97 |
"address_line_2": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_Firma_pst}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_Firma}"{/if},
|
|
|
98 |
"admin_area_2": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_Ort_pst}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_Ort}"{/if},
|
|
|
99 |
"postal_code": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_PLZ_pst}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_PLZ}"{/if},
|
|
|
100 |
"country_code": {if $smarty.session.SHOP.Lieferadresse === "packstation" }"{$smarty.session.SHOP.buy.Persdata.liefer_Land_pst|getIsoCode}"{else}"{$smarty.session.SHOP.buy.Persdata.liefer_Land|getIsoCode}"{/if}
|
|
|
101 |
}
|
|
|
102 |
},
|
|
|
103 |
amount: {
|
|
|
104 |
value: '{$pi.Total}',
|
|
|
105 |
breakdown:{
|
|
|
106 |
item_total:{
|
|
|
107 |
value:'{$pi.Total}',
|
|
|
108 |
currency_code:"EUR"
|
|
|
109 |
},
|
|
|
110 |
{if $discount}
|
|
|
111 |
discount:{
|
|
|
112 |
value:{$discount},
|
|
|
113 |
currency_code:"EUR"
|
|
|
114 |
},
|
|
|
115 |
{/if}
|
|
|
116 |
shipping:{
|
|
|
117 |
value:'{$smarty.session.SHOP.VERSAND.preis|default:0.00}',
|
|
|
118 |
currency_code:"EUR"
|
|
|
119 |
}
|
|
|
120 |
}
|
|
|
121 |
},
|
|
|
122 |
items:[
|
|
|
123 |
{foreach $smarty.session.SHOP.BASKET->items as $bItem}
|
|
|
124 |
{if !$bItem->code}
|
|
|
125 |
{
|
|
|
126 |
name:"{$bItem->name|escape:"javascript"}",
|
|
|
127 |
unit_amount:{
|
|
|
128 |
value:"{$bItem->price}",
|
|
|
129 |
currency_code:"EUR"
|
|
|
130 |
},
|
|
|
131 |
quantity: "{$bItem->menge}",
|
|
|
132 |
sku: "{$bItem->id}",
|
|
|
133 |
},
|
|
|
134 |
{/if}
|
|
|
135 |
{/foreach}
|
|
|
136 |
]
|
|
|
137 |
}]
|
|
|
138 |
});
|
|
|
139 |
},
|
|
|
140 |
onApprove: function(data, actions) {
|
|
|
141 |
actions.order.authorize().then(function (authorization) {
|
|
|
142 |
let authorizationID = authorization.purchase_units[0].payments.authorizations[0].id
|
|
|
143 |
$.post('/module/paypalcheckout.php', {
|
|
|
144 |
orderID: data.orderID,
|
|
|
145 |
authorizationID: authorizationID
|
|
|
146 |
}, function () {
|
|
|
147 |
document.location.href = "/bestellen_seite_3.html"
|
|
|
148 |
});
|
|
|
149 |
});
|
|
|
150 |
}
|
|
|
151 |
}).render('#paypal-button-container');
|
|
|
152 |
$(function(){
|
|
|
153 |
$('.additional').click(function (e) {
|
|
|
154 |
e.preventDefault();
|
|
|
155 |
let rufname = $(this).attr("id");
|
|
|
156 |
$.post("/updateSession", {
|
|
|
157 |
_token: "{csrf_token()}",
|
|
|
158 |
thirdPartyPaymentMethod: rufname
|
|
|
159 |
},function(erg) {
|
|
|
160 |
$('#step').val("2");
|
|
|
161 |
$('#buy_form').attr("action","{if $ini.ssl_buy==1}https://{$smarty.server.SERVER_NAME}{/if}/bestellen_seite_2.html")
|
|
|
162 |
if (rufname==="easycredit"||rufname==="crefopay"||rufname==="crefopayKK"||rufname==="PaypalRechnungskauf")
|
|
|
163 |
{
|
|
|
164 |
$('#step').val("1b");
|
|
|
165 |
$('#buy_form').attr("action","{if $ini.ssl_buy==1}https://{$smarty.server.SERVER_NAME}{/if}/bestellen_seite_1b.html")
|
|
|
166 |
}
|
|
|
167 |
$('#buy_form').submit();
|
|
|
168 |
return false;
|
|
|
169 |
});
|
|
|
170 |
})
|
|
|
171 |
})
|
|
|
172 |
</script>
|
|
|
173 |
<!-- $Id$ END -->
|