Pages:

Adding PayPal the simple way to QC v0.3.1

Ste707

No avatar

2006-01-13 11:27

I added this on the end of another thread, but it seems to be a hot topic, so I have posted it on its own. This is for Quick Cart v 0.3.1 and is the simplest way to get PayPal payment on the shop.


STEP TWO
Create a new file >>>templates/default/orders_payment.tpl

And then add the following to this new file:-

<table class='operation_table' cellspacing='0' align='center'>
<td class='ok'>
<br /><br /><br />
$lang[Order_finished]
<br /><br />
<a href='javascript:windowNew( "?p=ordersWindowPrint&amp;iOrder=$iOrder" );'><b>$lang[Order_print]</b></a>
<br /><br />
<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="OrderID $iOrder">
<input type="hidden" name="item_number" value="$iOrder">
<input type="hidden" name="amount" value="$fTotal">
<input type="hidden" name="shipping" value="$fCourier">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" name="submit" alt="Paypal Payment Solutions - Secure and Reliable!">
</form>
<br /><br />
<a href='?p='>$lang[Homepage]</a>
<br /><br />
</td>
</table>

Note: Remember to change the currency_code to your chosen Currency eg GBP,AUS, USD etc. This is important otherwise PayPal will return an error.

STEP TWO
edit the existing page >>>> actions_client/orders.php

and where you find the following code mentions, add the section between the // ----- PayPal code to the page.

saveOrder( $iOrder, $_POST );

//--------- Add This PayPal Start
$aOrder = throwOrder( $iOrder );
listBasket( $iOrder);
$aCourier = throwCourier( $aOrder['iCourier'] );
$fTotal = sprintf( '%01.2f', $aBasket['fSummary'] );
$fCourier = sprintf( '%01.2f', $aCourier['price'] );
$fSummary = sprintf( '%01.2f', $aCourier['price'] + $aBasket['fSummary'] );

if( $aCourier['price'] > 0 ){
$content .= $tpl->tHtml( 'orders_payment.tpl' );
}
else {
$content .= $tpl->tHtml( 'orders_saved.tpl' );
}
}
//--------- Add This PayPal Finish

else
$content .= $tpl->tbHtml( 'operations.tpl', 'FORM_ERROR' );



That was it, thanks to Stormy for the original code. Hope it helps.
Ste

sadman

No avatar

2006-01-13 12:01

lol

I feel like im bangin my head up a brick wall here

if this is STEP 2 where is STEP 1

Dont you think it would be clever to post both steps (Doh!)

gigidagosta

No avatar

2006-01-13 12:22

i think there is just an mistake ... the first code is step one and then came step two ...

the code is complete and it works fine

sadman

No avatar

2006-01-13 12:35



Thanks i'll give it a go for the 10th time lol

dont know if anyone else has picked up on this but when you have checked out the cart empties automatically - can this be fix?

Ste707

No avatar

2006-01-13 12:51

DUH!
Yes my fault &#8211; the code is complete it&#8217;s just that the first step is STEP ONE!

Ste707

No avatar

2006-01-13 12:58

I ma not sure why you would want to change the Empty -> Cart on checkout as this is so when the user visits again, the products have been deleted from the shop checkout page.

BTW - Today is the first time I came across this script and it sure Rocks.

sadman

No avatar

2006-01-13 12:59

hi m8 - yeah i got it working now i must say that example is easier to understand then the others posted

also

dont know if anyone else has picked up on this but when you have checked out the cart empties automatically - can this be fix?

sadman

No avatar

2006-01-13 13:02

i think that should be up to the user to do

'Empty Cart' option

if the browser is closed they loose all cart items too

needs a cookie set :0)

just an idea

pawe

No avatar

2006-01-13 17:52

Ste707: You dont have the ability to make for v.1.0 aswell? :)

sadman

No avatar

2006-01-13 18:15

yeah that would be nice lol

pawe

No avatar

2006-01-14 00:59

yeah, shouldn't it? :)

Ashen

No avatar

2006-01-14 08:13

Hey again sadman, the cart empties because the order is saved.

To do this you'd have to do the following:

- Find the function that saves the order and comment out the line that empties the cart.
- Then create a new function that empties the cart, which you can access from a link.

Is 1.0 Working for you yet?

pawe

No avatar

2006-01-14 15:37

When someone have a complete guide on how to get paypal to 1.0 please share it.. :)

sadman

No avatar

2006-01-14 16:13

i aint got it working on that version

im sticking to the other version as there seems to be more plugind for that version

karma_b

No avatar

2006-01-17 22:47

Hello. Does anyone know if any other plugins are known to prevent this from working? I added the code as directed but the checkout process is unaffected. I appreciate any thoughts on this. Thank you!

karma_b

No avatar

2006-01-23 18:05

tax and discount

Chocolinx

No avatar

2006-02-03 02:50

I can't seem to get this feature to work on my site. I'm using 0.3.0 QC. Everytime the customer checks out it just saves the order insteading of asking to pay through paypal.

I've tried making the shipping cost more than 0$ and it still doesn't work. From what I'm reading in the code, courier price must be greater than 0 no?

Chocolinx

No avatar

2006-02-03 03:43

Okay I found the source of the problem. Like what karma_b said, taxanddiscount plugin is stopping us from getting the paypal working.

I've disabled my tax plugin and it works now but I need to add the taxes!

Any help on this would be GREAT!

wizzud

No avatar

2006-02-03 09:30

For taxAndDiscount plugin:
In STEP TWO above, instead of looking in actions_client/orders.php, look in actions_client/tax.php and try applying the same changes - MAKE SURE YOU HAVE A BACKUP FIRST!
The reason being that taxAndDiscount redirects p=ordersDelivery requests to p=taxDelivery, so it never hits the 'delivery' code in orders.php, but goes to the equivalent code in tax.php.

Chocolinx

No avatar

2006-02-04 23:42

Okay it seems to have worked but now I run into one more problem.

The paypal shows up now but when you click on paypal button it doesn't add in the tax to the total.

www.silenttweak.com you can try it out and see what I mean.

Pages:
Back to top
about us | contact