![]() |
Send to Friend on product pages.
If anyone is interested I currently have a simple method to allow users to send products to their friends email address's with a direct link back to the product. If anyone wants such a feature get in touch with me and will work on details, as I'll provide a walk through, with code snippets. This was done with version 3.2.0, but can be done to older versions as well.
|
Send to friend
Hi,
I'd really appreciate it if you'd show me how to add this 'send to a friend' link to my site (www.nothingbutgifts.com). Thanks a lot for your time, I really appreciate it, Kind Regards, Chirin. |
i would definitely be interested if it works for 3.2.1
Thanks ! |
BOOMER! Very slick!
Are major modifications required? v3.2.1 |
Hi Boomer
Hi Boomer,
I also am interested in learning how to do that. Please email or pm me thanks! Japanchick |
I have a very nice javascript tell-a-friend script that works great in html pages.
I'm not sure how to make it work with the product.tpl though. You have to put the <script></script> tag at the beginning which points the the .js file of the tell-a-friend script. The only problem is that in the product.tpl there is already a <script> line. Is it possible to define both <script>'s? Anyone know? |
Hi SeaCoast,
You should be able to include two scripts in the head. I would probably keep them completely separate including enclosing each in it's own {literal} tags. ATKOgirl |
Quote:
I actually tried that and got an "error on page". :? |
Okie so I'm feeling nice today, hopefully the favor can be returned in some way. :roll:
First create a new file called sendtofriend.php under xcart/customer/ Code:
<?php Next we need to let smarty know what template to use: [skin1]/common_templates.tpl add the following after the first if statement: Code:
{elseif $main eq "sendtofriend"} Now create a new file under [skin1]/customer/sendtofriend.tpl and paste the following: Code:
Edit the contents of the template to your liking. And please make a donation as this wasn't a quick easy task, I just see so many are requesting such that would be easier to deal in a mass way, I'm just asking for some help for my time. If you can't get all this working, please email me. |
Forgot to mention you also need to create two other files under [skin1]/mail
First file: [skin1]/mail/sendtofriend.tpl Code:
{$contact.firstname} {$contact.lastname} has recommended a product to you. Next: [skin1]/mail/sendtofriend_subj.tpl Code:
{config_load file="$skin_config"}{$contact.firstname} {$contact.lastname} has recommended a product to you at {$config.Company.company_name}{*$lng.eml_contact_us_subj*} Sorry about that :wink: :!: NOTE: Ooops I forgot to add a / in between mail and sendtofriend.tpl and sendtofriend_subj.tpl sorry about that. |
Also here is how I am linking it in the [skin1]/customer/main/product.tpl
Note that I created my own send2friend.tpl button. You can replace this with a text link if you want. :wink: |
B00MER, i get the following error while using your script:
Code:
Warning: Smarty error: unable to read template resource: "mail/sendtofriend.tpl" in /opt/content/luckylenn.nl/HTML/store/Smarty-2.1.1/Smarty.class.php on line 546 I literally copy/paste your scripts and followed the instructions .. do you have an idea what goed wrong? problem URL is: http://www.luckylenn.nl/store/ |
Norman please see the note I added on the mail templates, I forgot to provide the / inbetween the mail and the template name(s).
|
Nic one Boomer.
But errr.... I get an access denied error.... |
Great job
Works for me. :D
I did add <? in the first line of sendtofriend.php http://www.fishbookstore.com/xcart/customer/product.php?productid=16133&cat=251&page=1 |
I fixed the <? posting on the .php file, sorry about that. :wink:
|
Hi,
When i test send to friend i got : Access denied ! You are not allowed to access that resource! How can i fix it? Thank you. |
????
boomer, same as Norman? What do you mean about the /? in front of what?
:? Please Help! |
The main reason you are possibily getting the error is you need to make sure all the filenames and locations are correct, If my post is somewhat misleading please let me know and I will reimplement it with the latest version of x-cart to see if it is still working correctly.
hth. :wink: |
You were right!
Thanks Boomer, hopefully not coming off like a nag! You were right, had the sendtofriend.tpl in the wrong dir.
8O oops! Thanks Again! |
Great Script
Hi Boomer,
Kudos on the script, you really outdid yourself. I would like to add a slight mod for /customer/home.tpl file, let me know your thoughts on it... -Original Code- Code:
<title>{$lng.txt_site_title} Code:
<title>{$lng.txt_site_title} Hope someone gets some use of it. :D |
I've just discovered that the HTML Catalog makes a shambles of the link for sendtofriend. Is there a tweak that will fix this, as manually editing every product html page ain't gonna cut it? :)
|
Just make the link point directly to the sendtofriend.php file.
Kinda like so: This is on the blazingdragon.com site and it works from the html catalog. ;) |
Dang Boomer! You beat me to the punch. 8O I just made the change and was going to update my post....lol. That was your basic no-brainer after I took a closer look at it. :oops: Thanks for the faster than expected post.
|
Compatible 3.4.3 ????
Hello
Is there anyone who as install this mod with version 3.4.3 ???? Stefan |
3.4.3 here working 100%
yeah I got it workin on 3.4.3 with no issues.
|
Got it working here as well on the newest build.
Got everything optimized to my liking. One question though, how could I get the name of the product into the actual e-mail? I don't need the description, just the name. Great post, got it to work without issues the first time around. |
Here is another small addition to this great mod.
Original [/customer/main/sendtofriend.tpl]: Code:
... Code:
... Code:
... Code:
... Hope this helps a few people. Thanks again for the great mod! |
|
Acess Denied
Great Script Boomer. I see it live on other sites, but for somereason I'm getting an Access Denied error. Here's the URL: www.wittrans.net/wittcart/customer/home.php
And I checked the file locations. Any ideas? |
hey just got this script working works like a charm. Just make sure you put sendtofriend.php in xcart/customer not in skin1 which I assumed at first for some reason... Just thought I might share that with the rest of you in case anyone is pulling their hair out. I'm currently working on ver. 3.4.8 tested the script and works great Thanks Boomer! ---I'll be sending some paypal gratitude per your post as soon as I get me some green.
|
Great idea
I love the idea for this mod. I'm probably going to implement it on my site. I think instead of paypal gratitude, I'm going to pick up your epanol language pack. Save me some time and head ache.
-Jeremy |
If you'd like to make a donation you can find a link at:
:arrow: http://www.cart-lab.com/lab/customer/help.php?section=about If anyone has any suggestions for this mod feel free to lay them on me, I may redo this mod in the near future to be put up on cartlab with possibly more options, like admin controlable settings, multiple receiptients, and maybe building a list of items to send along with attaching a send to friend on EVERY page instead of Just products. Anyhow just some ideas. :idea: Anyhow, enjoy! :-k |
Boomer,
This is still a great mod and so suprising that xcart has not included it in releases since you originally wrote it. 8O |
Quote:
Though X-Cart license agreement does allow us to include 3rd party mods into X-Cart code, we do not do this without getting explict permission of the mod writer. So, if B00MER wants us to include this in the mainstream code, we can do this. |
Sure . for a FEE. :twisted:
GO get em Boomer! :lol: |
RRF
If you want to pm me I may be open to offers :) |
needed indeed
Both the Send-to-a-friend and random-image mods should be added in the basic package IMHO (In My Humble Opinion), since these are great for cart functionality.
Hope they are included soon. :D |
Hi Boomer, I tried your MOD on 3.5.0 and got this error message after click on the 'Send to a friend' button. Do you have any idea what when wrong?
Can't to find template engine! Tks, Ming |
If your running 3.5.0:
Edit smarty.php and update the corresponding code at line 39: Code:
# Should do the trick. |
All times are GMT -8. The time now is 12:51 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.