For many shops, adding a gift-wrapping option is critical, as the majority of products purchased are sent as gifts and require that special royal treatment in presentation to their final recipient. This recipe shows you how to specify different gift wrapping options for a set fee, enable taxing if applicable, and offers the option to add a gift card with a personal message too. This module is coded in such a way that you are also able to offer different gift-wrapping papers to customers viewing your site in different languages; this means that you have the flexibility to offer wrapping paper with text in specific languages to specific customer groups.Chef’s suggestion:This module is written to send all the items in a specific order gift wrapped. If you prefer to offer a gift-wrapping selection to each product instead, use the attribute options feature offered by default osCommerce templates. Create a new option group called Gift Wrapping, create option values for
the gift wrapping paper choices, and assign them to
each product.
IngredientsNew:catalog/includes/modules/order_total/ot_giftwrapping.php
catalog/includes/languages/english/modules/order_total/
ot_giftwrapping.php
catalog/includes/modules/giftwrapping.phpModified:catalog/includes/functions/general.php
catalog/includes/classes/order.php
catalog/checkout_shipping.php
catalog/checkout_confirmation.php
catalog/checkout_process.phpCooking1. Open catalog/includes/functions/general.php and add the following new function directly above the closing ?> PHP tag to get the cost for gift wrapping: function tep_get_giftwrapping_cost() { global $order, $currencies; $giftwrapping_cost = MODULE_ORDER_TOTAL_GIFTWRAPPING_COST; if (MODULE_ORDER_TOTAL_GIFTWRAPPING_TAX_CLASS > 0) { $giftwrapping_tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAPPING_TAX_
$order->delivery['country']['id'],
$order->delivery[‘zone_
if (DISPLAY_PRICE_WITH_TAX == ‘true’) { $giftwrapping_cost += tep_calculate_tax($giftwrapping_
$giftwrapping_tax); } } return $giftwrapping_cost; }2. Create the new module file catalog/includes/modules/order_total/
ot_giftwrapping.php using the following code: <?php /*