[英]WooCommerce CSS And Checkout button Is Not Loading In Single Product Page
I had installed woocommerce plugin in one of my clients site, it wasn't compatible with woocommerce so I made all the required configurations like so : 我已经在一个客户站点中安装了woocommerce插件,它与woocommerce不兼容,因此我进行了所有必需的配置,如下所示:
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
function my_theme_wrapper_start() {
echo '<td id="content" class="narrowcolumn">';
}
function my_theme_wrapper_end() {
echo '</td>';
}
add_theme_support( 'woocommerce' );
But still Woocommerce.css is not applying to my product page is elements, and also the checkout button is not appearing as well. 但是Woocommerce.css仍然不适用于我的产品页面是元素,并且结帐按钮也没有出现。
This is a link to the page : 这是页面的链接:
http://www.doctor-detail.com/product/gift-card-product-2 http://www.doctor-detail.com/product/gift-card-product-2
Any help would be much appreciated! 任何帮助将非常感激!
Use dev tools to check the elements, you have the following errors: 使用开发工具检查元素,您将遇到以下错误:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/add-to-cart.min.js Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/single-product.min.js Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/add-to-cart-variation.min.js 无法加载资源:服务器的状态为500(内部服务器错误),响应为http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/add-to-cart。 min.js无法加载资源:服务器响应状态为500(内部服务器错误) http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/single-product .min.js无法加载资源:服务器的响应状态为500(内部服务器错误) http://www.doctor-detail.com/wp-content/themes/mandingo/assets/js/frontend/add-购物车variation.min.js
Did you forget to copy a folder to your theme? 您是否忘记了将文件夹复制到您的主题?
Thanks for everyone is help, especially @imaginate. 谢谢大家的帮助,尤其是@imaginate。
I solved the problem by creating a woocommerce.php file in my theme is main folder, and copied all the contents of my theme is page.php file to woocommerce.php, just like it's mentioned in the documentation here : 我通过在主题为main文件夹中创建woocommerce.php文件解决了该问题,并将主题为page.php文件的所有内容复制到woocommerce.php中,就像在这里的文档中提到的那样:
http://docs.woothemes.com/document/third-party-custom-theme-compatibility/ http://docs.woothemes.com/document/third-party-custom-theme-compatibility/
And I replaced the loop like they said with 然后我像他们说的那样替换了循环
<?php woocommerce_content(); ?>
But it seems that the documentation needs to be updated, as it didn't work this way either, so I added it like this : 但是似乎文档需要更新,因为它也不以这种方式工作,所以我这样添加它:
<div class="woocommerce">
<?php woocommerce_content(); ?>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.