0
嗨我已經想出了一個小設計,但即時通訊有一個問題,它使用jQuery的onclick,如果用戶點擊產品它顯示產品信息在一個正確的痛苦butmy問題是它顯示每個產品的相同信息,即時編碼在本地主機上,所以不能鏈接任何人(抱歉)。這裏是我的代碼:鏈接到jquery中使用wordpress電子商務產品
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/header/loader.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".buynow").click(function() {
if($(".buynow").val() != 0) {
alert("The product has now been added to the Shopping cart, click checkout to pay for your items, or close this window to continue shopping.");
}
});
// Put an animated GIF image insight of content
$("#col2").empty().html('<img src="<?php bloginfo('stylesheet_directory'); ?>/header/loading.gif" /> Loading...');
// load index page when the page loads
$("#col2").load("<?php echo home_url('?page_id=2'); ?> .entry-content");
$("#col1 li span").click(function(){
// load home page on click
$("#col2").load("<?php echo home_url('?page_id=4&category=1&product_id='),wpsc_the_product_id(); ?> .entry-content");
});
//$("#about").click(function(){
// load about page on click
//$("#response").load("about.html");
//});
//$("#contact").click(function(){
// load contact form onclick
//$("#response").load("contact.html");
//});
$(".product").hover(
function() { $(this).children(".price").show(); },
function() { $(this).children(".price").hide(); }
);
});
</script>
<ul id="col1">
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
與一些修補工作很好,謝謝:) – 2011-03-09 11:02:46
你可以標記答案是正確的,謝謝:) – 2011-03-09 11:23:15