All Humans Are Welcome Here!

WCGWP Documentation

Try out the free version of WooCommerce Gift Wrapper

Purchase Woocommerce Gift Wrapper Plus

Installation and Setup

This plugin works in conjunction with WooCommerce for Wordpress. Please note the plugin will function without the license key activated. Activating the license under Settings->Gift Wrapper License will allow your plugin to also seek automatic updates via API.

Once WooCommerce Gift Wrapper is installed and activated on your site, do the following:

1. Start by adding at least one WooCommerce product called “Gift Wrapping” or whatever you desire.
2. Create a unique product category for this/these gift wrapping product(s), and add them to this category. You can view/edit product categories under “Products->Categories”.

Head over to the settings page at yoursite.com/wp-admin/admin.php?page=wc-settings&tab=products&section=wcgiftwrapper

On this page, under “General Gift Wrapping Options,” you should set the category used for gift wrap products. If a product category is not set for wrap display, the plugin will not function.

Also on this page, under “Cart/Checkout Gift Wrapping Options,” you can add links on the Cart and/or Checkout page in case you want customers to be able to add wrap to their order. Options include “before cart,” “after cart” “after coupon/before collaterals,” and “before checkout.” When the prompt for wrap is clicked, the wrap options will open in a slide-out or a Bootstrap modal/pop-up, depending on your settings.

This plugin has two settings pages. The second is at yoursite.com/wp-admin/admin.php?page=wc-settings&tab=products&section=wcgiftwrapperproduct This page allows you to decide whether and how to show per-product gift wrap options. There is an option to add per-product gift wrapping in three manners:

1) On the product page as a simple, no-frills “add wrap” checkbox before the “add to cart” button
2) On the product page as a slide-out selection with a description and textarea for customer notes
3) On the cart page per line item, under the product name, as a slide-out or pop-up.

Ultimately, there are a LOT of options for presenting gift wrap to customers using this plugin!

Un-Common Issues

Modal doesn’t work in some applications. Additionally, if there are theme and/or plugin conflicts, it may need tweaking before it works for your installation. Try using the Gift Wrapper settings to turn bootstrap loading off; many themes and plugins already load these scripts.

This plugin uses the Bootstrap modal, version 4+. It is lightweight and uses minimal CSS and JavaScript to accomplish modal effects. That said, it can interfere with some theme’s CSS, especially if your theme is setting z-index values to <div>s inside the <body> tag. If your site is already experiencing JavaScript errors (check your browser console for errors), the modal may not work. Those errors will need to be cleared up first before this plugin can do its job. Please get in touch if you’re having trouble getting the modal to work.

Styling issues. Due to the staggering number of themes and individualized shop arrangements, this plugin could not possibly satisfy everyone out-of-the-box. However, it contains a number of highly customizable templates and hooks, which should allow you to achieve your desired results. See below for how to use the templating system to make changes to how gift wrap products are shown.

Bottom line: Using your friendly local Wordpress developer’s services, you can make this plugin look however you need it to look.

Translating Details

If you are using WPML and struggling to translate the “details” field, it’s because it is stored in the wp_options database table. WPML doesn’t peruse these table entries unless asked to. This makes it a little trickier to translate, but not too tricky! Learn how to translate details stored in wp_options using WPML here.

Modal Use

This plugin uses a standard Bootstrap modal, which uses jQuery. Many themes also use a Bootstrap modal, and so if you find trouble with modals showing, you might want to dequeue the Bootstrap JavaScript (JS) in the Gift Wrapper settings. Using Bootstrap documentation and CSS/HTML, you will be able to adjust styling of your modal ad lib using the plugin’s templating system.

Using Templates

If you would like to change the structure or appearance of gift wrap lists and modals, you can use the Gift Wrapper templating system to do that easily. You will need to create a folder called woocommerce in your theme — or better yet — child theme folder. Inside that folder, create another folder called wcgwp. Move any overwritten plugin template files into this wp-content/theme/woocommerce/wcgwp folder, and your changes will be visible. Read more information on WooCommerce templating here.

Available hooks

Filter hook ‘wcgwp_hide_details‘ allows you to hide the gift wrap “details” (explaination) area above the wrap selection and note textarea. Example use (in theme functions.php file, for example):

add_filter( 'wcgwp_hide_details', '__return_true' );

Filter hook ‘wcgwp_change_thumbnail‘ will allow one to change the image size for gift wrap options. Default is “thumbnail.” An example of how to change to another established image size (such as “full”)is as follows:

add_filter( 'wcgwp_change_thumbnail', 'full' );

Change gift wrap listing Order & Order by parameters

By default, gift wraps are listed by date posted, newest first. This can be changed with the filter hooks ‘wcgwp_order‘ and ‘wcgwp_orderby‘. For instance if you wanted to re-order them by title A-Z instead of date newest first, you could add the following code to your functions.php file:

add_filter( 'wcgwp_orderby', function() {return 'title';} );
add_filter( 'wcgwp_order', function() {return 'ASC';} );

Learn more about available query parameters here.

Gift wrap name display

Filter hook ‘wcgwp_add_price_to_name‘ allows one to decide if the price will be shown with the gift wrap item.

Filter hook ‘wcgwp_display_item_meta‘ allows one to show price meta in order confirmation, etc.

Filter hook ‘wcgwp_product_name‘ allows one to change the appearance of the gift wrap product name for the simple gift wrap option.

Dealing with virtual products

Filter hook ‘giftwrap_exclude_virtual_products‘ allows one to turn off giftwrap offerings when only virtual products are in the cart.

Filter hook ‘wcgwp_virtual_products_only‘ allows one to fool the Gift Wrap plugin into thinking there are or aren’t all virtual products in the cart.

Filter hook ‘giftwrap_single_virtual_products‘ would allow you to still show gift wrap options for a virtual product. You would change it to true as follows, in your functions.php file (or in a custom plugin):

add_filter( 'giftwrap_single_virtual_products', '__return_true' );

Filter hook ‘wcgwp_remove_cod_gateway‘ would allow you to hide the COD payment option if your cart contains a gift wrap product (this might suggest the cart is a gift, and the recipient shouldn’t have to pay for it). You would change it to true as follows, in your functions.php file (or in a custom plugin):

add_filter( 'wcgwp_remove_cod_gateway', '__return_true' );

There are even more filters which your developer will find digging around the code. Need new hooks or tweaks? Please get in touch – we are happy to help!

More information

More information is available via the FAQ on the free version in the Wordpress repository.

Purchase or renew Woocommerce Gift Wrapper Plus here.

Get in Touch

Questions? Please get in touch.

Please do not use the Wordpress.org forum to seek support for or review this – or any other paid – plugin. That is against Wordpress.org policy, and you will get much faster help if you email us directly. Thank you!