fSummary will not show up on orders_saved.tpl paypal form

Timbrewolf

No avatar

2005-10-08 06:59

I've read through all the pages on the Paypal integration. I've read all the pages on fSummary, integrating with other carts, how to show the basket on multiple pages. I've changed tons of files, but no matter what, I can't get what seems to be the simplest thing to work:

Passing the $fSummary variable to my paypal form on orders_saved.tpl.

It looks like it's been working for most? So what am I doing wrong? I tried it as $fSummary in the field. I tried using the $total = $_POST['fSummary']; in the actions_client/orders.php... I've tried passing it as a hidden field in the Orders_delivery.tpl form and THEN assigning it a variable from _POST.

I'm pulling my hair out and I think I'm going to have to find another shopping cart if I can't get this to work, but I've put a lot of work into coordinating my site design to match it. Please, any suggestions would be fantastic.

Brandon

jonb

No avatar

2005-10-10 05:06

I found and installed Quick.Cart today and have never looked at PHP before, so I am sure that this is the wrong way to solve the problem, but I'll share anyway.

I installed the default package with no plug-ins. I applied the PayPal code to orders_saved.tpl and $fSummary didn't pass through. Drove me nuts since others seem to have it working. Being stubborn, I started to dissect the code, specifically actions_client/orders.php

Comparing the "WindowPrint" action (around line 70) with the "Delivery" action (around line 47), I came to believe the $fSummary variable is not set for that page. From this I don't know how it ever worked for anyone, unless there is some feature or plug-in that I am not using that makes $fSummary global.

So this is what I did:

in the "Delivery" action handler..
...
saveOrder( $iOrder, $_POST );

// start wacky jon code
$aOrder = throwOrder( $iOrder );
$content .= listBasket( $iOrder, 'orders_print.tpl' );
$aCourier = throwCourier( $aOrder['iCourier'] );
$fTotal = sprintf( '%01.2f', $aBasket['fSummary'] );
$fCourier = sprintf( '%01.2f', $aCourier['price'] );
$fSummary = sprintf( '%01.2f', $aCourier['price'] + $aBasket['fSummary'] );
$content .= $tpl->tbHtml( 'orders_print.tpl', 'COURIER' );
// end

$content .= $tpl->tHtml( 'orders_saved.tpl' );
...

That (I think) fetches the order back from the database (like "WindowPrint" does) and sets some variables. I then go ahead and use the print template to add the invoice to the confirmation/payment screen, I think it looks better, personal preference.

Next, in orders_saved.tpl, I edited/added:

...
<input type="hidden" name="item_number" value="$iOrder">
<input type="hidden" name="amount" value="$fTotal">
<input type="hidden" name="shipping" value="$fCourier">
...

to the PayPal code. This breaks out cost of goods and shipping (Courier) in the PayPal interface. If you don't want that you can continue to use $fSummary.

It works for me. If anyone can explain how to use the in session definition of the Order without having to fetch it from the db again I would be grateful.

Wonderful product, exactly what I was looking for. Thanks.

-jon

stormy

No avatar

2005-11-26 22:49

good jop thx jonb

Back to top
about us | contact