Documentation

Installation

This plugin works in conjunction with WooCommerce for WordPress. WooCommerce must be activated on your WordPress site to continue.

To Install Gift Wrapper Plus Plugin

Deactivate and delete the free version of Gift Wrapper. It is not required going forward. Settings from the free version are safe in the database and will be used in the paid version. However, if you are using template overrides in the free version, you will need to integrate those manually into the paid version.

  1. Unzip the woocommerce-gift-wrapper-plus.zip (ZIP) package *
  2. Upload the entire “woocommerce-gift-wrapper-plus” folder to the “/wp-content/plugins/” directory
  3. Activate the plugin through the “Plugins” menu in WordPress

More about how to install manually via FTP/SSH.

Another different way to install a plugin is to go to Plugins -> Add New, click “Upload Plugin” and upload the plugin ZIP file. Then activate the plugin.

Managing License Keys

Once Gift Wrapper Plus is installed and activated on your site, head over to the WooCommerce tab -> Settings -> Gift Wrapper Tab -> License Key. Activate your license key to get full access to all settings panels for setup.

Please note the plugin functions and gift wrapping occurs without the license key activated. However, if the license key expires or is inactivated, advanced settings panels will be inaccessible, and no automatic updates will be fetched.

Screen capture of license key screen in Gift Wrapper settings

  1. Enter your license key
  2. Click the “Activate License” button to activate your license. OR, click the “Deactivate License” button to deactivate your license if it is active

Deactivating your license on this screen will make the license available to be used on another site. You can also check the status of or deactivate license keys at your Gift Wrapper online account (www.www.giftwrapper.app/account) pages.

do not count toward your license key activation count.

If your URL matches the following, it does not count toward key activations:

  • localhost
  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
  • *.dev
  • *.local
  • dev.*
  • staging.*

Plugin Updates

Activating the license allows your plugin to seek automatic updates via API. This is triggered twice a day by the ‘wp_update_plugins’ WordPress action hook.

If your website is not connecting to the API or fetching updates, you might want to make sure a site or server firewall isn’t blocking connections to the www.giftwrapper.app domain.

If you can’t wait 12 hours or auto updates aren’t working, you can fetch the latest version of the plugin anytime at www.giftwrapper.app/account.

Basic Wrap Set Up

Each Gift Wrapper wrap is a WooCommerce product (a WordPress post type). That allows gift wrap to be taxed, discounted, inventoried, etc. This basic setup must be performed in order for Gift Wrapper to work.

  1. Create a unique WooCommerce product category (Products -> Categories) for your gift wrap product(s). Examples of WooCommerce category names could be “Gift Wrap” or “Gift Cards” or “Condiments.”
  2. Create at least one WooCommerce product (Products -> Add New) called “Red Gift Box” or “Fancy gift bag” or “Illustrated gift card” or “Soy Sauce”… or whatever you desire. The product needs a name and a price. You can also add a featured image, description, tax details, and inventory if desired.
  3. Add your new Woo product(s) from step 2 to your product category from step 1.

Plus Settings

The Gift Wrapper Plus (paid version) plugin has a WooCommerce settings tab with sub-sections, and some settings on every product edit page. If you have used the free version, you are familiar with the main “Order Wrapping” settings page. Please test your gift wrapping options by making mock purchases before going live to make sure it works and looks great!

General Options

Head over to the Gift Wrapper settings tab, under the “General Options” sub-tab at yoursite.com/wp-admin/admin.php?page=wc-settings&tab=gift-wrapper-plus

The first setting — the “Gift wrap category” setting — should be the same as the category created above (step 1). If a product category is not set for general or per-product wrap display, the plugin will not function.

Hide the Textarea Box

If you don’t want customers entering notes, then set the textarea length to 0 (zero) in the settings.

how to hide the gift wrap textarea

Order Wrapping Options

