This topic has 9 replies, 3 voices, and was last updated 3 years, 3 months ago ago by Rose Tyler
I have an error with adding products to the cart from the catalog page. If I add products to the cart from the product page, then there is no error. If I add simple product to the cart from the catalog page, there is also no error…
Error log:
Fatal error: Uncaught Error: Call to a member function get_permalink() on bool in /var/www/u1382137/data/www/dens-pizza.ru/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1134
Трассировка стека
1.
WC_Cart->add_to_cart(0, 1, 7617, Array)
/var/www/u1382137/data/www/dens-pizza.ru/wp-content/plugins/et-core-plugin/packages/st-woo-swatches/public/partials/class-st-woo-shop.php:348
2.
St_Woo_Shop->add_to_cart(”)
/var/www/u1382137/data/www/dens-pizza.ru/wp-includes/class-wp-hook.php:292
3.
WP_Hook->apply_filters(”, Array)
/var/www/u1382137/data/www/dens-pizza.ru/wp-includes/class-wp-hook.php:316
4.
WP_Hook->do_action(Array)
/var/www/u1382137/data/www/dens-pizza.ru/wp-includes/plugin.php:484
5.
do_action(‘wp_ajax_sten_wc…’)
/var/www/u1382137/data/www/dens-pizza.ru/wp-admin/admin-ajax.php:187
6.
{main}
thrown in /var/www/u1382137/data/www/dens-pizza.ru/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1134
!!!!!!!!!!!!!! Please, don’t update my theme unnecessarily. Last time, this did not lead to a solution to the problem.
I need not hide the add to cart button, but make it work. !!!!!!!!!!!!!!
As I understand, the error occurs due to the fact that, according to the woocommerce’s logic, if the product is variable, then instead of the “add to cart” action, there should be a “select options” action.
Is it possible to add some code or install some plugin so that when a variable product is added to the cart from the catalog page, the default variation will be added to the cart?
Hello,
1) Is your production site or under development? If this is your production site I would suggest you to create a staging site and allow us to update the theme to the latest version there and try to fix the problem because you will need to update theme in the future and it would be better to do now than in future to avoid compatibility issue.
2) We won’t be able to add a product that uses an additional addon to the cart from the shop page. We’ll be able only to redirect to the single product page in this case.
Regards
1) Ok, let’s update
2) How to do it? Now If i change “Product Content Effect” in tab “Product style” from “Buttons on hover middle” to “Custom”, then on all products on the catalog page a button “Add to cart” appears, it does not work for variable products.
How to configure for variable products there is a “select options” button and it works for a redirect to the single product page and for simple products there is “add to cart” button with the suitable logic?
Hello,
I have passed the issue to our developers. They will check if there is any chance to add the base product to the cart from the grid. If not then that button just will redirect to a single product. I’ll inform you about the results.
Regards
When is it about to expect feedback on this issue?
Hello,
Take my apologies for the delay in answering. Check the add to cart from grid now, please.
Regards
Hello,
Take my apologies for the delay in answering. Check the add to cart from grid now, please.
Regards
Thank you! Everything works
Hello,
You’re welcome!
Regards
You must be logged in to reply to this topic.Log in/Sign up