Gift Wrapper version 3.3 4.0 is in beta

In March, I started working on a lot of new features and tweaks for the WooCommerce Gift Wrapper plugin. This has dragged on for a while longer than I’d like because of intense wildfire concerns here on the California/Nevada border. So, while not wielding a chainsaw and tanning my hide, I’ve been coding up a storm. The Gift Wrapper will definitely remain in active development into the future. It’s a fun plugin!

Thankfully, a lot of customers have written to us with some great ideas, and we’re usually able to incorporate them. It’s neat to realize all the diverse ways people are using WooCommerce, and reasons they need a wrapping plugin. Sometimes it won’t be obvious what the plugin can do, but for a developer with knowledge of filter/action hooks and CSS, maybe some PHP, this is a very extensible and robust plugin. It can do a lot of things out-of-the-box. It can do a ton of things if you or someone you know codes. And now it’s even more capable in version 4.0!

What was version 3.3 in beta became version 4.0 this week when some accessibility updates created concern over breaking updates. If you are using customized theme templates (in a wp-content/child-theme/woocommerce/wcgwp folder), you will want to do thorough testing upon (non-production) upgrade to version 4.0 to make sure you appreciate the new format. Main changes include using CSS grid to layout multiple wrap options, and use of <button> rather than <href> where possible when not linking to a URL. Simply put, you’ll want to make sure the gift wrap layouts look right.

Most people will not notice much change when upgrading. But as ever when upgrading WordPress plugins, it’s best to take full backups so you can revert if anything goes wrong. You never know when your server might hiccup!

Another feature in 4.0 is the ability to remove gift wrap that was added to a product as an attribute. A “Remove Gift Wrap” button will show with each wrapped item in the cart.

Quite a few more hooks have been added for people needing to customize the plugin. One example is ‘wcgwp_post_args’ filter, which allows a developer to adjust the arguments to the get_posts() call in the get_wcgwp_products() method, which gathers available wrap products for display. This method checks for if the gift wrap is in stock before showing it; however, one user wrote that his WooCommerce site did not use the native stock system. These arguments needed adjusting, hence the hook.

Another option that is available is to move the gift wrap prompt around on the cart and checkout pages. The peri-cart (non cart item / line item / row in cart) placements need to be OUTSIDE the add-to-cart and totals forms, but that still leaves hooks not listed by Gift Wrapper.

add_action( 'woocommerce_cart_collaterals', 'custom_wrap_location' );

function custom_wrap_location() {
    WCGWrap()->wrapping->custom_wrap_location( '_after_cart' );

This example moves the gift wrapping prompt to the Woo “cart collaterals” area instead of the areas offered in the Gift Wrapper settings. Code like this would usually go in a child themes function.php file, but you can also use a plugin like “Code Snippets” to install it front-end.

You can also even set placements to “None” and the hooked placement from the above code example will show, in this example replacing the “After Cart” placement.

Overall, this plugin does what you would expect as far as adding gift wrap to a WooCommerce cart, in various ways. And then it includes quite a few options for customization. It functions far beyond the very simple scope of the free version of Gift Wrapper. The free version is popular but the paid version has waaaay more features. Both the paid and free version occasionally fail due to theme or plugin conflicts, which are addressed here. One of the most common reasons for theme failures is themes disabling the ‘woocommerce_after_cart_item_name’ or other peri-cart/checkout WooCommerce hooks (shame). Most standardized themes work fine and plugin conflicts are very rare. Anyway, hooks can always be added back in, right? Generally there hasn’t been a problem with this plugin that we haven’t been able to address*.

If you want to get the 4.0 beta, go to your WordPress admin panel, click Settings -> Gift Wrapper License, and turn on the Beta feature by checking the box and clicking Save Changes. Your update will show up next time WordPress pings for updates, or you can force an update check on your Dashboard -> Updates screen by clicking the “Check Again” link. We will be pushing 4.0 live very soon; there are mainly some more CSS checks to do before that happens.

* Let’s clarify: missing features according to your precise specification is not a problem! It’s a job opening. You hire a plumber. You hire an electrician. Unless you’re extremely affixed to the DIY ethic and have a LOT of time, hire a developer!