Title: ryanpl's Replies | WordPress.org

---

# ryanpl

  [  ](https://wordpress.org/support/users/ryanpl/)

 *   [Profile](https://wordpress.org/support/users/ryanpl/)
 *   [Topics Started](https://wordpress.org/support/users/ryanpl/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ryanpl/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ryanpl/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ryanpl/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ryanpl/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ryanpl/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[MailPoet Checkout Subscription for WooCommerce (Legacy)] hooking to another action in woocommerce](https://wordpress.org/support/topic/hooking-to-another-action-in-woocommerce/)
 *  [ryanpl](https://wordpress.org/support/users/ryanpl/)
 * (@ryanpl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/hooking-to-another-action-in-woocommerce/#post-4604812)
 * amitrahav try this:
    remove in /wp-content/plugins/mailpoet-woocommerce-add-on/
   mailpoet-woocommerce-addon.php `add_action('woocommerce_after_order_notes', array(&
   $this, 'on_checkout_page'));` and add: `add_action('woocommerce_after_checkout_billing_form',
   array(&$this, 'on_checkout_page'));`
 * Now we can have checkbox after billing fields. In my case it’s under e-mail and
   name fields which is almost what I would like to achieve. However I wonder how
   I can’t set woocommerce_review_order_before_submit hook.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[MailPoet Checkout Subscription for WooCommerce (Legacy)] hooking to another action in woocommerce](https://wordpress.org/support/topic/hooking-to-another-action-in-woocommerce/)
 *  [ryanpl](https://wordpress.org/support/users/ryanpl/)
 * (@ryanpl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/hooking-to-another-action-in-woocommerce/#post-4604811)
 * I want achieve similar thing – move checkbox field.
    I tried to move checkbox
   field by changing plugin file // hook into checkout page (line 79-80) `add_action('
   woocommerce_after_order_notes', array(&$this, 'on_checkout_page'));` to `add_action('
   woocommerce_review_order_before_submit', array(&$this, 'on_checkout_page'));`
 * but then I receive
    Fatal error: Call to a member function get_value() on a non-
   object in /vol/www/…../wp-content/plugins/mailpoet-woocommerce-add-on/mailpoet-
   woocommerce-addon.php on line 199
 * fragment of mailpoet….addon.php (line 183-202)
 * > /**
   >  * This displays a checkbox field on the checkout * page to allow the customer
   > to subscribe to newsletters. */ function on_checkout_page($checkout){ // Checks
   > if subscribe on checkout is enabled. $enable_checkout = get_option(‘mailpoet_woocommerce_enable_checkout’);
   > $checkout_label = get_option(‘mailpoet_woocommerce_checkout_label’);
   >  if($enable_checkout == ‘yes’){
   >  echo ‘<div id=”mailpoet_checkout_field”>’;//
   > echo apply_filters(‘mailpoet_woocommerce_subscribe_checkout_title’, ‘<h3>’.
   > __(‘Subscribe to Newsletter’, ‘mailpoet_woocommerce’).'</h3>’); woocommerce_form_field(‘
   > mailpoet_checkout_subscribe’, array( ‘type’ => ‘checkbox’, ‘class’ => array(‘
   > mailpoet-checkout-class form-row-wide’), ‘label’ => htmlspecialchars(stripslashes(
   > $checkout_label)), ), $checkout->get_value(‘mailpoet_checkout_subscribe’));
   > echo ‘</div>’; } }

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