Woocommerce Gift Wrapper by Product plugin allows put in your product page differents gift wrappers available to the customers. They will be able to choose a one and write a message on the gift tag.

Indice

  • Requirements
  • How does it work?
  • Settings Page
  • Designs Available
  • Add Gift Wrappers
  • FAQ
  • Filters

 

Requirements

  • PHP 5.6 or higher
  • Woocommerce last version

 

How does it work?

The gift wrappers will appears on your product page and the customers can choose different gift wrapper to differentes products in a cart.

This works with simple product and variable product.

If the customer choose a gift wrapper with price greater to 0, it will add to product price when you add to cart.

 

Settings Page

Go to : Woocommerce Settings > Products > Gift Wrapper

  1. Position: it is the place where the gift wrappers available will appear. If you choose “Manually”, you must put it through a PHP function.
  2. Text Link: you can change the link text typing in this input.
  3. Gift Tags: if checked, a textarea will appear and the customer be able of leave a message to the gift.
  4. Character Limit: is the character limit while the customer is leaving a message

 

Designs available

 

Add Gift Wrappers

Go to: Woocommerce > Gift Wrappers

You can add many gift wrappers and filter them. The price es optional, if you put 0, on the front will appear the label FREE!

 

 

FAQ

First, you must know the gift wrappers can be in any place of the product page, don’t on another page.

At the settings page, you must select the position option in Manually.

 

You can put it using a PHP function and a Woocommerce hook.  Here some examples (remember that you must use only one) :

Gift Wrapper
<?php

// above the title
add_action('woocommerce_single_product_summary', 'giftwrapper_print', 1);

// below the title
add_action('woocommerce_single_product_summary', 'giftwrapper_print', 6);

// above the description
add_action( 'woocommerce_after_single_product_summary', 'giftwrapper_print', 5 );

// below of the image principal
add_action( 'woocommerce_before_single_product_summary', 'giftwrapper_print', 25 );

Go to : Woocommerce Settings > Products > Gift Wrapper

Yes. You can use [giftwrapper] but remember that it only can be used on the product page

Filters

1. Change the label FREE by other

Change label Free
<?php

function letsgodev_change_label_free( $items = []) {

	$aux = $items;

	foreach( $aux as $aux_id => $aux_data ) {
		if( isset( $aux_data['price'] ) && $aux_data['price'] == 0 )
			$items[$aux_id]['price_html'] = 'MY NEW LABEL';
	}

	return $items;
}

add_filter( 'giftwrapper/print_gifts/get', 'letsgodev_change_label_free', 10, 1);

Close Menu
×

Cart

Need Help? Chat with us