Product Page Infinitely Reloads
-
I have been having an issue where sometimes going to a product page results in a double reload. Sometimes though, the reloads never stop. After much debugging, I have narrowed it down to your plugin. I have switched my theme to storefront and disabled all plugins except yours and woocommerce and the issue still happens.
I looked through your code and I believe the issue starts in the file
/src/helpers/helper-slw-frontend.php
and in this block of code:// update stock and stock status first to not show wrong data to customers $product_locations_total_stock = SlwProductHelper::get_product_locations_stock_total( $product_id ); $product_wc_stock = $product->get_stock_quantity(); if( $product_wc_stock != $product_locations_total_stock ) { update_post_meta( $product_id, '_stock', $product_locations_total_stock ); SlwProductHelper::update_wc_stock_status( $product_id ); // refresh page echo("<meta http-equiv='refresh' content='1'>"); }
When I comment out the echo refresh line the reloads stop. The total stock quantity is wrong though. I’m not sure why but it seems as though sometimes it can’t update the total stock and gets stuck in an infinite reload loop.
- The topic ‘Product Page Infinitely Reloads’ is closed to new replies.