Title: Missing filter
Last modified: May 13, 2019

---

# Missing filter

 *  Resolved [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/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
    -  This topic was modified 6 years, 11 months ago by [Maya](https://wordpress.org/support/users/tdgu/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/missing-filter/#post-11545904)
 * Ok, adding this. In your code you have the action twice, special reason for that
   or not? If there is none, I’ll only add the last one.
    [https://take.ms/Bc0gm](https://take.ms/Bc0gm)
 *  Thread Starter [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/missing-filter/#post-11560599)
 * There is a ** break ** in your loop, so the code need to trigger booth filters(
   before and after), or it will break our code.
    Imagine on **before** filter, 
   the site is switched to product location, then on **after** the default is restored.
   Obviously, if reach the **break** line it will not trigger the **after** filter
   so no site restore.
 * Hope it makes sense.
 *  [rawsilk](https://wordpress.org/support/users/rawsilk/)
 * (@rawsilk)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/missing-filter/#post-11563802)
 * Hi David,
 * Wanneer wordt deze filter weer toegevoegd? Ik wacht hier namelijk op (kan niet
   updaten naar 5.1.7 wegens deze missende filter)
 * Ik hoor graag van je!
 * Groet,
 * Sander
 *  Plugin Contributor [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * (@davdebcom)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/missing-filter/#post-11563912)
 * Today or tomorrow.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Missing filter’ is closed to new replies.

 * ![](https://ps.w.org/mollie-payments-for-woocommerce/assets/icon-256x256.png?
   rev=3090580)
 * [Mollie Payments for WooCommerce](https://wordpress.org/plugins/mollie-payments-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mollie-payments-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mollie-payments-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/mollie-payments-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mollie-payments-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mollie-payments-for-woocommerce/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [davdebcom](https://wordpress.org/support/users/davdebcom/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/missing-filter/#post-11563912)
 * Status: resolved