Php PayPal按钮在Prestashop中是不可点击的链接
我已经安装了PayPal模块并添加了所有API细节。它出现在页面上,但无法单击。为什么会这样?源代码中的代码如下所示: 我觉得有点奇怪。像图像应该以某种方式链接到表单 也在沙盒模式下尝试过,但也不起作用Php PayPal按钮在Prestashop中是不可点击的链接,php,paypal,smarty,prestashop,Php,Paypal,Smarty,Prestashop,我已经安装了PayPal模块并添加了所有API细节。它出现在页面上,但无法单击。为什么会这样?源代码中的代码如下所示: 我觉得有点奇怪。像图像应该以某种方式链接到表单 也在沙盒模式下尝试过,但也不起作用 <div id="HOOK_SHOPPING_CART_EXTRA"> <div id="container_express_checkout" style="float:right; margin: 10px 40px 0 0"> <img
<div id="HOOK_SHOPPING_CART_EXTRA">
<div id="container_express_checkout" style="float:right; margin: 10px 40px 0 0">
<img id="payment_paypal_express_checkout" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="" />
<form id="paypal_payment_form" action="http://mydomain.com/store/modules/paypal/express_checkout/payment.php" data-ajax="false" title="Pay with PayPal" method="post" data-ajax="false">
<!-- Change dynamicaly when the form is submitted -->
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="id_p_attr" value="" />
<input type="hidden" name="express_checkout" value="cart"/>
<input type="hidden" name="current_shop_url" value="http://mydomain.com/store/index.php?controller=order&multi-shipping=0" />
<input type="hidden" name="bn" value="FR_PRESTASHOP_H3S" />
</form>
</div>
</div>
我自己修好了。使按钮工作所需的代码缺少标题。如果将来有其他人找到此页面,则您需要的代码是:
$(document).ready( function() {
$('#payment_paypal_express_checkout').click(function() {
$('#paypal_payment_form').submit();
return false;
});
$('#paypal_payment_form').live('submit', function() {
var nb = $('#quantity_wanted').val();
var id = $('#idCombination').val();
$('#paypal_payment_form input[name=quantity]').val(nb);
$('#paypal_payment_form input[name=id_p_attr]').val(id);
});
function displayExpressCheckoutShortcut() {
var id_product = $('input[name="id_product"]').val();
var id_product_attribute = $('input[name="id_product_attribute"]').val();
$.ajax({
type: "GET",
url: baseDir+'/modules/paypal/express_checkout/ajax.php',
data: { get_qty: "1", id_product: id_product, id_product_attribute: id_product_attribute },
cache: false,
success: function(result) {
if (result >= '1')
$('#container_express_checkout').slideDown();
else
$('#container_express_checkout').slideUp();
return true;
}
});
}
$('select[name^="group_"]').change(function () {
displayExpressCheckoutShortcut();
});
$('.color_pick').click(function () {
displayExpressCheckoutShortcut();
});
var modulePath = 'modules/paypal';
var subFolder = '/integral_evolution';
var fullPath = baseDir + modulePath + subFolder;
var confirmTimer = false;
if ($('form[target="hss_iframe"]').length == 0) {
if ($('select[name^="group_"]').length > 0)
displayExpressCheckoutShortcut();
return false;
} else {
checkOrder();
}
function checkOrder() {
confirmTimer = setInterval(getOrdersCount, 1000);
}
function getOrdersCount() {
$.get(
fullPath + '/confirm.php',
{ id_cart: '7' },
function (data) {
if ((typeof(data) != 'undefined') && (data > 0)) {
clearInterval(confirmTimer);
window.location.replace(fullPath + '/submit.php?id_cart=7');
$('p.payment_module, p.cart_navigation').hide();
}
}
);
}
});
我编辑识别你的html代码。可能是你错了一个近距离的标签吗?不是分区,我只是错拍了。我解决了它,并在下面添加了答案。