简体   繁体   中英

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 :

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.

This is a link to the page :

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

Did you forget to copy a folder to your theme?

Thanks for everyone is help, especially @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 :

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM