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

Displaying download links after purchase

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 02-18-2004, 01:15 PM
 
Kowboy Kowboy is offline
 

Newbie
  
Join Date: Feb 2004
Posts: 1
 

Default Displaying download links after purchase

This question pertains to the Egoods module. After the payment is processed, an email is sent with links to download.php with the appropriate "key" parameter. What files/functions should I look for if I want to also display these to the user (in the web browser) immediately after purchase, along with or in place of the order invoice?
__________________
Craig.
Reply With Quote
  #2  
Old 02-26-2004, 08:06 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

You would need to copy the template for the email for the egoods, as well as perhaps making sure the module is included on the cart.php page so the variables and arrays exist for the template to be processed correctly to the user on the invoice screen.

hth.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 04-15-2004, 12:40 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default

I did this exact thing on my development store that's getting ready to go live to replace our old x-cart store. In x-cart 3.5.6, check out skindir/customer/main/order_message.tpl. This is the main order message that is displayed to your customer after placing an order. In it, you will find references to all the templates you need to modify. I believe it references skindir/mail/order_data.tpl, or skindir/mail/html/order_data.tpl. You will need to modify your customer/cart.php page to grab the download keys for the completed order and reassociate them with the proper product. You might not have noticed this unless you've done extensive modding, but x-cart completely empties the contents of your $cart and $products arrays once your order is completed, then it goes and gets all the order data for whatever orderids are passed to the order message screen and displays the data. So all the data is basically "lost" during order placement and then must be re-gathered to display the order message. You can't just pass it to your template after the order is placed, which causes some problems showing the user a download key that was never associated with an orderid. This means that you'll probably need to modify your xcart_download_keys table in your database as I describe below.

I found that using the mail templates for the order message data was not a good option for me, so I created a set of specific order message templates in the customer skin directory:

skindir/customer/main/order_message_header.tpl
skindir/customer/main/order_message_product_data.tpl
skindir/customer/main/order_message_totals.tpl
skindir/customer/main/order_message_customer_info.tpl

which are all referenced by
skindir/customer/main/order_message.tpl

I then built them all as HTML templates and included not only the download link, but also the product thumbnail and a serial number which I generate on the fly based (sort of) on the order number and the productid.

I then modified my HTML mail templates to do the same, so now my e-mail receipts also include thumbnails of each product and full order data.

In order to do all this, I had to make some database modifications.
I added "number_downloads" and "orderid" fields to the xcart_download_keys table to let me track the number times each key is used as well as associating the key with an order number so it could be retrieved after the order is complete. Otherwise, the key is simply sent during the checkout process, but is never associated with an order, so it can't be retrieved and listed in the order message screen. So once you've modified your xcart_download_keys table, you'll then need to modify the code that inserts the download keys (in the moduels/Egoods/send_keys.php file) so that you insert the orderid with the download key.

These modifications will also help you if you want to allow users to view their order history and retrieve their download keys. To modify the order history you need to modify the skindir/main/history_orders.tpl and the customer/order.php page. There may be some other files too. I've modded most of my order/product/cart/customer files and templates so it's hard to remember what relates to what. Webmaster mode is your friend for figuring out which templates are being called by which php files. Anyway, hopefully I've given you a good idea of what you'll need to do to make that happen. Also, below is a copy of my customer/main/order_message_product_data.tpl file. It displays a "download now" button instead of a download link. Maybe it will give you some ideas.
Code:
{* $Id: order_data.tpl,v 1.4 2003/10/03 10:12:11 svowl Exp $ *} {config_load file="$skin_config"} <table width="100"> {if $products} <tr> <td><font size="+1"> {$lng.lbl_products_ordered} :</font></td> </tr> <tr> <td>{section name=prod_num loop=$products}<table cellpadding="0" cellspacing="0" border="0"><tr><td></td><td><table border=1 bordercolor="#CCCCCC" cellpadding="5" cellspacing="0"><tr><td> <table border=0 cellpadding=0 cellspacing=0 width="99%"> <tr> <td colspan="5"> <font size="2"> {* $lng.lbl_product *} {$products[prod_num].product} </font> </td> </tr> <tr> <td rowspan="12" valign="TOP"><a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}> {include file="product_thumbnail.tpl" productid=$products[prod_num].productid image_x=$products[prod_num].image_x product=$products[prod_num].product tmbn_url=$products[prod_num].tmbn_url} </a></td> <td></td> <td> {$lng.lbl_quantity} :</td> <td></td> <td> {$products[prod_num].amount} </td> </tr> {if $products[prod_num].product_options ne ""} <tr> <td valign=top></td> <td valign=top> {$lng.lbl_selected_options} :</td> <td></td> <td valign=top> {$products[prod_num].product_options|replace:"\n":" "} </td> </tr> {/if} <tr> <td nowrap></td> <td nowrap> {$lng.lbl_item_price} :</td> <td></td> <td> {include file="currency.tpl" value=$products[prod_num].price} </td> </tr> {* egoods key in order data mod by brett *} {if $products[prod_num].download_key != ""} <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td colspan="4"> This product is downloadable:</td> </tr> <tr> <td></td> <td> {$lng.lbl_filename} :</td> <td></td> <td> {$products[prod_num].distribution_filename} </td> </tr> <tr> <td></td> <td nowrap valign="TOP" colspan="3"> {* $lng.lbl_download_url *} [img]{$SkinDir}/images/btn_download_now.gif[/img]</td> </tr> {if $products[prod_num].serial_number != ""} <tr> <td></td> <td nowrap> Serial Number:</td> <td></td> <td nowrap> {$products[prod_num].serial_number} </td> </tr> {/if} <tr> <td></td> <td colspan="3"><font size="1"> Instructions: Simply click the link above to open the download page, then follow the instructions on that page. Once you have downloaded your product, we strongly recommend that you back up your program to a safe location such as cd-rom so that you have easy access to it if you need to reinstall in the future. If your product requires a serial number, it will be listed above. You will need to enter the serial number the first time you run your program</font>. </td> </tr> {/if} {* end egoods key in order data mod by brett *} {* begin digital subscription info in order data mod by brett *} {if $products[prod_num].subscribed_url} <tr> <td colspan="4"> Access to this online course:</td> </tr> <tr> <td></td> <td nowrap> Login Address:</td> <td></td> <td> <a href="{$products[prod_num].subscribed_url}" target="_blank"><font color=red> {$products[prod_num].subscribed_url} </font></a> </td> </tr> <tr> <td></td> <td colspan="3"><font size="1"> Instructions: Simply click on the link above to log in to your online course. You will need your username and password that you created during the checkout process. If you forget your password, just go to www.realestate-school.com/online-store and use our password retrieval utility located near the bottom-left of the page navigation.</font></td> </tr> {/if} {if not %prod_num.last%} {/if} </table></td></tr></table></td></tr></table> {/section}</td> </tr> {/if} {if $giftcerts} <tr> <td>{$lng.lbl_gift_certificates_ordered}:</td> </tr> <tr> <td> <table border=0 cellpadding=0 cellspacing=0 width="99%"> {section name=giftcert loop=$giftcerts} <tr> <td></td> <td>{$lng.lbl_gc_id}:</td> <td></td> <td>{$giftcerts[giftcert].gcid}</td> </tr> <tr> <td></td> <td>{$lng.lbl_amount}:</td> <td></td> <td>{include file="currency.tpl" value=$giftcerts[giftcert].amount}</td> </tr> <tr> <td></td> <td>{$lng.lbl_recipient}:</td> <td></td> <td>{$giftcerts[giftcert].recipient}</td> </tr> {if $giftcerts[giftcert].send_via eq "P"} <tr> <td></td> <td colspan=3>{$lng.lbl_gc_send_via_postal_mail}</td> </tr> <tr> <td></td> <td valign=top>{$lng.lbl_mail_address}:</td> <td></td> <td valign=top>{$giftcerts[giftcert].recipient_firstname} {$giftcerts[giftcert].recipient_lastname} {$giftcerts[giftcert].recipient_address}, {$giftcerts[giftcert].recipient_city}, {$giftcerts[giftcert].recipient_state} {$giftcerts[giftcert].recipient_country}, {$giftcerts[giftcert].recipient_zipcode}</td> </tr> <tr> <td></td> <td>{$lng.lbl_phone}:</td> <td></td> <td>{$giftcerts[giftcert].recipient_phone}</td> </tr> {else} <tr> <td></td> <td>{$lng.lbl_recipient_email}:</td> <td></td> <td>{$giftcerts[giftcert].recipient_email}</td> </tr> {/if} {if not %giftcert.last%} <tr> <td>[img]../../mail/html/empty.gif[/img] </td> <td colspan=3><hr size=1 noshade width=100% align=left color="#DDDDDD"></td> </tr> {/if} {/section} </table></td> </tr> {/if} </table>

Using the above template as a rough example, you will still need to modify your cart.php file to collect the download link data and associate it with the proper products before the $orders/$products array is assigned to the order message template. You would do that near the bottom of the customer/cart.php file where you see the code to collect info about orders already placed.

Good luck!
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #4  
Old 08-20-2004, 01:11 PM
 
Brian Peat Brian Peat is offline
 

Advanced Member
  
Join Date: Aug 2004
Location: Mc Connellsburg, PA
Posts: 73
 

Default someone could make some money

Someone could make some money writing something that would do all these mods for you. I'd pay money for it-heck, I paid $135 for this feature in Miva Merchant.
__________________
X-Cart Gold 4.3.1
Php 5.2.14
MySQL: 5.1.52
My Machine: OS X 10.6.5
Reply With Quote
  #5  
Old 08-27-2004, 06:37 PM
 
wallachee wallachee is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 102
 

Default

Would you be able to post the whole mod for this...such as the exact functions to put into the send_keys.php file etc? Your help is appreciated.

Thanks.
Reply With Quote
  #6  
Old 08-29-2004, 10:28 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

I've implemented such a feature, after the order invoice, a list of products purchased along with download links are generated like so:

1. producttitle: (download button)
2. producttitle2: (download button)

Clicking the product title will take them to a the details of the product (same link in the email), download button will send the user the file.

If anyones interested PM me for details, there are only two files you need to edit for this functionality.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #7  
Old 08-31-2004, 06:20 AM
 
Brian Peat Brian Peat is offline
 

Advanced Member
  
Join Date: Aug 2004
Location: Mc Connellsburg, PA
Posts: 73
 

Default

Yeah!

I bought Boomers solution and it works great! Below the receipt is your download link, which still gets e-mailed to you just in case. Xcart needs to just add this as a check box in the egoods prefs, and give the option to put it above or below the receipt. I think it would make a lot of people happy.
__________________
X-Cart Gold 4.3.1
Php 5.2.14
MySQL: 5.1.52
My Machine: OS X 10.6.5
Reply With Quote
  #8  
Old 10-20-2004, 03:38 PM
 
ecollier2012 ecollier2012 is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 85
 

Default Need Mod

Boomer, please PM me in regards to this mod... I need it for one of my sites.
Ed
Reply With Quote
  #9  
Old 05-10-2005, 11:27 PM
 
medchic medchic is offline
 

Member
  
Join Date: Mar 2005
Location: Australia
Posts: 13
 

Default Displaying download links after purchase

Yes _ I also need this functionality but new to X-cart so unsure how to implement correctly.
My users will also need to read a disclaimer message that i want to appear in the browser once they have made the purchase before they can access the link.
Could some one please suggest best solution.
Thanks
__________________
medchic
Version 4.0.18
http://www.lowbackpain.tv
Reply With Quote
  #10  
Old 06-30-2005, 04:40 PM
 
AlanT AlanT is offline
 

Senior Member
  
Join Date: Jun 2005
Location: Grand Rapid, MI
Posts: 137
 

Default

This is one area where X-Cart has some room to grow. If download keys were associated directly with orders, then it would be a lot easier to create a download page for each customer, or at least offer a direct download link on a webpage for them to access.

It's getting late and I've been reading all day.

Can anyone tell me if there's been progress on this, or if there is a mod available for sale?

I'll take another look at this tomorrow, and hopefully I'll understand it a bit better - I'm not a programmer and don't have a lot of experience with Smarty, so it's not making a lot of sense to me right now.

Thanks.

- Alan Tutt

http://www.PowerKeysPub.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4


Thread Tools

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:15 AM.

   

 
X-Cart forums © 2001-2020