WP Dispensary's Connect for WooCommerce

Today we’re releasing version 2.2 of our Connect for WooCommerce add-on and this blog post will outline what you can expect from this update.

Added filters for weight size variations

In the how-to article for setting up and using the Connect for WooCommerce add-on, you are instructed to create various Weight attributes.

Previous to version 2.2, this was hard-coded in and the names were required to be the default options we provided.

As of version 2.2, there are now filters available for you to change the Weight names you’ve added.

Flower Weight Filters

  • wpdwc_weight_gram
  • wpdwc_weight_eighth
  • wpdwc_weight_quarter
  • wpdwc_weight_half
  • wpdwc_weight_ounce

Concentrate Weight Filters

  • wpdwc_weight_halfgram
  • wpdwc_weight_gram
  • wpdwc_weight_twograms

You can use the code example below as an example of how to change the weight name of 1 gram (previously ‘gram’) to ‘1g’.

/** Filter to change the gram weight name in WooConnect */
function acme_weight_gram( $weightgram ) {
    $weightgram = '1g';
    return $weightgram;
}
add_filter( 'wpdwc_weight_gram', 'acme_weight_gram' );

All filter options are currently being added to our Documentation, so you can get code snippets for each of the new filters there.

Better ‘out of stock’ integration

Another update in this release of the Connect for WooCommerce add-on is better visual representation for items that are out of stock in WooCommerce.

For instance, in your menu display, there are View Details and Buy Now buttons that get displayed within the shortcode output.

The new update will remove the Buy Now button and replace it with an Out of Stock notice if the connected WooCommerce item is marked as Out of Stock.

This change will save your patients the hassle of clicking through to a favorite item, only to find that it’s out of stock.

You will also notice that on individual pages for your WP Dispensary items, the Buy Now button that would normally display under the Pricing table is now hidden if the connected item is Out of Stock.

Code Cleanup

This update also includes some additional WordPress Coding Standards updates, bringing the plugin closer to a completely up-to-standards code base.

While these code changes do not make any changes visually to the add-on, the cleaner code means that maintaining the code and making bug fixes, code updates, etc will be much easier to complete.

Download our WooCommerce add-on

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!

Leave a Reply

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