【发布时间】:2014-01-22 03:09:01
【问题描述】:
我正在使用下面的脚本在我的 html 页面上添加一个 Paypal 购物车
<!-- CSS files -->
<link rel="stylesheet" type="text/css" href="js/jPayPalCart.css" />
<!-- Script files -->
<script src="js/jPayPalCart.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
// Create a basic cart
$("#myCart").PayPalCart({ business: 'yourselleremail@yourdomain.com',
notifyURL: 'http://www.yournotifyURL.com/notify.php',
virtual: false, //set to true where you are selling virtual items such as downloads
quantityupdate: true, //set to false if you want to disable quantity updates in the cart
currency: 'GBP', //set to your trading currency - see PayPal for valid options
currencysign: '£', //set the currency symbol
minicartid: 'minicart', //element to show the number of items and net value
persitdays: 0 //set to -1 for cookie-less cart for single page of products,
// 0 (default) persits for the session,
// x (number of days) the basket will persits between visits
});
});
</script>
我面临的问题是:我无法弄清楚如何将以下代码实现到我的 html 项目按钮以将项目添加到购物车
$("myCart").PayPalCart('add', code, description, quantity, value, vat);
我的 html 页面上的项目显示为
<div class="grid_3">
<div class="pricing-table">
<div class="top">
<img src="images/p6.jpg" alt=""><br><span class="permonth">"AIMLESS" Gloves</span>
</div>
<div class="title">
$11.95
</div>
<ul class="specifications">
<li>"Aimless" Logo Embroidered Gloves are touch-screen-friendly with conductive thread on the tip of the thumb and fingers.</li>
<li></li>
<li></li>
</ul>
<p><a class="button" href="#">Buy Now</a></p>
</div>
</div>
非常感谢您在这个主题上的专业知识这是我在这个问题上的第二天。如果有帮助,我按照此网页上的说明进行操作http://www.ultimateweb.co.uk/jPayPalCart/
脚本不是由 PayPal 编写的,这是一个定制的 JQ 购物车,旨在将 Paypal 用作结帐支付终端。购物车完美运行,但我不知道如何让我的“立即购买”html 按钮将商品添加到购物车。我从上面下载脚本的网站声明使用这一行:
$("myCart").PayPalCart('add', code, description, quantity, value, vat);
将商品添加到我的购物车
感谢您的宝贵时间,非常感谢您的帮助
当我运行控制台以使用谷歌浏览器检查页面上的错误时,这是我得到的错误
Uncaught ReferenceError: jQuery is not defined custom.js:1
(anonymous function) custom.js:1
Uncaught ReferenceError: jQuery is not defined jPayPalCart.js:223
(anonymous function) jPayPalCart.js:223
Uncaught ReferenceError: $ is not defined index.php:31
(anonymous function) index.php:31
Uncaught ReferenceError: $ is not defined index.php:47
(anonymous function) index.php:47
【问题讨论】:
-
Paypal 的文档在哪里?
-
我只对让 JQ 命令将商品添加到购物车感兴趣,其他一切正常
标签: javascript jquery html