close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

when product price is zero

Thread began 11/08/2011 4:55 am by Kumel | Last modified 11/28/2011 2:34 pm by Jason Byrnes | 3193 views | 47 replies |

Kumel

when product price is zero

Some products in my DB are for free so when its is been added in cart & when "checkout" is clicked.. i get error like Warning: Division by zero in c:\******\confirm.php on line 659

Sign in to reply to this post

Jason ByrnesWebAssist

you cant pass a $0 valued transaction through a payment gateway, they wont except it.
either you will need to force the cart to have at least one item that has a price in it before checking out, or create a second set of checkout pages using the checkout wizard, this time selecting No Gateway.

make sure that these new checkout pages have a unique name.

then add code to the original checkout pages to pass over to the no gateway pages if the cart price is 0. and add code the No gateway pages to pass to the gateway pages if the price is > 0.

Sign in to reply to this post

Kumel

hmm

I added new checkout pages... i created with different names..

now next WHAT DOES THIS MEAN?

then add code to the original checkout pages to pass over to the no gateway pages if the cart price is 0. and add code the No gateway pages to pass to the gateway pages if the price is > 0.

can you please elaborate..? i mean i m not good in writing codes..

u said add code to the original checkout pages to pass over to the no gateway pages.. which all code from the new checkout page should i copy? & where to paste exactly? there are so many codes so.. & how to make //no gateway pages if the cart price is 0\\
& also //and add code the No gateway pages to pass to the gateway pages if the price is > 0.\\

Sign in to reply to this post

Jason ByrnesWebAssist

on the checkout pages, there will be code similar to this near the top:

php:
<?php

//WA eCart Include
require_once("WA_eCart/yourCartName_PHP.php");
?><?php
$yourCartName
->GetContent();
?>



where yourCartName is the name of your eCart object.

on the pages that do connect to the gateway, change that code to:

php:
<?php

//WA eCart Include
require_once("WA_eCart/yourCartName_PHP.php");
?><?php
$yourCartName
->GetContent();
?>
<?php 
if($eCart1->GrandTotal() == "0"header("Location: noGatewayCheckout.php"); ?>




on the pages that do not connect to the gateway use this code:

php:
<?php

//WA eCart Include
require_once("WA_eCart/yourCartName_PHP.php");
?><?php
$yourCartName
->GetContent();
?>
<?php 
if($eCart1->GrandTotal() > "0"header("Location: gatewayCheckout.php"); ?>
Sign in to reply to this post

Kumel

ok done..

thanks a lot for this help.. i added & tried.. but then the product is not been displayed at DOWNLOAD CENTRE.. i went through noGatewayCheckout.php n etc.. it got confirmed.. i had created download_centre by looking in support..

Sign in to reply to this post

Kumel

I recreated the pages like customer_order_history&details.php pages....
& also download_centre.php

now when i go to details page i get error like --
Unknown column 'WADAOrderID' in 'where clause'

Sign in to reply to this post

Kumel

Secondly i created all pages.then i added products once again with price in it.. den i went through check out & had disconnected internet.. As it went to paypal (net wasnt connected) so payment was not done.. den when i went to download centre that product was shown there but it was not downloadable.. how can it display the product when payment is not done? please help.

Sign in to reply to this post

Jason ByrnesWebAssist

What paypal system are you using?

Send a copy of the download center page that is having the problem.

Sign in to reply to this post

Kumel

i used PayPal website payment standard. i have added 2 more pages.. please look into it.

Attached Files
files.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I do not recommend using paypal payments standard for creating a store that sells downloadable goods.


the issue is that paypal payments standard is not a real time payment gateway, the order needs to be stored in the database before the user is transferred to paypal. with payments standard, you need to set the status of the order to pending when the order is first inserted.

Paypal standard uses a system called IPN to post the results of the transaction to your site when the transaction is processed, you need to create a page that will act on this ipn post to update the order status:
ipn


paypal payments standard and IPN is one of the more difficult gateway options to configure correctly.

I recommend using payments pro instead, payments pro is a real time solution.


for the error on the detail page, edit the wadaorders recordset


create a new parameter:
Name: WADAOrderID
Type: Integer
default Value: -1
Run Time Value: $_GET['OrderID']



for the download center page, double check that the users id is being stored in the orders.oderUserID column

and add the following code after the <body> tag of the download center page to show the recordset SQL"

php:
<?php echo"SQL: ".$query_limit_WADAorders); ?>
Sign in to reply to this post
loading

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