我是WordPress / WooCommerce的新手。我正在尝试从可变产品中弹出的fancybox制作快速查看,添加到购物车功能。
我找到并写下了代码;当客户登录时它正在工作,但对于访客用户而言,它显示的消息是产品已添加到购物车但在实际购物车中它没有添加。
我在用
WordPress version: 4.3.1
WooCommerce version: 2.4.12
插件:woocommerce-ajax-add-to-cart-for-variable-products
<?php
include 'wp-load.php';
?>
<script src="<?php echo get_site_url() ?>/jquery.min.js"></script>
<script type='text/javascript' src='<?php echo get_site_url() ?>/wp-content/plugins/woocommerce/assets/js/frontend/single-product.min.js'></script>
<script type='text/javascript' src='<?php echo get_site_url() ?>/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js'></script>
<script type='text/javascript' src='<?php echo get_site_url() ?>/wp-content/plugins/woocommerce-ajax-add-to-cart-for-variable-products/js/add-to-cart-variation.min.js'></script>
<script type='text/javascript' src='<?php echo get_site_url() ?>/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js'></script>
<?php global $product, $woocommerce, $yith_wcwl_init; ?>
<?php wc_print_notices(); ?>
<?php
woocommerce_variable_add_to_cart();
echo do_action( 'woocommerce_add_to_cart_form' );
?>
提前致谢。