Under “Order Wrapping” tab, you can add prompts (e.g. “Add Gift Wrap?” buttons) almost anywhere on the WooCommerce cart and/or checkout page(s). Customers can use these prompts to add gift wrap (or another add-on) to their entire order. These settings apply to wrap added to the order. Learn more about settings that apply to wrap added to any individual product.

Built-in prompt locations

The plugin comes with six built-in placement options for gift wrap prompts. The names of the hooks speak for themselves as far as where they are on the cart/checkout pages.

  1. ‘woocommerce_before_cart’
  2. ‘woocommerce_before_cart_collaterals’
  3. ‘woocommerce_cart_collaterals’ (PLUS version only)
  4. ‘woocommerce_after_cart’
  5. ‘woocommerce_before_checkout_form’
  6. ‘woocommerce_after_checkout_form’

This video shows five of the locations. Other locations are possible. The easiest way to add a different Gift Wrapper prompt location to other locations is to choose “other” in the “Gift Wrap prompt location” setting, the enter the name of the PHP action hook from your theme. If you have more than one “other” hook, separate them with commas. Make sure to save your settings.

Custom wrap locations – programmatically

If adding a hook name in the settings is too easy for you, and you’d prefer to write some code, here is how to do that:

Here is an example of how to use the `custom_wrap_location` method to add wrap prompt to the `woocommerce_cart_contents` hook inside the Woo cart template:

function my_custom_wrap_location() {
    if ( method_exists( 'Gift_Wrapper_Plus_Wrapping','custom_wrap_location' ) ) {
        // 'wcgwp_custom_location' is a label that will be used for class tags in the DOM
        // Change the label ad lib
        WCGWrap()->wrapping->custom_wrap_location( 'wcgwp_custom_location' ); 
    } 
}
add_action( 'woocommerce_cart_contents', 'my_custom_wrap_location', 10 );

MOST themes include at least one of these standard WooCommerce hooks. If your theme developer was naughty and removed or overrode any of these hooks, the prompts may not show. It is up to you to either choose another of the five prompt locations, find an “other” action hook in the theme to work with, or work with your theme developer to devise a solution.

Since version 6.0 of Gift Wrapper, wrap is added to the cart using AJAX and not a form submit, so the gift wrap options can be anywhere on the cart/checkout pages. They no longer need to be inside the cart/checkout <form>.

Order Gift Wrap / Add-on prompt types

Depending on the “How should options be displayed?” setting, when the prompt for wrap is clicked, the wrap options will open in a slide-out, a modal/pop-up, or show a simple checkbox. There are two types of modal; one has radio buttons or checkboxes for selections, the “alt” version does not show radio buttons or checkboxes. (Checkboxes are shown when “Allow multiples?” in the General Options is checked, to allow the customer to chose more than one gift wrap or product add-on.) Try them out to see which you prefer.

Screenshot of WordPress gift wrapper plugin peri-cart checkbox
Peri-cart checkbox display option

The single checkbox prompt, when clicked, adds wrap to the cart using AJAX. When un-clicked, wrap is removed. Since all order wrap is added as cart items (unique items in the cart), they can be removed using the native WooCommerce remove “X” item feature. In the example above, the textarea is hidden by setting the “Textarea character limit” to 0 in General Options.

Product Wrapping Options

Per-product wrapping settings, for both on product pages and inside the cart (cart item), is under the “Product Wrapping” tab.

If you wish to create special rules for specific products, additional settings panels are found in each product editor screen, in WooCommerce’s “Product Data” panel.

Product Gift Wrap / Add-on prompt types

The “Product Wrapping” section allows you to decide whether and how to show per-product gift wrap options. There are several options to add per-product gift wrapping:

  1. On the product page as a simple, no-frills “add wrap” checkbox and optional textarea near the “add to cart” button
  2. On the product page as a slide-out selection with a description and optional textarea for customer notes
  3. On the product page as a pop-up/modal (two modal styles possible) with optional textarea for customer notes
  4. On the cart page per cart item, under the product name, as a slide-out or pop-up/modal

Per-product setting overrides

