close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Digital goods download

Thread begun 11/15/2010 12:05 pm by davas56386677 | Last modified 12/06/2010 12:01 pm by massimo173451 | 3118 views | 8 replies |

davas56386677

Digital goods download

Hello,

Avoiding customers to go through the complete checkout process for simple FREE DOWNLOADS, i changed a bit the code in results.php located in the \basic sub-directory as shown in results_php_in_basic_subdir.png (attached) under number "1". I check if the price is == 0 of the product to choose between a DOWNLOAD button or a LEARN MORE button (don't car about the french customization) as shown in the products_result_php.png (attached).
As I don't want to write a lot of code to skip the complete checkout process and jump from the results.php directly to view_downloads.php passing the product's associated down loadable filename contained in the ProductDigital field in the ps4_products table, I would appreciate any precise advice and help from the excellent tech support staff of WA to help me achieve an easy straightforward downloading of FREE FILES for my customer.

I join a ZIP file for better reading of the downsized PNG files

Many thx in advance for your kind support

Dan

Sign in to reply to this post

Jason ByrnesWebAssist

to bypass the gateway if only free downloadable content is in the cart, edit the following line in the webassist/plugins/shopping_cart/process_transaction.php file:

php:
<?php
// if in test mode, skip all checkout code
if ($WAGLOBAL_Test_Mode != true) {
?>



to:

php:
<?php
// if in test mode, skip all checkout code
if($WA_Store_Cart->GrandTotal() == 0$WAGLOBAL_Test_Mode true;
if (
$WAGLOBAL_Test_Mode != true) {
?>
Sign in to reply to this post

massimo173451

Division by zero

Hi Jason, I get this error message why (I have set the product as price to zero for passing the checkout)?




Warning: Division by zero in /web/htdocs/www.tessyacconciature.it/home/webassist/plugins/shopping_cart/process_transaction.php on line 935



Massimo

Sign in to reply to this post

davas56386677

Hello Massimo,

Did you apply the code modification as recommended by Jason:

To bypass the gateway if only free down loadable content is in the cart, edit the following line in the webassist/plugins/shopping_cart/process_transaction.php file:

Existing PHP Code at line 489:
<?php
// if in test mode, skip all checkout code
if ($WAGLOBAL_Test_Mode != true) {
?>

to:

NEW PHP Code at line 489:
<?php
// if in test mode, skip all checkout code
if($WA_Store_Cart->GrandTotal() == 0) $WAGLOBAL_Test_Mode = true;
if ($WAGLOBAL_Test_Mode != true) {
?>

Try it, it works fine, even if your cart contains a mix of "zeroed" and "none zeroed" items.

Let me know if that solved your problem.

Daniel

Sign in to reply to this post

massimo173451

Hello Daniel,

Thank you for your answer, but I have already applied the code variation on page the result is the same (see the image attached) if continue on confirm order (Conferma Ordine in italian) get paypal error the cart is empty!! Any further suggestion for solve this?


Massimo

Sign in to reply to this post

davas56386677

Hi Massimo,

I just made new tests on my site using 2 items (one with 10 € and a second with 0 €). Everything ran without trouble. It passed PAYPAL and directed to the download page for the item of 0 €.

The error you get is issued by dividing "Price" with "TotalPrice" that contains ZERO (0). Look at the piece of code beneath that is on line 935 - 936 in the file /webassist/plugins/shopping_cart/process_transaction.php

if ((WA_eCart_FormatNumber($WA_Store_Cart->DisplayInfo("Price") - (($WA_Store_Cart->DisplayInfo("Price")/$WA_Store_Cart->TotalColumn("TotalPrice")) * $WA_Store_Cart->GetDiscounts()), false, 2) > 0)) {

Try to look backwards in your code for the values contained in "Price" and "TotalPrice". "TotalPrice" can only be ZERO (0) if "Price" also is ZERO (0). Just track backwards these two variables and you shall find where the mistake happens.

As I don't have access to the code of your site, you have to do the job.

Here my email: davas56@gmail.lu if you can't solve the matter by yourself.

Best regards

Daniel

Sign in to reply to this post

massimo173451

Daniel,

I have sent you an email with page in attachment but receive the error from mail server (address not recognize)??


Massimo

Sign in to reply to this post

davas56386677

Sorry Massimo,

Here is the right email: davas56@gmail.com. I misspelled it.

Try again sending the info and I'll have a look. OK !

Daniel

Sign in to reply to this post

massimo173451

Thank you Daniel for your extra support, but as specified I am not expert in PHP language, the issue happens when in the cart is present only an item with value 0 (zero), and when put in the cart another item with different value > 0, the checkout is ok, but the PayPal price in USD not in Euro why??? Is eCart configurated correctly (&#8364; currency)? Any suggestion or support are appreciate.




Massimo

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...