We are just a few days away from 4/20, so let’s start celebrating early with a new release for our Connect for WooCommerce extension 🎉

Version 2.4 is packed with a bunch of filter changes, bug fixes and code quality updates.

Let’s dive in and see what’s new!

👌 Multiple filter updates

Version 2.4 of our WooCommerce add-on’s focus has been increasing the code quality and compatibility with other add-on’s, both built by us and third-party solutions.

This update changes the following filter names, which better follows name structures like other filters throughout WP Dispensary:

  • wpd_wooconnect_buttons to wpd_wooconnect_buttons_single
  • wooconnect_wpd_bottomshortcodes to wpd_wooconnect_buttons

From a user perspective, this doesn’t require anything else on your end in order for the buttons to work.

For developers who may have custom code that connects to our previous filters, you will just need to update the names in your code – everything else will remain functioning the same.

Connect for WooCommerce v2.4 also introduces a filter for the Buy Now button.

In previous versions there has already been a filter for the Buy Now button text, but this new filter allows you to update the entire button’s output.

/** Function to change the Connect for WooCommerce 'buy now' button link */
function acme_buy_now_link( $newbuybtn ) {
    $newbuybtn = '<a href="'. get_permalink() .'" class="button wpd-connect-btn buy-now">Buy Now</a>';
    return $newbuybtn;
}
add_filter( 'wpdwc_buy_now_button_link', 'acme_buy_now_link' );

And if you don’t need to change the whole URL, but only want to change the button text, you can use the following filter:

/** Function to change the Connect for WooCommerce 'buy now' button text */
function acme_buy_now_button() {
    echo 'New Button Text';
}
add_filter( 'wpdwc_buy_now_button_text', 'acme_buy_now_button' );

🐛 Bug fixes

This release updates depreciated codes for WooCommerce’s $cart_url and $checkout_url variables.

There’s also updates to how the WooCommerce inventory is handled if you also have the Inventory Management add-on installed and activated.

Now, when you add your new WP Dispensary product, the connected WooCommerce product by default will use the number you input into the Inventory Management box.

The v2.4 update also brings in more structure and organization in the code through WordPress Coding Standards updates and rearrangement of code, including further separation of code files.

Going forward, this will allow for faster code updates and enhancements, as well as easier integration with our other add-on’s.

🚀 Download Connect for WooCommerce v2.4

If your dispensary is looking for a way to let patients place orders directly through your website, our Connect for WooCommerce add-on is exactly what you’re looking for.

Head over to the add-on’s product page and get your copy today!

Download Now

Leave a Reply

Your email address will not be published. Required fields are marked *