| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Displaying download links after purchase | ||||
|
|
Thread Tools |
#1
|
|||||||
|
|||||||
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. |
|||||||
#2
|
|||||||||
|
|||||||||
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. |
|||||||||
#3
|
|||||||||
|
|||||||||
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:
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. |
|||||||||
#4
|
|||||||
|
|||||||
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 |
|||||||
#5
|
|||||||
|
|||||||
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. |
|||||||
#6
|
|||||||||
|
|||||||||
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. |
|||||||||
#7
|
|||||||
|
|||||||
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 |
|||||||
#8
|
|||||||
|
|||||||
Need Mod
Boomer, please PM me in regards to this mod... I need it for one of my sites.
Ed |
|||||||
#9
|
|||||||
|
|||||||
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 |
|||||||
#10
|
|||||||
|
|||||||
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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|