You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi Nick
I am thinking it would be good if customers would have a click to pay option on quotes that we send out, instead of them having to phone up or make bank transfer.
Is it possible to include a checkout gateway form in the quote confirmation email so the user can click a link which will take them straight to the payment page, in our case sagepay form??
Offline
Yes, pos generates quotes. Customers get quote confirmation emails which include ordersummaryxhtml.php.
I was looking at including the olpsetup namespace in the ordersummaryxhtml.php, so the payment form is generated with a Pay Now button.
Trying to work out if I can get the Crypt field populated for the form
Offline
To do this quickly, set up a 'Quote Payment' service product offer that's got a customer price input. Add a product option to it for your quote id. Target that offer from your link with the price and quote id embedded in CGI variables matching those on the offer detail page (just view it's source to figure out what they are). You'll get a new order for a 'Quote Payment' when processed, and it will include a reference to the quote being paid. You can then use the order manager to close that order out, and initialize the quote and mark it as paid.
Offline
HI Nick
I have added a link in ordersummaryxhtml.php for Quotes as follows:
https://www.mydomain.co.uk/index.php?app=ecom&ns=addcart&offerid=miscpayment&ecom--addcart--quantity=1&ecom--addcart--pricemapid=DEFAULT-miscpayment-DEFAULT-DEFAULT&ecom--addcart--servpriceinput=787.73&ecom--addcart--DEFAULT-miscpayment-DEFAULT-DEFAULT--miscpayment-desp=201709199
'miscpayment' is a valid service product offer with price input, and it has a option 'miscpayment-desp'. The 'miscpayment-desp' and the 'servpriceinput' values are populated correctly.
On receipt of email, quote customer clicks link and our website opens with correct product in shopping cart. They just need to go through to checkout.
This only eliminates adding item to cart, but it gets the customer closer to payment.
Are there any flaws in having such a link in an email?
Last edited by zanart (09-19-2017 09:22:37)
Offline
That would work fine. If I were doing it, I'd consider a shorter URL and using Apache/.htaccess to recognize that URL and do the right thing. Ie - use a URL like:
https://www.mydomain.co.uk/QuickPay/201709199/787.73
Then add this .htaccess rule above any K9 rules:
RewriteRule ^QuickPay/(.*)/(.*) index.php?app=ecom&ns=addcart&offerid=miscpayment&ecom--addcart--quantity=1&ecom--addcart--pricemapid=DEFAULT-miscpayment-DEFAULT-DEFAULT&ecom--addcart--servpriceinput=$2&ecom--addcart--DEFAULT-miscpayment-DEFAULT-DEFAULT--miscpayment-desp=$1 [L,PT]
Good work.
Offline
nice, never thought of that
Offline
Nick, you make my brain hurt with these tips you give me, and I keep coming up with new ideas!
Anyway based on the QuickPay link, I have added a table column in orderlist.php display for payonaccount users. New column shows if invoice is paid or not. If it isn't paid a 'Pay Now' checkbox is shown. User can select one or more from list of orders with outstanding balance. If any checkbox is checked, big button is displayed - 'Pay Invoices Now'. Button will add all selected invoices to cart in one line. Works perfectly.
Minor issue is, when they get to checkout, Pay On Account method is still displayed. Obviously I don't want them to select this option.
I can see where the method is shown in ECOM_Checkout cogateways function.
Is there anywhere I can set $this->globals('core_user.purchonacct') to 0 if cart contains prod id 'miscpayment' ??
Offline
Nothing exists that would do this for you. The easiest thing to do is modify the SQL statement in the ECOM_Checkout class that pulls the gateways. You've referenced it, so I know you've seen it. Perhaps do a cart check and conditionally load that gateway if core_user.purchonacct=1 and cart doesn't contain 'miscpayment'.
Offline
Realised $this->cartids was available in ECOM_Checkout so just looped through the id's to check for 'miscpayment'.
All good.
Offline