mycred-woocommerce.php – $woocommerce->cart object is not always available

Home Forums Community mycred-woocommerce.php – $woocommerce->cart object is not always available

This topic contains 0 replies, has 1 voice, and was last updated by  mattiasrefinemarketing 2 months, 2 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #35430

    mattiasrefinemarketing

    Hi,

    I get a
    PHP Notice: Trying to get property ‘total’ of non-object in /home/refine12/public_html/dev.pilatesvia.com/se/wp-content/plugins/mycred/addons/gateway/carts/mycred-woocommerce.php on line 556

    because occasionally the $woocommerce->cart is not always set when the hook ‘mycred_woo_available_gateways’ is triggered.

    I would love to see a test added to make sure before using $woocommmerce->cart object on this line.

    $cost = $mycred->apply_exchange_rate( $woocommerce->cart->total, $gateways[‘mycred’]->get_option( ‘exchange_rate’ ) );

    Cheers,

    /Mattias

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Spin to win points ?
Kindly get back to your previous orientation view... your wheel is rolling there...

Do you really like this awesome addon and wanna use on your site? click here to get it now ?
myCRED Fortune Wheel special offer unlocked!
You have a chance to win free tokens. Are you feeling lucky? Give it a spin.
* You can spin the wheel only once in a month.
* You can spin again any time by paying 500 points
* Once you pay for spin you are not able to refund it.
You must login to play mycred fortune wheel
11