Forum
Payment Gateways based on delivery
Hi, I would like to have two payment gateways. Manual & PayPal on a one checkout page. Manual for order with "Payment on Delivery", and PayPal for the rest.
I do not know how to get button for Manual, and button for PayPal on the same page. I will be thankfull for some help on this.
my checkout flow
<?php
if (!perch_member_logged_in()) {
echo '<div class="left-col-checkout">';
// New customer sign up form
perch_shop_registration_form([
'template' => 'checkout/customer_create_passwordless.html'
]);
echo '</div>';
perch_shop_cart([
'template'=>'cart/cart_static.html'
]);
}
else {
if (!perch_shop_cart_has_property('terms_agreed')) {
echo '<div class="left-col-checkout">';
perch_shop_order_addresses();
perch_shop_shipping_options();
perch_shop_shipping_method_form();
perch_shop_form('checkout/confirm.html');
echo '</div>';
perch_shop_cart([
'template'=>'cart/cart_static.html'
]);
} else {
// T&Cs are agreed, so on to the payment step!
// your 'success' return URL
$return_url = 'https://../';
$cancel_url = 'https://../';
perch_shop_checkout('paypal-express', [
'return_url' => $return_url,
'cancel_url' => $cancel_url,
]);
}
}
?>
The only way I can think to do this through Shop itself (rather than using your own code to track the selection) would be to inspect the value of
shippingID
in the output fromperch_shop_cart()
.Can You help me more Drew? How I can find in a payment condition specific shippingID?
Can You suggest any documentation on this topic?
You'll need to look at the cart with
perch_shop_cart()
- it should contain the shippingID so you can tell one method from another. There's no automatic functionality for this.I will be honest, I have no idea how to find shippingID in perch_shop_cart() function.
Thanks Drew! That 's why I love Perch - AMAZING support!