If you are offering per-product wrapping, you may want to set wrap differently for different products. Visit the product with the wrap you want to edit, and click the Gift Wrapper tab. This tab is in the same section as the price/inventory/attributes settings. You will see the option to override the default/global wrap settings for this product:

woocommerce per product gift wrap settings

With this panel, you can also turn OFF the option to gift wrap certain items even though most other things in your catalog get wrapped. For example, you might not want to gift wrap pianos or refrigerators, just the smaller things.

This options tab focuses on WooCommerce product page wrap and cart item wrap. Just like under the General Options tab, you can set a separate category for products (under the Product Wrapping tab). Unlike the “Order Wrapping” category setting, this product category setting is not required for the plugin to work.

You can exclude products in your catalog from gift wrapping using the “Exclude product categories” setting. This is handy for excluding very large or heavy items.

What is a “Cart Item?”

You will notice the use of the term “cart item” or “line item” in this plugin. WooCommerce calls it a “cart item.” A cart item is a row in the cart, usually one item/product. A cart might have several cart items (line items) inside, and with Gift Wrapper, each cart item can be wrapped individually if you desire.

Attribute vs. Cart Item wrapping

You will also notice that products can have wrap added as an attribute or as a separate cart item. Each cart item can have an attribute, but attributes cannot have cart items.

When choosing to sell gift wrap or add-ons as either an attribute or cart item, remember t he biggest difference is cart items can be taxed, inventoried, discounted and fees applied separately, whereas attributes cannot.

Ratios of product : wrap

Using Gift Wrapper settings, ratio of cart item to gift wrap can be kept

  • One-to-one. A 1:1 ratio with one wrapping per each product. 3 qty products? 3 wrap.
  • Only one wrap no matter how many quantity cart item, or
  • Up to parent item quantity, or
  • Up to cart item quantity, or
  • Ad lib quantity, any quantity of wrap per cart item

gift wrap product wrapping woocommerce ratios setting screenshot

This setting applies to cart-item gift wrapping on the cart page, and could help prevent customers ordering too much or too little wrap.

Translating Gift Wrapper

The Gift Wrapper is fully translation-ready, and also compatible with WPML and Loco Translate. There are numerous online guides about how to translate WordPress plugins, and quite a few plugins exist to assist. Here’s a place to start, with some background and decent advice on how to go about with translating ANY plugin (including Gift Wrapper Plus).

Read here if you only use one language on your site and prefer to use hooks to just change the wording on some customer-facing strings.

If you don’t understand WordPress localization or hook use and don’t have time to learn, and are only using one language, a quick way to change Gift Wrapper default text strings is with the handy built-in string editor. It has its own settings tab called “Language” in the Gift Wrapper main settings area.

woocommerce gift wrapper language-translation strings screenshot

Simply go to the Language options panel and enter what you’d prefer each string to be instead of the default.

Gift Wrapper Plus uses a vanilla JS modal which will not conflict with theme modals.

This modal uses Bootstrap styling, which is good for anyone using Bootstrap themes, Bootstrap plugins, or for those who customized their Gift Wrapper modals previously. It’s good for anyone, really, because with template overrides and CSS tags it can be made your flavor of rad.

Using Bootstrap documentation and CSS/HTML, you will be able to adjust styling of your modal ad lib using the plugin’s templating system. For example, you could get a small popup window instead of a large one by editing your modal template (modal.php or modal-product.php depending on modal location, cart/checkout or product page) to use the ‘modal-sm’ instead of ‘modal-lg’ inside the ‘modal-dialog’ <div>. Alternatively, if you’re familiar with WP hook use, you can use the ‘wcgwp_modal_size’ filter hook to change to the ‘modal-sm’ size.

You can also choose to animate your modal entry and/or exit with the choice of over 1500 CSS animation combinations, with the click of a button (no coding required).

gift wrapper modal animation.css settings
Gift Wrapper modal animations settings panel. There are forty CSS animation styles for the gift wrap pop-up, meaning a ton of combinations are possible!

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. You will need to create a folder called woocommerce in a child theme folder if it doesn’t already exist. (Learn what a child theme is, why use one, and how to make one.) Inside that ‘woocommerce’ folder, create another folder called wcgwp.

