Missing filter
-
In a previous plugin update, there where 2 new actions inincludes/mollie/wc/helper/orderlines.php at process_items() method:
do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_before_getting_product_id', $cart_item );
and
do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_after_processing_item', $cart_item );
Those works great and i was able to achieve my code functionality thorough it.In recent update at /mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php at process_payment() method, at order loop items ( foreach ( $order->get_items() ) you add just the first action but not the second, this produce an issue since we can’t run specific code when the loop ends. Can you update the code and add the ending action, just like above method? So this should looks like this:
foreach ( $order->get_items() as $cart_item ) { if ( $cart_item['quantity'] ) { do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_before_getting_product_id', $cart_item ); if ( $cart_item['variation_id'] ) { $product = wc_get_product( $cart_item['variation_id'] ); } else { $product = wc_get_product( $cart_item['product_id'] ); } if ( $product == false ) { $mollie_payment_type = 'payment'; do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_after_processing_item', $cart_item ); break; } do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_after_processing_item', $cart_item ); } }
Thanks
- The topic ‘Missing filter’ is closed to new replies.