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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Deposit order calculation

Thread began 5/18/2009 9:49 am by vandenheuvel.claude346907 | Last modified 5/21/2009 8:34 pm by vandenheuvel.claude346907 | 2343 views | 11 replies |

vandenheuvel.claude346907

Deposit order calculation

Hi,
I have to do a calculation for the client pays only a deposit of 30% from the total amount of an order.
is what someone would have an idea of how it can be done?
I don't see how to change the "GrandTotal" and pass it to the Paypal gateaway
thank you

Sign in to reply to this post

Ray BorduinWebAssist

You can use math to change a number at any point in the process, so getting 30% of a number should be as easy as adding: * 0.3

Maybe the easiest way to do it is on an item by item basis, you can update the existing calculation from:
TotalPrice = Price * Quantity

to:
TotalPrice = Price * Quantity * 0.3

Sign in to reply to this post

vandenheuvel.claude346907

Hi Ray,
thank you for your reply,
actually it is a possibility but in this case each product invoice payment and the only option I have cancellation insurance which must take into account the subtotal of the basket.
French laws requires us to be transparent, so the client must know what it would cost in total and what it pays for the deposit
So how ; and ; is it possible to calculate the deposit payment on sub-total addition and send this variable to Paypal

Sign in to reply to this post

Ray BorduinWebAssist

Are you using paypal standard or pro?

Sign in to reply to this post

vandenheuvel.claude346907

I use Paypal Buisness Pro

Sign in to reply to this post

Ray BorduinWebAssist

Both direct pay and express checkout use server behaviors to pass the values to paypal. If you wanted to update the amounts I think you could just update the server behaviors associated with the local checkout on the confirm and pp_confirm pages and add "* 0.3" in the appropriate places where the individual and total prices are passed to paypal.

Sign in to reply to this post

vandenheuvel.claude346907

Thanks ; I've done that , but it return the pp_checkout_failure.php

Where I am now :
in the cart page :
for the total order :
<?php echo WA_eCart_DisplayMoney($PIERROT, $PIERROT->GrandTotal()); ?>
for the deposit :
<?php $PIERROT_B = $PIERROT->GrandTotal()*0.3; ?>
<?php echo $PIERROT_B ?></td>

Normaly in the QUERY_STING's form I should have the $PIERROT_B

in the checkout page for the $WA_PP_ECO_SetResult = WA_PP_ECO_SOAPObject(); string :
$WA_PP_ECO_Set_params[0][$nextIndex] = "OrderTotal";
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$PIERROT->GrandTotal()."";
I tried to change the value $WA_PP_ECO_Set_params[1][$nextIndex] = "".$PIERROT->GrandTotal().""; by
$WA_PP_ECO_Set_params[1][$nextIndex] = "".$PIERROT_B."";

and the result is : pp_checkout_failure.php
If I change somethoing on the $PIERROT->GrandTotal(), I got the same result

Do I've to chage something in the PP_ECO_PHP.php ?
How could I input the right value in the $WA_PP_ECO_Set_params[1][$nextIndex] = "".$PIERROT->GrandTotal().""; ?

Thanks a lot

Sign in to reply to this post

Ray BorduinWebAssist

You would have to update both the grand total and the individual item totals.

I would want to look at your code to show you where to update it. Are you using shipping, tax, discount, or charge rules of any sort? do those get discounted 30% as well? What you add depends on the very pariticular details of what you want and how your code looks currently.

I would need a detailed description of exactly what you would want, maybe with some samples and I would want to look at the full code block, not just this one line to figure out where it needed to be updated.

Since paypal passes items with the total and validates that the total of the items matches the grand total, you can't just change one number and have it work. You have to be sure your math all adds up at the end for any place values are passed to paypal.

Sign in to reply to this post

vandenheuvel.claude346907

Well it will be a long way
Could i send you the files in a personal message ?

Sign in to reply to this post

Ray BorduinWebAssist

You can post a submit incident where you can share files privately and post your incident number here and I'll take a look at it.

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