Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to add fields to the Gift Wrap

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-23-2010, 09:14 PM
 
mmonaco mmonaco is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 33
 

Default 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
__________________
Matt Monaco
X-Cart Gold Plus 4.7.9
Reply With Quote

The following user thanks mmonaco for this useful post:
sabinudash (12-31-2010)
  #2  
Old 06-08-2012, 09:56 PM
 
suraj.vazirani@gmail.com suraj.vazirani@gmail.com is offline
 

Newbie
  
Join Date: Jun 2012
Posts: 5
 

Default 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
__________________
Version 4.4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:25 PM.

   

 
X-Cart forums © 2001-2020