Problem with WooCommerce - by olga - on WordPress WooCommerce support

This topic has 9 replies, 3 voices, and was last updated 3 years, 3 months ago ago by Rose Tyler

  • Avatar: olga
    olga
    Participant
    July 27, 2021 at 07:47

    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?

    Please, contact administrator
    for this information.
    8 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 28, 2021 at 14:48

    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

    Avatar: olga
    olga
    Participant
    July 28, 2021 at 18:25

    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?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 29, 2021 at 14:03

    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

    Avatar: olga
    olga
    Participant
    August 4, 2021 at 10:53

    When is it about to expect feedback on this issue?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 4, 2021 at 13:38

    Hello,

    Take my apologies for the delay in answering. Check the add to cart from grid now, please.

    Regards

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 4, 2021 at 13:38

    Hello,

    Take my apologies for the delay in answering. Check the add to cart from grid now, please.

    Regards

    Avatar: olga
    olga
    Participant
    August 9, 2021 at 13:06

    Thank you! Everything works

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 10, 2021 at 07:06

    Hello,

    You’re welcome!

    Regards

  • Viewing 9 results - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.