• Resolved Alain Aubry

    (@caban13)


    Hi

    I am trying to use a snippet that Remove Billing Fields if Cart contains Virtual Products, but it renders some incompatability with your plugin, It is curious because there is nothing weird with the snippet, it is very simple.

    You can see the snippet here (it is from a well known developer): https://www.businessbloomer.com/woocommerce-hide-checkout-billing-fields-if-virtual-product-cart/

    Everytime I enable the snippet, your SMS plugin continues to work, but the plugin option page appears defaced, as a long list of all the possible SMS’s gateways and then a PHP error “Call to a member function get_cart() on null”.

    Reading the code, this error does not make sense. Can you hint me, please?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Art Project Group

    (@artprojectgroup)

    The truth is that it is rare. Try to put all the code of the function, except the last line of the snippet between this code:

    if ( ! is_admin() ) {
    ...
    }

    Best regards.

    Thread Starter Alain Aubry

    (@caban13)

    Thank you for your reply, meanwhile I found the solution, I added this line to Roberto’s script:
    if ( is_null( WC()->cart ) ) wc_load_cart();

    That made everybody happy.

    Plugin Author Art Project Group

    (@artprojectgroup)

    Perfect!

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘snippet incompatability’ is closed to new replies.