Support » Plugin: YITH WooCommerce Gift Cards » Compatibility issues with other plugins

  • When adding the gift vouchers to the basket, the yith-woocommerce-gift-cards plugin is using this (http://woocommerce.wp-a2z.org/oik_api/wc_cartadd_to_cart/) function to add them to the cart.

    In the WooCommerce documentation for this method which is on the same page it says the “$cart_item_data” parameter (5) should be given as an array, however the gift cards plugin is providing an object of the class YWGC_Gift_Card.

    This looks to work okay with the gift card plugin alone, but other plugins like woocommerce-product-addons and woocommerce-deposits (and potentially many others) rely on this being an array when they are checking for their own data. Which is throwing the below fatal error:
    Fatal error: Uncaught Error: Cannot use object of type YWGC_Gift_Card as array in /home/…/public_html/wp-content/plugins/woocommerce-deposits/includes/class-wc-deposits-cart.php:47 Stack trace: #0 /home/…/public_html/wp-includes/class-wp-hook.php(288): WC_Deposits_Cart->add_cart_item(Object(YWGC_Gift_Card), 315) #1 /home/…/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(Object(YWGC_Gift_Card), Array) #2 /home/…/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1053): apply_filters(‘woocommerce_add…’, Object(YWGC_Gift_Card), 315, 0, 1) #3 /home/…/public_html/wp-content/plugins/yith-woocommerce-gift-cards/lib/class.yith-woocommerce-gift-cards.php(511): WC_Cart->add_to_cart(315, 1, 0, Array, Object(YWGC_Gift_Card)) #4 /home/…/public_html/wp-includes/class-wp-hook.php(286): YITH_WooCommerce_Gift_Cards->add_to_cart_handler(”) #5 /home/…/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Ar in /home/…/public_html/wp-content/plugins/woocommerce-deposits/includes/class-wc-deposits-cart.php on line 47

    Would you mind providing a fixed version of the gift-cards plugin which should be compatible with the 2 plugins mentioned. Also, if any future release could also include this fix so that we can stay up to date.

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello,

    Please could you send me the wordpress.org links for woocommerce-product-addons and woocommerce-deposits in order to download and try to reproduce the problem in our installation.

    Have a good day,

Viewing 1 replies (of 1 total)
  • The topic ‘Compatibility issues with other plugins’ is closed to new replies.