• gregs.legs

    (@gregslegs)


    I have coupons where I have specified that a user can only use a coupon once and have noticed that whenever a customer places an order I get an error log entries:

    PHP Warning: array_keys() expects parameter 1 to be array, boolean given in /wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1499 … and line 1502.

    and:

    PHP Warning: Illegal offset type in isset or empty in /wp-includes/meta.php on line 466.

    Line 1493 of class-wc-cart.php reads:

    $used_by = get_post_meta( $this->id, ‘_used_by’ );

    I’m new to coding so forgive me if I’ve got this all wrong but this looks to me like its looking for the _used_by meta in the cart post rather than the coupon post.

    Any help with this would be greatly appreciated.

    Thanks
    Greg

    https://wordpress.org/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gregs.legs

    (@gregslegs)

    Forgot to mention, I’m using:

    WordPress 3.9
    Woocommerce 2.1.7

    Same here, only when the coupon is set to be used once.
    Did you found a sollution Greg ?

    Kind regards,
    Jos

    Thread Starter gregs.legs

    (@gregslegs)

    Not yet …

    Thx for the quick reply, I don’t know if you get the header error to, but this is my complete error list :

    `Warning: array_keys() expects parameter 1 to be array, boolean given in /home/vhosts/…/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1499

    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/vhosts/…/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1502

    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/vhosts/…/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1502

    Warning: Cannot modify header information – headers already sent by (output started at /home/vhosts/…/httpdocs/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1499) in /home/vhosts/…/httpdocs/wp-includes/pluggable.php on line 1121

    I don’t know if this is the solution but if you add <?php ob_start(); ?> in the top of your functions.php, the coupon should work ( at least it seems to work for me )

    But i’m not an expert so i don’t know if this is the best solution.

    Kind regards,
    Jos

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Coupon Usage Limits per User – error messages’ is closed to new replies.