Move any overridden (over-written) Gift Wrapper plugin template files into this wp-content/child-theme/woocommerce/wcgwp folder. Any code changes you’ve made to that new template file inside the child-theme will be visible online. Read more information on WooCommerce templating.

For example, if you wanted to alter and style the modal on a single product page, the template you’d look at is in the woocommerce-gift-wrapper-plus/templates/wcgwp/v6/product/ folder, called “modal.php”. Copy and move that php file to your child-theme-whatever-its-called/wooommerce/wcgwp/v6/product/ folder. At that point you can make changes to the modal display. You will want to make sure you keep the basic Bootstrap modal syntax intact, so that the modal continues to function. Changing modal form input names for product templates is also strongly discouraged, as it will also break function. If you have suggestion for DOM items or CSS tags which could help everyone and prevent you from templating, please get in touch.

Mini carts and cart drawers

Gift Wrapper is designed to show wrap prompts in the cart, checkout and single product pages. If you have a fancy theme or plugin which adds functionality to WooCommerce such that it shows a more detailed cart on other pages of your website, the Gift Wrapper prompts (esp. for modals) might not work without additional coding. This is in consideration but not planned for addition to Gift Wrapper as a feature, and you will need to build it on your own. For now, we recommend hiding cart item add gift wrap prompts while on other pages than the cart/checkout pages, using a filter such as:

function maybe_no_show_after_cart_item_name( $bool = TRUE, $cart_item, $cart_item_key ) {
    if ( ! is_cart() && ! is_checkout() ) {
        $bool = FALSE;
    }
    return $bool;
}
add_filter( 'wcgwp_continue_after_cart_item_name', 'maybe_no_show_after_cart_item_name', 10, 3 );

or selectively remove WooCommerce’s ‘woocommerce_after_cart_item_name’ action hook if not on the official WooCommerce cart/checkout page. Default (non-fancy, for lack of a technical term) mini carts do not include this action hook, and will not give you grief.

Action & Filter Hooks

Editing templates works, but is less future-forward than using hooks. This means that if a parent template is updated/changed by the developer for better function or to fix an issue, and you don’t have time to also fix your template override, you might have problems. Updates to templates ARE announced on your backend with plugin updates, so at least you will have warning.

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

add_filter( 'wcgwp_hide_details', '__return_true' );

Boolean filter hooks ‘wcgwp_continue_after_cart_item_name’ and ‘wcgwp_show_product_wrap_prompt’ allow for more granular (e.g. product-by-product) control of whether “add gift wrap” prompts are shown. Their parameters, $cart_item and $cart_item_key, and $product_id (respectively) would allow you to inspect the cart item and determine if you wish to proceed with offering wrapping for it or not.

Edit Text Displayed

Boolean filter hook ‘wcgwp_add_price_to_name‘ allows one to decide if the price will be shown with the gift wrap item. Default true. To change that, use:

add_filter( 'wcgwp_add_price_to_name', '__return_false' );

Filter hook ‘wcgwp_filter_link_in_cart‘ allows for adjusting the output of the gift wrap product link which brings your customer to the full gift wrap product page. This is set to NOT link back to the gift wrap product page.

Filter hook ‘wcgwp_add_wrap_prompt‘ allows for changing the “Add gift wrap?” prompt text, when template changes or WP translation can not or will not be used. Similarly, ‘wcgwp_add_wrap_message‘ allows you to change the “Add Gift Wrap Message:” text.

In the following example, the “Add gift wrap?” text is changed to read “Gift wrapping?”

add_filter( 'wcgwp_add_wrap_prompt', 'wcgwp_change_wrap_prompt', 10, 1 );
function wcgwp_change_wrap_prompt( $prompt ) {
    $prompt = 'Gift wrapping?';
    return $prompt;
}

In the following example, the “Add Gift Wrap Message:” text is changed to read “Add a note?”

