close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart & DFP downloads: db updated, but download not working

Thread began 12/22/2009 3:49 pm by thetypehouse | Last modified 12/23/2009 3:47 pm by Jason Byrnes | 3723 views | 8 replies |

thetypehouse

eCart & DFP downloads: db updated, but download not working

Hello

Thanks for all the help so far.

Test site: http://taom.co.uk/resources/.
DW CS4 on WinXPSP3 / PHP / MySQL
WA products: eCart4.5.2, Cookies3.1.2, DFP2.0.2, DA2.0.6, SA1.1.8

  1. I've followed the 'How to set up a Download Centre' recipe, but the download buttons aren't doing anything.

  2. Data are being written to the user, order and orderdetails tables in the WA eCommerce database, and payment is taken by PayPal.

  3. The checkout_success.php page has a link to the Download Centre (for which I've followed the How To).

  4. The Download Centre was showing no records until I added the eCart server behaviour to that page, then a number of orders appeared, but with no functionality from the download buttons. Since then, the number of orders has remained the same (even though more orders are being written to the database). As there is a red exclamation marked next to the eCart server behaviour on the Download Centre page, perhaps it shouldn't be there.

  5. The ProductLocation for the download files is outside the webroot, so the path in DFP is '../../downloads'. I assume that there are other customers using WA products for this purpose with 1and1 (Linux) hosting.



To cut to the chase, I'm wondering if the problem is that the session or order isn't being carried through from the checkout_success page to the Download Centre. The Order History page isn't showing any records at all.

At one point I had wondered if the checkout_success page should double up as the Download Centre, but I guess that would require an if-else statement -- to avoid showing checkout info when the Download Centre is accessed at other times than after an order -- and perhaps is making the whole exercise more difficult than it need be!

I'd be grateful for some guidance to help me see where I'm going wrong.

Thanks!
Alistair

Sign in to reply to this post

thetypehouse

1&1 Linux hosting
The reason for the reference to 1&1 was that I am concerned that perhaps there is a problem with 1&1 allowing access to folders outside the web root.

However, my links to Connections and to WA scripts are to folders outside the web root (even though it seems as though links to images and CSS pages need to be inside the web root). So, since folders in the webroot are only one level deep, links to folders outside the webroot are as follows: '../../downloads', '../../Connections', '../../WA_eCart' etc.

As these folders seem to be accessed OK (e.g. data is being pulled successfully from the database), it looks as though there shouldn't be a problem with access to folders outside the web root with 1&1 hosting.

Sign in to reply to this post

Jason ByrnesWebAssist

To help trouble shoot, add the following code to the download center page after the <body> tag:

php:
<pre><?php var_dump($_SESSION); ?></pre>



Then browswe to the download center and try again. if it still does not work, go to view -> Page Source. copy the entire page source into a new text document, send that text document and the download center PHP page so I can look at the code.

Sign in to reply to this post

thetypehouse

Thanks, Jason

I added the <pre><?php var_dump($_SESSION); ?></pre> script to the page and processed another order, but to no avail.

Here are the view_source and download_centre.php files you asked for.

Thanks for your help!
Alistair

Attached Files
download_center-view_source.txt
download_centre.php.txt
Sign in to reply to this post

Jason ByrnesWebAssist

It may be that the server does not recognize the Currant form submit trigger, try changing the trigger in the download behavior from Currant page submit to any form post.


also double check that the files to download exist in the loacation you are telling the download behavior to look in.


You have set the download location to:
"../../downloads/"


I see in the source, the hiddenform field is correctly getting a file name:

<form id="form1_1" name="form1_1" method="post" action=""> 
<input type="hidden" name="hiddenField" id="hiddenField" value="1.pdf" />
<input type="button" id="download" name="download" value="Download" />
</form>




so it will be looking for the file at:
"../../downloads/1.pdf"


This is a path relative to the document,

So if the download center page is at:
downloadcenter.php

it is looking for the downloads folder 2 directories down:
1.pdf


double check that the relationship is correct.

Sign in to reply to this post

thetypehouse

Thanks, Kevin.

I've made the change to the DFP form trigger to "any form post", and submitted a new order, which has beens successfully processed by PayPal. The db as populated with the order details, but the list of orders in the Download Centre hasn't updated; neither do the Download buttons work.

The download files are in the folder downloads, which is a directory one level down from the webroot.

All the files are in my webspace with 1&1 (Linux Business hosting); the host directory is "romero".

  • So the Download Centre, one of the public files is at
    /romero/webroot/shop/download_centre.php
  • Connections are at
    /romero/Connections/
  • Download files are at
    /romero/downloads/



/romero/ contains the following directories:
_mmServerScripts
admin (unused)
Connections
downloads
old
WA_DataAssist
WA_DigitalFilePro
WA_eCart
WA_SecurityAssist
WADbSearch
webroot

The downloads directory has a number of files, including

  • 1.pdf
  • 2.pdf
  • 3.pdf
  • 4.pdf
  • 5.pdf
  • 6.pdf
  • 7.pdf



The webroot contains one directory for each public section of the site, each with index.php; shop contains the eCart files:

  • shopping_cart.php
  • checkout.php
  • confirm.php
  • confirm_success.php
  • confirm_failure.php
  • download_centre.php
  • customer_order_history.php
  • customer_order_details.php



Here's the latest view_source and download_centre.php files again for comparison with those sent yesterday.

I hope you can see what's going wrong from all this. I'm very grateful for your help.

Alistair

Attached Files
download_center-view_source_Dec23.txt
download_centre.php_Dec23.txt
Sign in to reply to this post

Jason ByrnesWebAssist

I think I see the problem:

The Download button in your form is just a standard button, it does not actually perform any action, the form is not being submited when the download button is clicked.


change the download button:

php:
<input type="button" id="download" name="download" value="Download" />



to be a subit button:

php:
<input type="submit" id="download" name="download" value="Download" />
Sign in to reply to this post

thetypehouse

Download Centre now works, but Order History still showing no results.

Thanks, Jason.

1. The downloads now work. Hooray! (Although the results weren't updating for existing users, the updating does work for a couple of new users I've registered - so perhaps that's OK.)

2. Order History
Any idea why the order_history page is showing no records, though?

I've attached the view source (with session dump) and the original php file in the hope that this will help.

Many thanks again.
Alistair
PS In case you don't get to see this until after the Christmas break, have a very merry and joyful Christmas!

Attached Files
order_history-view_source_Dec23.txt
order_history.php_Dec23.txt
Sign in to reply to this post

Jason ByrnesWebAssist

In the session dump, the session that is created is UserID:
["UserID"]=>
string(1) "4"


<!-- Dump session for trouble shooting purposes -->
<pre>array(8) {
["UserID"]=>
string(1) "4"
["eCart3_Items"]=>
string(242) "1|WAECART|Basic libretto/script |WAECART|Complete, unadorned version with full references to backing tracks and guide tracks (Word document)|WAECART|0|WAECART|1|WAECART|0.01|WAECART||WAECART|0|WAECART|0.01|WAECART|1 Basic libretto/script (1)"
["WAEC_ContinueRedirect"]=>
string(20) "/resources/index.php"
["eCartCheckoutForm_state_province"]=>
string(0) ""
["eCartCheckoutForm_country"]=>
string(2) "GB"
["eCartCheckoutForm_shipping_state_province"]=>
string(0) ""
["eCartCheckoutForm_shipping_country"]=>
string(0) ""
["eCart3_OrderID"]=>
int(34)
}
</pre>




In the WAOrdrs recordset, you are filtering on a session named OrderUserID instead of UserID

$WADAOrderUserID_WADAorders = "-1";
if (isset($_SESSION['OrderUserID'])) {
$WADAOrderUserID_WADAorders = (get_magic_quotes_gpc()) ? $_SESSION['OrderUserID'] : addslashes($_SESSION['OrderUserID']);
}

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...