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

send_to_friend.tpl pop up

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-31-2007, 02:36 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default send_to_friend.tpl pop up

I am having trouble creating a seperate page for just a send to friend popup form.

I would like to have a send to friend button on the product page, which will then load a popup window with the send a friend form.


Now I can probably most easily create a rogue php page which takes the current url as a post variable and have a seperate mail form and function to make this happen.


However I would like to try to keep the form in x-cart form, so that it will use the internal css, popup code, and internal language variables and mail functions.

Can anyone point me in the right direction?
__________________
v4.1.8 GOLD
Reply With Quote
  #2  
Old 07-31-2007, 04:48 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: send_to_friend.tpl pop up

I'd go about it this way:

skin1/customer/main/product.tpl
Modify to pop up window url product.php?productid=xxx&mode=showsend when button is clicked for send to friend
remove include of send_to_friend.tpl

send_to_friend.php
Modify to set $main="showstf" and assign to smarty variable if mode=showsend. See first few lines of product.php for how its done.

skin1/customer/home_main.tpl
modify to use customer/main/send_to_friend.tpl when main=showstf

skin1/customer/main/send_to_friend.tpl
modify as desired for your popup window

This way all variables that are available on your product page are available on your send to friend popup page and you use the normal X-Cart sned to friend logic to send the email.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 07-31-2007, 10:42 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: send_to_friend.tpl pop up

i tried to follow your idea.

just to make sure i am doing what you are thinking

i added this to send_to_friend.php :

Code:
$main = "showstf"; if($mode==showsend){ $smarty->assign("showstf",$main); }


other then that i followed your ideas. i could not get it to work, with this instruction the link is now loading the product page over when i click send to friend button / link.

I think this is the right track, but missing something...
__________________
v4.1.8 GOLD
Reply With Quote
  #4  
Old 08-01-2007, 06:03 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: send_to_friend.tpl pop up

Try this in send_to_friend.php:

Code:
if($mode=='showsend'){ $main="showstf"; $smarty->assign("main",$main); }
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 08-01-2007, 10:50 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: send_to_friend.tpl pop up



That code worked. Cheers to you for that!


Now I just have to work on removing the template around the loaded page.

I am having a bit of trouble of where the connection in these files and modifications to calling the overall template to load, and be able to modify that for this particular page load.


[UPDATE]

I have figured a way to do it.

You can have an if statement in home.tpl to load if $main ne showstf

else load home_main.tpl, which will then load only the tell a friend tpl.

is this the best solution in your opinion?
Also with this method it takes a way the ability to dynamically control the title of the window and meta info etc. (copies product page data). Any idea on how to setup this page with logical control of these items from xcart for my new window. I have not yet worked with the static page creation of x-cart, is it possible to create a static page in xcart admin with meta and title control, and then somehow load the mod into this static page?

One other problem I am having is that when i close out the pop up window, the main window on the next page click will show the notification box that states my recommendation has been sent, which of course is not good. Do you have an idea on how to correct this issue?


Thanks and regards.
__________________
v4.1.8 GOLD
Reply With Quote
  #6  
Old 08-02-2007, 06:59 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: send_to_friend.tpl pop up

Right. I wasn't thinking about all the site banner and navigation stuff. What you did should work fine. Probably the best way to go is at the bottom of product.php replace:
Code:
func_display("customer/home.tpl",$smarty);
with:
Code:
if ($main == 'showstf') func_display("customer/main/send_to_friend",$smarty); else func_display("customer/home.tpl",$smarty);
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #7  
Old 08-02-2007, 07:01 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: send_to_friend.tpl pop up

Quote:
Originally Posted by luxor
One other problem I am having is that when i close out the pop up window, the main window on the next page click will show the notification box that states my recommendation has been sent, which of course is not good. Do you have an idea on how to correct this issue?

That message is setup in send_to_friend.tpl. Just take out the line:
Code:
$top_message["content"] = func_get_langvar_by_name("txt_recommendation_sent");
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #8  
Old 08-02-2007, 08:24 PM
 
luxor luxor is offline
 

Senior Member
  
Join Date: Apr 2007
Posts: 120
 

Default Re: send_to_friend.tpl pop up

Quote:
Originally Posted by geckoday
Right. I wasn't thinking about all the site banner and navigation stuff. What you did should work fine. Probably the best way to go is at the bottom of product.php replace:
Code:
func_display("customer/home.tpl",$smarty);
with:
Code:
if ($main == 'showstf') func_display("customer/main/send_to_friend",$smarty); else func_display("customer/home.tpl",$smarty);

Code:
if ($main == 'showstf') func_display("customer/main/send_to_friend.tpl",$smarty); else func_display("customer/home.tpl",$smarty);

did not work. it loads the page without css and the send button does not work.
__________________
v4.1.8 GOLD
Reply With Quote
  #9  
Old 08-02-2007, 09:07 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: send_to_friend.tpl pop up

Quote:
Originally Posted by luxor
Code:
if ($main == 'showstf') func_display("customer/main/send_to_friend.tpl",$smarty); else func_display("customer/home.tpl",$smarty);

did not work. it loads the page without css and the send button does not work.
You'll need to modify send_to_friend.tpl to be a stripped down X-Cart page. skin1/customer/preview.tpl is one you can look at for how to do this - it has the stuff to include the css. You could just gut everything in it between <body> and </body> and plug in the send to a friend stuff. I don't see any reason why the send button wouldn't work though. What does not working mean? Nothing happens at all when you click the button? Or ???
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #10  
Old 07-17-2008, 12:19 PM
  abeight's Avatar 
abeight abeight is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Cleveland, OH
Posts: 479
 

Default Re: send_to_friend.tpl pop up

I got this working, but after you click the send button, the product page shows in the pop-up window. Can that be changed to just say "thank you" or something along those lines?

Once I get this working 100% I'll post all of the code in one entry.

Thanks!
__________________
~ Andrea Beight
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 07:10 AM.

   

 
X-Cart forums © 2001-2020