add_filter( 'wcgwp_add_wrap_message', 'wcgwp_change_wrap_message', 10, 1 );
function wcgwp_change_wrap_message( $msg ) {
    $msg = 'Add a note?';
    return $msg;
}

If you are uncomfortable editing your child theme functions.php file, you can use the plugin “Code Snippets” to add this PHP to your WordPress installation.

Filter hook ‘wcgwp_line_item_parent_name‘ and ‘wcgwp_product_parent_name‘ allow for altering how a wrap product’s parent product name is displayed in the cart and admin, when wrap is added as its own cart item. Associating it with its parent product (the product to be wrapped) helps the customer and admin see the correlation between the two.

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'; } );

A more popular configuration might be to use menu_order, to take advantage of drag-and-drop-style product menu re-ordering. Accepts: ‘none’, ‘ID’, ‘name’, ‘type’, ‘rand’, ‘date’, or ‘modified’

add_filter( 'wcgwp_orderby', function() { return 'menu_order'; } );

Default is descending (DESC) order. You could switch this to ascending using:

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

The post query arguments (for looking up wrap items) can be filtered using the ‘wcgwp_post_args’ hook. In rare circumstances this might be desired, or perhaps necessary. Learn more about available query parameters here.

Change thumbnail sizes

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 existing WordPress image size (such as “medium,” “large” or “full”) is as follows:

add_filter( 'wcgwp_change_thumbnail', 'wcgwp_change_thumbnail_full', 10, 1 );
function wcgwp_change_thumbnail_full( $size ) {
    $size = 'full';
    return $size;
}

Dealing with virtual products

By default, this plugin will hide gift wrapping options if only virtual product is in the cart.

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

add_filter( 'giftwrap_exclude_virtual_products', '__return_true' );

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 (when there are). This would cause gift wrap options to show even when you have a cart full of virtual product. Example of use:

add_filter( 'wcgwp_virtual_products_only', '__return_false' );

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' );

You could also use the ‘wcgwp_change_gateways‘ filter hook to name which payment gateways show when gift wrap is in the cart.

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!

Make wrap options visible by default

Gift Wrapper generally keeps the gift wrap options hidden until the customer clicks a prompt. This is because gift wrap takes a good amount of screen real estate, and in many shops, perhaps most, most orders are not gift-wrapped. To have gift wrap (slide-outs, not modal) show by default, try using this CSS:

body .wcgwp-wrapper .wcgwp-slidedown { display: inline-block }

If using version 5.0 or under, we also recommend dequeuing the related Javascript:

For cart/checkout area slide-outs:

function dequeue_wcgwp_cart_scripts() {
    wp_dequeue_script( 'wcgwp-slide-cart-checkout' );
}
add_action( 'wp_enqueue_scripts', 'dequeue_wcgwp_cart_scripts', 99 );

For product page slide-outs:

function dequeue_wcgwp_product_scripts() {
    wp_dequeue_script( 'wcgwp-slide-product' );
}
add_action( 'wp_enqueue_scripts', 'dequeue_wcgwp_product_scripts', 99 );

This saves extra, unnecessary JavaScript loading on your pages and also prevents possible errors with orphaned code.

The Is-There-Wrap-in-Cart? Conditional

Gift Wrapper has a helper class that checks for gift wrap in the cart. The wcgwp_wrap_in_cart() function returns boolean TRUE if there is wrap. It can be used for things like adding a Gift Wrap handling fee, for example:

function maybe_add_giftwrap_fee() {

    if ( ! class_exists( 'WC' ) || ! class_exists( 'Gift_Wrapper_Plus' ) || ! wcgwp_wrap_in_cart() ) {
        return; // exit if there is no gift wrap in cart
    }
    // add a $1 fee with the title “Gift Handling Fee"
    WC()->cart->add_fee( __( 'Gift Handling Fee', 'woocommerce' ), 1 );
	
}
add_action( 'woocommerce_cart_calculate_fees', 'maybe_add_giftwrap_fee' );

