Commit 5afbf2c5 authored by Andy J's avatar Andy J

io-based pq selector

parent d6007abc
......@@ -12,7 +12,7 @@
<th>Zahlungsart</th>
<th class="text-center">Modus</th>
<th class="text-center">Zugangsdaten</th>
<th class="text-center">Verknüpft</th>
<th class="text-center">Verknüpft<br><small class="text-muted">Mit Versandart</small></th>
</thead>
<tbody>
<tr class="basic">
......@@ -93,7 +93,9 @@
dataType: "json",
url: url+'&validate=' + type,
success: function(data) {
var label_type = data['status'] == 'success' ? 'Gültig' : 'Ungültig';
var error = data.msg || 'Ungültig';
var label_type = data['status'] == 'success' ? 'Gültig' : error;
var class_state = data['status'] == 'success' ? 'success' : 'danger';
var state = '<small class="label label-'+class_state+'">'+label_type+'</small>';
......
......@@ -163,7 +163,7 @@ if ($oPlugin->oPluginEinstellungAssoc_arr['jtl_paypal_express_checkout'] === 'Y'
}
}
if ($oPlugin->oPluginEinstellungAssoc_arr['jtl_paypal_express_cart_popup'] === 'Y') {
if ($oPlugin->oPluginEinstellungAssoc_arr['jtl_paypal_express_cart_popup'] === 'Y' && isset($_SESSION["Warenkorb"]) && $_SESSION["Warenkorb"]->istBestellungMoeglich() == 10) {
require_once str_replace('frontend', 'paymentmethod', $oPlugin->cFrontendPfad) . '/class/PayPalExpress.class.php';
$payPalExpress = new PayPalExpress();
......@@ -180,13 +180,13 @@ if ($oPlugin->oPluginEinstellungAssoc_arr['jtl_paypal_express_cart_popup'] === '
if ($payPalExpress->zahlungErlaubt($oArtikel_arr)) {
$link = PayPalHelper::getLinkByName($oPlugin, 'PayPalExpress');
if ($link !== null) {
pq($pqSelectorCart)->$pqMethodCart(
'<li>' .
' <a href="index.php?s=' . $link->kLink . '&jtl_paypal_checkout_cart=1" class="paypalexpress btn-ppe-cart-popup">' .
' <img src="' . $ppCheckout . '" alt="' . $oPlugin->cName . '" />' .
' </a>' .
'</li>'
);
$smarty->assign('link', $link);
$smarty->assign('oPlugin', $oPlugin);
$smarty->assign('ppCheckout', $ppCheckout);
$smarty->assign('pqMethodCart', $pqMethodCart);
$smarty->assign('pqSelectorCart', $pqSelectorCart);
$tpl = $smarty->fetch($oPlugin->cFrontendPfad . 'template/inc_basket.tpl');
pq('body')->append($tpl);
}
}
}
}
\ No newline at end of file
<script type="text/javascript">
var method = '{$pqMethodCart}';
var selector = '{$pqSelectorCart}';
$(function() {
_push_paypalexpress();
$(document).on('evo:loaded.io.request', function() {
_push_paypalexpress();
});
});
function _push_paypalexpress() {
if ($(selector).length > 0) {
var content = $('#paypalexpress-basket').html();
$(selector)[method](content);
}
}
</script>
<div id="paypalexpress-basket" style="display: none">
<li>
<a href="index.php?s={$link->kLink}&jtl_paypal_checkout_cart=1" class="paypalexpress btn-ppe-cart-popup">
<img src="{$ppCheckout}" alt="{$oPlugin->cName}" />
</a>
</li>
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment