Count total sum = amount + shipping. How to do that?

aFFu

No avatar

2006-12-06 22:59

Hi!

I need to count a total sum ( amount + shipping ) in the PayPal page. How to do that?

<input type="hidden" name="amount" value="$aList[fSummary]">
<input type="hidden" name="shipping" value="$aData[fCourierPrice]">

... instead of the summary and courier price separated I need to get them together for total sum.


var totalSum = $aList[fSummary] + $aData[fCourierPrice]

... something like that but how to do it properly??

Thanks!!

aFFu

No avatar

2006-12-06 23:15

O, it was too easy. :)

var totalSumma = $aList[fSummary]+$aData[fCourierPrice];

... works fine... stupid question. ;)

aFFu

No avatar

2006-12-06 23:41

... also you need to change variable to string!

var countSumma = $aList[fSummary]+$aData[fCourierPrice];
var totalSumma = countSumma.toString();

... and totalSumma = amount + shipping ... easy. :)

prince

No avatar

2006-12-07 15:10

Hello aFFu,

Sorry I am not following so what will the final code look like?

Thanks
Aj

prince

No avatar

2006-12-11 17:44

Hello aFFu,

Sorry I am not following so what will the final code look like?

Thanks
Aj

idaryl

Avatar: idaryl

2006-12-12 02:29

aFFu? did you get anywhere with this?

prince

No avatar

2006-12-12 05:04

Hello idaryl,

Just wondering if you know how to get this to work.

I have installed the taxanddiscount plugin and set it up for GST 15%, going through an order it works perfect but when u click on paypal link to pay for it, the total is not reflecting in the paypal link.

Please take a look.

http://www.beckiesbliss.com/cart

Thanks
aj

havugot1

No avatar

2007-02-08 21:41

Hi,
This thread seemed to end with no answer.

My problem is similar.
My paypal is OK, the item cost is shown seperate to added postage,
the problem lies in the Nochex section.

Nochex do not have an option for shipping.
How can I add $aList[fSummary] to $aData[fCourierPrice] together to give a total amount to request from nochex only, and where would I put it.

Thanks
Andrew

http://www.aycs.co.uk/Havugot1QuickCart/index.php

havugot1

No avatar

2007-02-11 09:52

Hi,

After using my 3 brain cells, I have worked out how to get the final amount as one.

Instead of adding $aList[fSummary] to $aData[fCourierPrice]
all that has to be done is placing $fSummary as the amount to be sent to nochex.

Andrew

http://www.aycs.co.uk/Havugot1QuickCart/index.php

idaryl

Avatar: idaryl

2007-02-11 10:18

Wait a minute I did answer this - with a really long and involved answer PLUS the code. I'm really surprized that no-one has gotten to the thread, cause it has a LOT of functionality in it AND it appears to have fallen into this forum's void.....

idaryl

Avatar: idaryl

2007-02-11 10:28

Went to your cart and you have a CCD field that does not pass info to the print_window nor to the orders_delivery and even if you choose a card you still get the paypal window - why do you have that field there? and you are missing the title - you need to add functions to the orders_delivey, orders_print/en.php/checkForm/and not to forget the actions_client/admin.php and... last of all the message.tpl in order for all that to operate correctly

havugot1

No avatar

2007-02-11 10:40

Hi idaryl,

Slow down a bit, my 3 brain cells are not upto speed this early on a sunday morning.

To start with what is a CCD?

Andrew

http://www.aycs.co.uk/Havugot1QuickCart/index.php

idaryl

Avatar: idaryl

2007-02-11 11:08

Credit Card