WooCommerce add to cart validation

If your shop shows the gift wrap products in the catalog (the products are not hidden) and you want to avoid people adding them to an empty cart, or to a cart with only other gifts, or to a cart worth $0, you could use code like the following:

function gift_wrapper_cart_validation( $bool, $product_id, $quantity ) {
    // Only continue if we are trying to add gift wrap
    if ( ! wcgwp_is_wrap( $product_id ) ) {
	return $bool;
    }
    // Cart is empty
    if ( WC()->cart->is_empty() ) {
	return false;
    }
    $index = 0;
    $contents_count = WC()->cart->get_cart_contents_count();
    foreach ( WC()->cart->get_cart() as $cart_item ) {
        if ( wcgwp_is_wrap( $cart_item['product_id'] ) ) {
            ++$index;
	}
    }
    // All items in cart are gift wrap
    if ( $contents_count == $index ) {
        // Empty the cart
	WC()->cart->empty_cart();
	// Don't add anything more (or change to true to allow more)
	return false;
    }
    if ( WC()->cart->get_total() == 0 ) {
        return false;
    }
    return $bool;

}
add_filter( 'woocommerce_add_to_cart_validation', 'gift_wrapper_cart_validation', 10, 3 );

Troubleshooting

  • Make sure your gift wrap product has a price, even if that price is zero ($0). WooCommerce products must have prices for WooCommerce to function.
  • Complete a basic plugin troubleshooting process. This includes briefly activating a basic WP theme like twentytwentythree or twentytwentytwo to see if the problem persists. If the problem goes away, it means the issue is somewhere in your chosen theme. Keep reading below about some common theme issues.
  • Especially if you think there might be a JavaScript (JS) issue (such as with modals or slideToggles not working), Take a look at your browser console, watch for errors (usually highlighted in red). JavaScript errors are especially common if you are running a lot of WordPress plugins, or are minifying/compressing your site JS.
  • As always, when a web page isn’t loading as expected on the Internet, clear your browser caches. If you are using a WordPress caching plugin, or your server is caching, clear those caches as well.
  • 500 error or critical error or WSOD (white screen of death)? Make sure WordPress debugging is enabled so that you can quickly get to the root of the problem by reading through error messages in your wp-content/debug.log file. Or send us the file and we will read it for you!

No joy? Get in touch!

Theme Issues

Every once in a while we get a report that the Gift Wrapper plugin “doesn’t work.”

Putting aside the fact that it’s just not enough information to help anything, oftentimes we find it’s not the plugin that is “broken.” It’s the theme.

We can easily confirm this by quickly testing the plugin with different WordPress themes. If Gift Wrapper works with other themes, then the problem is unique to the theme in use.

Due to the staggering number of WordPress themes and individualized shop arrangements, Gift Wrapper could not possibly satisfy everyone out-of-the-box. Sometimes the plugin seems to be missing functionality. Often we find that is because the user’s current theme has removed hooks necessary for plugin functioning or has aggressively styled WordPress with CSS z-indexing. This is a bit beyond our control, but usually a work-around can be found in cooperation with the theme developer.

Gift Wrapper contains a number of highly customizable templates and hooks, which should allow you to achieve your desired results. See above for how to use the templating system to make changes to how gift wrap products are shown.

Things themes do wrong

More and more we are finding that premium WordPress themes (with WooCommerce “support”) are doing one or two things with their code which interferes with how plugins can cooperate to make a great website.

  1. Z-index issues
  2. Hook (action/filter) issues
Z-index issues

Themes and plugins sometimes use CSS z-indexing to create stacking panels, for example, sticky headers that hide a part of the screen below. Unfortunately, Wild West <div> stacking, with numerous plugins and then the theme all setting z-indexing, can prevent pop-ups/modals from showing. If your pop-up is greyed out and you can’t click its buttons, maybe first check your browser error console to make sure you don’t see any JavaScript issues. If you don’t see JS errors, it’s probably just CSS z-indexing getting in the way. Often z-indexing can be re-stacked with some custom CSS added to your child theme or WP/theme options “custom CSS” panel.

Here are some helpful reference articles to help you learn more about z-indexing:

4 reasons your z-index isn’t working (and how to fix it)

The Z-Index CSS Property: A Comprehensive Look

Hook issues

Plugins sometimes remove or re-arrange critical WooCommerce hooks that developers use to add functionality. As soon as these hooks are added back in, plugins like ours start working again.

Another problem is more and more people are leaning on page builders to do simple WordPress work. I consider this a lot like doing your own plumbing or electrical work. It might work… for a while. Thing is, page builders rob a WordPress site of action hooks which 3rd party plugins require. So, a person might get the page looking closer to what they dreamed; however, it’s now less likely to function with all plugins, Gift Wrapper included. If you relied on a page builder (Divi, Avada, Beaver, etc) to construct your product, cart and/or checkout pages, don’t expect Gift Wrapper to function, becuase you’ve likely removed core WooCommerce functionality from your site. (All said, please note: Gift Wrapper DOES have an Elementor widget.)

With these hooks in place, the Gift Wrapper “add wrap” button prompts will show. Without these hooks, your site will look almost as if Gift Wrapper didn’t exist – likely because a theme or page builder has removed the core code it normally “hooks” into.

An example of missing hooks

The Bridge theme, with over 125,000 sales, has inexplicably removed the hook ‘woocommerce_after_cart_item_name’ from the woocommerce/cart/cart.php template. For the Gift Wrapper plugin, this hook allows the “Add Gift Wrap?” prompt to show after each cart item product name in the cart. So, for customers trying to use Gift Wrapper with the Bridge theme, that prompt does not show.

If your theme authors have for some reason tampered with the ‘woocommerce_after_cart_item_name’ hook, e.g. removed and re-named it, the prompt link for wrap will not show.

Let’s fix the Bridge theme. The quickest option is to create a cart.php WooCommerce template override in a child theme /woocommerce/cart folder, and add the hook back in!

do_action( 'woocommerce_after_cart_item_name', $cart_item, $cart_item_key );

The line above is the hook needing back in. Where to add in that line of code? Add it in right before where you see this line:

/*** Our code modification inside Woo template - end ***/ 

The hook omission in the Bridge theme is still in place as of version 19.2.1, but was noted in version 18.0.6. I contacted the theme developers and didn’t hear back. For other themes, you will add the line


near (before or after) where you see the line:

The Moral

The moral of the story is… WordPress and WooCommerce use “hooks,” like clothes hooks, on which plugins can hang their functionality. Themes and plugins can also remove hooks, or move hooks. If some of those hooks are missing because the theme has removed them, third-party plugins have no way to add functionality. If the problems with the theme are not addressed, the user will continue to struggle with plugins. Themes advertising WooCommerce compatibility should NOT be entirely removing WooCommerce hooks.

Themes confirmed to work:

Astra
Avada (needs Bootstrap JS dequeued in Gift Wrapper settings)
Divi
Flatsome
GeneratePress
Go (from GoDaddy)
Hello Elementor
OceanWP
Storefront
WordPress’ Twentytwelve through Twentytwenty
Woostify

Themes with confirmed troubles:
The following themes remove the necessary ‘woocommerce_after_cart_item_name’ action hook:
Bridge (includes z-indexing on product pages which interferes with modal)
Claue
Martfury
Node (similarly to Bridge theme, has removed the ‘woocommerce_after_cart_item_name’ hook so line item wrap prompts do not show)
Shopkeeper (z-indexing issues interfere with modal)
The Retailer (“after cart” wrapping covered up by rest of cart, and disappears. Try this CSS to un-bury it: .giftwrap_after_cart{clear:both})
If you are using one of these themes, we recommend you contact the theme authors and request they add the ‘woocommerce_after_cart_item_name’ back in place where it should be.

Get in Touch

Questions? Please get in touch. For technical issues, please perform basic troubleshooting before making contact to rule out the usual suspects.

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!

To top