X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to add fields to the Gift Wrap (https://forum.x-cart.com/showthread.php?t=56708)

mmonaco 11-23-2010 09:14 PM

How to add fields to the Gift Wrap
 
I'm working on adding fields to the Gift Wrap section of 4.4.1. I want to add a "To:" field, and a "Occasion" field.

Here's what i did:

in /modules/Gift_Registry/place_order_extra.php, below this:

PHP Code:

$_extra['giftwrap'] = array(
        
'need_giftwrap'       => @$cart['need_giftwrap'],
        
'giftwrap_cost'       => @$current_order['giftwrap_cost'],
        
'taxed_giftwrap_cost' => @$current_order['taxed_giftwrap_cost'], 


Add these 2 lines:
PHP Code:

'giftwrap_to'    => @$cart['giftwrap_to'],
        
'giftwrap_occasion'    => @$cart['giftwrap_occasion'



In /skin/common_files/modules/Gift_Registry/gift_wrapping_cart.tpl, below:

Code:

      <textarea class="message-text" name="giftwrap_message" rows="5" cols="20">{$cart.giftwrap_message|escape}</textarea>

Add:
Code:

{*MMonaco - 11/23/2010*}
<textarea class="message-occasion" name="giftwrap_occasion" rows="1" cols="2">{$cart.giftwrap_occasion|escape}</textarea>
<textarea class="message-to" name="giftwrap_to" rows="1" cols="2">{$cart.giftwrap_to|escape}</textarea>
{*/MMonaco - 11/23/2010*}



In /modules/Gift_Registry/giftreg_customer_cart.php, below:

PHP Code:

$cart['need_giftwrap']         = $need_giftwrap;
    
$cart['giftwrap_message']     = stripslashes(trim($giftwrap_message)); 


Add:
PHP Code:

//MMonaco Gift Wrap 11232010
    
$cart['giftwrap_occasion']         = $giftwrap_occasion;
    
$cart['giftwrap_to']         = $giftwrap_to;
//MMonaco Gift Wrap 11232010 



You'll quickly notice that the actual input boxes on the checkout screen aren't done. I'll have my web designer do that, but i wanted to post this before i forgot what i did.

One thing i also didn't add was a way to see the variable in admin. I pull it straight from the database for what i do, and i'm really not sure how to get it to show up in the admin section. Perhaps someone can chime in on that.

I hope this helps someone.

Matt

suraj.vazirani@gmail.com 06-08-2012 09:56 PM

Re: How to add fields to the Gift Wrap
 
hello everyone,

can someone help me as to which table does it store thew giftwrap options as i need to show the same on some other page

rgds


All times are GMT -8. The time now is 12:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.