- and I went to Princes beckiesbless cart - you jumped in on this thread later, however, I did go to yours and you have the std2.0 version (I'm guessing) with the paypal addition found elsewhere on this forum (right) If not it certainly looks diferent to the full function versions - anyway Princes version is 1.4 and you are mentioning code that deals with 2.0 - that part wouldnt apply to him anyway. But... if you have a functioning to paypal and to Nochex... maybe others would like to know how to implement that - maybe you could share - if you want... I can't answer you question without actually looking at the code (maybe the answer lies there) but without it... its shooting blanks in the air!

havugot1

No avatar

2007-02-11 11:25

Hi idaryl,

I assumed you was writing about my site as Princes comment is two months old and unanswered.

Yes, my Paypal/Nochex functions are cobbled together from what I have found on this forum.
This is how I have put them together;

In actions_client/orders.php
Line 77-97 looks like;
if( isset( $iOrder ) && is_numeric( $iOrder ) ){
if( isset( $_POST['sOption'] ) && $_POST['sOption'] == 'send' ){
if( checkOrderFields( $_POST ) === true && checkOrderProducts( $iOrder ) === true ){
saveOrder( $iOrder, $_POST );
$aData = throwOrder( $iOrder );
listBasket( $iOrder);
$aData['fSummary'] = sprintf( '%01.2f', $aData['fCourierPrice'] + $aList['fSummary'] );
if( $aData['fCourierPrice'] >= 0 ){
$content .= $tpl->tbHtml( 'messages.tpl', 'ORDER_NOCHEX_PAYPAL' );
}
else

$content .= $tpl->tbHtml( 'messages.tpl', 'ORDER_SAVED' );
$_SESSION['iOrderPrint'] = $_SESSION['iOrderSession_'.LANGUAGE];
unset( $_SESSION['iOrderSession_'.LANGUAGE] );
}
else
$content .= $tpl->tbHtml( 'messages.tpl', 'FORM_ERROR' );
}
else{
$sBasketList = listBasket( $iOrder, 'orders_delivery.tpl' );


And at the top of templates/messages.tpl ;

<!-- BEGIN ORDER_NOCHEX_PAYPAL -->
<div id="message">
<div id="ok">Click NOCHEX (UK only) or PAYPAL (UK or Worldwide) to pay
<td><form action="https://www.nochex.com/nochex.dll/checkout"; method="post">
<input type="hidden" name="email" size="64" value="YOUREMAIL@YOURDOMAIN.co.uk">
<input type="hidden" name="amount" size="8" value="$fSummary">
<input type="hidden" name="ordernumber" size="64" value="Order ID $iOrder">
<input type="hidden" name="logo" size="64">
<input type="hidden" name="returnurl" size="64" value="http://www.YOURURL.co.uk">
<input type="hidden" name="cancelurl" size="64" value="http://www.YOURURL.co.uk">
<input name="image" type="image" src="http://www.nochex.com/web/images/cardsboth1.gif";; alt="I accept payment using NOCHEX">
<!-- NOCHEX LOGO FINISH -->
</form></td>
<form target="paypal" name="_$iOrder" action="https://www.paypal.com/cgi-bin/webscr"; method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="$config[email]">
<input type="hidden" name="item_name" value="Order ID $iOrder">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="amount" value="$aList[fSummary]">
<input type="hidden" name="shipping" value="$aData[fCourierPrice]">
<input type="hidden" name="no_note" value="1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif"; name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form><br />
$lang[Order_finished]<br />
<a href="javascript:windowNew( '?p=ordersWindowPrint&amp;iOrder=$iOrder' );">&raquo; $lang[Order_print]</a><br />
<a href="?p=">$lang[Homepage]</a>
</div>
</div>
<!-- END ORDER_NOCHEX_PAYPAL -->

Andrew
QuickCart 2.0

http://www.aycs.co.uk/Havugot1QuickCart/index.php

idaryl

Avatar: idaryl

2007-02-11 11:37

Ok I'll look into it {big thing though - I have no NoChex acct - I'm noticing you are from the UK and I'm US} so testing for me is going to be a little slow, so don't expect immediate results - but I WILL look into it, OK?

idaryl

Avatar: idaryl

2007-02-11 11:39

Oh yes I forgot to mention - the "added" stuff you mentioned earlier - send the unadded bits as well - it may work differently to how you've changed it (just a random thought)

havugot1

No avatar

2007-02-11 12:21

Hi idaryl,

It would save confusion if you was able to mention names as to who you are directing your post to.

My original post(2007-02-08 21:41:08) to this thread was a query along the same lines of aFFu's problem(2006-12-06 22:59:51), I have since resolved my query(2007-02-11 09:52:35)

I have just had a look at Princes site, and it appeared to add the Tax in checkout and carried it over to Paypal. All seems to be OK from here.

Andrew

http://www.aycs.co.uk/Havugot1QuickCart/index.php

idaryl

Avatar: idaryl

2007-02-11 12:58

Whoa - I answered the ORIGINAL 2006-12-12 05:04:12 then you jumped in AFTER that

As Prince directed the original question to me... I did answer as I mentioned and (afterwards NOW... has the tax stuff working)

As far as your question was concerned I have no idea of what version aFFu has (as the same as you, failed to mention what version was being talked about) - Prince assumed that it was 1.4 as it what he is using for beckiesbliss

You came in later with your bit (no mention of a version) and stated your problem was similar - so I go (thinking I'm dealing with 1.4 to beckiesbliss and talk about a FIELD not the TAX added to the cart and showing in PayPal!!!! you copy forum dates to emphasise your point - I guess you should read them also...)

Then I find out you are talkng about 2.0, which has nothing to do with 1.4 (naturally I dont know this until I go to your site) - I then offer you help and you respond with your last post.. Its actually pretty dang obvious who is talking to who here, so cool your jets...

havugot1

No avatar

2007-02-11 14:16

Hold your horses cowboy,

There is a flaw when you use the term ORIGINAL, and also jumped.

As in the rules and tips, perhaps princes 3rd post to this thread should have been in a new thread as it was not directly related to this query, and maybe you should have realized this and asked him to start a new thread.

Jumped can not be used after a two month gap, especially as I was asking a question and not answering it.

Andrew
QC2.0

http://www.aycs.co.uk/Havugot1QuickCart/index.php

idaryl

Avatar: idaryl

2007-02-11 22:13

OK you win

Back to top
about us | contact