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

make send2friend a new form

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-27-2005, 12:30 PM
 
pablo pablo is offline
 

Member
  
Join Date: Aug 2005
Posts: 27
 

Default make send2friend a new form

Hi,

I am trying to create an enquiry form on each product on the product detail page; ie product.tpl

I thought using send2friend as a base would be a good idea, as then it would include the productid each time, just need to change the send to email to send to me and add one text field.

However, my new send2friend2.tpl seems to get confused with the original, I can't separate them out - keeps saying that I have missed out the recipients name, even though I have removed it from my template along with the checking scripts.

While I know a bit about the templates, I don't think I know enough about the php files

I have added this line to product.php

include $xcart_dir.DIR_CUSTOMER."/send_to_friend.php";
include $xcart_dir.DIR_CUSTOMER."/send_to_friend2.php";

and then obviously duplicated one to the other.

What else do I need to do - what variables would I change,

Any pointers at all would be great, as I'm sure they would help me come up with the full solution.
__________________
Version 5.3
Reply With Quote
  #2  
Old 10-27-2005, 04:19 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

make sure the forms dont share the same name
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-28-2005, 12:33 AM
 
pablo pablo is offline
 

Member
  
Join Date: Aug 2005
Posts: 27
 

Default

Hi,

Many thanks for taking the time to reply - I think it is getting somewhere - but at the moment that somewhere is an access denied - error ID:33

I think it may be something to do with my new php script that I am calling from product.php.

This is just a duplicate of send2friend.php:

Code:
if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); } if(!$productid) func_header_location ("error_message.php?access_denied&id=48"); if($mode == 'send') { if($email && $from && $name) { $mail_smarty->assign ("product", $product_info); $mail_smarty->assign ("name", $name); func_send_mail ($email, "mail/send2friend_subj.tpl", "mail/send2friend.tpl", $from, false); $top_message["content"] = func_get_langvar_by_name("txt_recommendation_sent"); } else { $top_message["content"] = func_get_langvar_by_name("err_filling_form"); $top_message["type"] = "E"; } func_header_location("product.php?productid=".$productid); } ?>

It has references to Access denied (although one is ID:48 )

Is there anything else I should be changing here or adding somewhere?

Thanks
__________________
Version 5.3
Reply With Quote
  #4  
Old 10-28-2005, 03:30 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

Code:
if($email && $from && $name)

notice there that it checks for active variables
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 10-28-2005, 04:01 AM
 
pablo pablo is offline
 

Member
  
Join Date: Aug 2005
Posts: 27
 

Default

Thanks, do these need to match then with the ones in the duplicate template:
customer/main/send2friend.tpl

perhaps in the Array at the top:

Code:
var requiredFields = new Array(); requiredFields[0] = new Array('send_name', "{$lng.lbl_send_your_name|strip_tags|replace:'"':'\"'}", false); requiredFields[1] = new Array('send_from', "{$lng.lbl_send_your_email|strip_tags|replace:'"':'\"'}", false); requiredFields[2] = new Array('send_to', "{$lng.lbl_sent_recipient_email|strip_tags|replace:'"':'\"'}", false);

I presume I need to remove the last one, as I am not asking for this to be inputted anymore?

Further, I am presuming in:
customer/home_main.tpl

I need to make this:

{elseif $main eq "send_to_friend2"}
{include file="customer/main/send_to_friend2.tpl"}

but am not sure how this ties in with the php, ie how is this $main variable defined?
__________________
Version 5.3
Reply With Quote
  #6  
Old 10-28-2005, 04:03 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

yeh,

remove anything that you dont need and make the change in home_main

the main variable gets created by the php files and used by the tpl files
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 03-11-2006, 04:25 PM
 
junaid junaid is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 96
 

Default

this might help
http://forum.x-cart.com/viewtopic.php?t=27245
__________________
xcart 4.18 on linux
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 03:05 PM.

   

 
X-Cart forums © 2001-2020