Deprecated code within email-cart.php
-
Good Morning,
I wanted to let you know that I had the following issue with the Save & Share Cart when attempting to share a cart via email:
[23-Oct-2019 19:32:45 UTC] The WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
[23-Oct-2019 19:32:45 UTC] The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.
[23-Oct-2019 19:32:45 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Kadence_Woomail_Designer::add_email_header(), 1 passed in C:\inetpub\wwwroot\Carriers\wp-includes\class-wp-hook.php on line 286 and exactly 2 expected in C:\inetpub\wwwroot\Carriers\wp-content\plugins\kadence-woocommerce-email-designer\kadence-woocommerce-email-designer.php:560Stack trace:
#0 C:\inetpub\wwwroot\Carriers\wp-includes\class-wp-hook.php(286): Kadence_Woomail_Designer->add_email_header(‘ ‘)
#1 C:\inetpub\wwwroot\Carriers\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
#2 C:\inetpub\wwwroot\Carriers\wp-includes\plugin.php(453): WP_Hook->do_action(Array)
#3 C:\inetpub\wwwroot\Carriers\wp-content\plugins\woocommerce-email-cart\email-cart.php(1118): do_action(‘woocommerce_ema…’, ‘ ‘)
#4 C:\inetpub\wwwroot\Carriers\wp-content\plugins\woocommerce-email-cart\email-cart.php(303): WC_Email_Cart->format_email(‘<style>\t\t\r\n\t\t/*…’, ‘ ‘)
#5 C:\inetpub\wwwroot\Carriers\wp-content\plugins\woocommerce-email-c in C:\inetpub\wwwroot\Carriers\wp-content\plugins\kadence-woocommerce-email-designer\kadence-woocommerce-email-designer.php on line 560To resolve the issue, I had to modify the following code within the email-cart.php:
The following code:
do_action( ‘woocommerce_email_header’, $heading );
echo $message;
do_action( ‘woocommerce_email_footer’ );had to be updated to:
do_action( ‘woocommerce_email_header’, $email_heading, $email );
echo $message;
do_action( ‘woocommerce_email_footer’, $email );Thank you,
JakeThe page I need help with: [log in to see the link]
- The topic ‘Deprecated code within email-cart.php’ is closed to new replies.