Post by katalin » Fri Jan 27, 2023 11:43 pm

Hi guys, I would like to duplicate checkout and failure pages and use one for COD payment and the other one for Credit card, can anyone tell me how to do this?
Thanks!
Last edited by katalin on Thu Feb 02, 2023 12:59 am, edited 1 time in total.

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by paulfeakins » Mon Jan 30, 2023 8:09 pm

katalin wrote:
Fri Jan 27, 2023 11:43 pm
I would like to duplicate checkout and failure pages and use one for COD payment and the other one for Credit card
Why?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by katalin » Tue Jan 31, 2023 3:55 am

paulfeakins wrote:
Mon Jan 30, 2023 8:09 pm
katalin wrote:
Fri Jan 27, 2023 11:43 pm
I would like to duplicate checkout and failure pages and use one for COD payment and the other one for Credit card
Why?
Because I want to have different success messages if user pays with COD or Credit card. If he uses credit card if the payment is accepted I want to let the user know it's good. If user chooses COD I will like to insert some info about how to pay on delivery.

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by agatha65 » Tue Jan 31, 2023 6:01 am

Because I want to have different success messages if user pays with COD or Credit card. If he uses credit card if the payment is accepted I want to let the user know it's good. If user chooses COD I will like to insert some info about how to pay on delivery.
This can be done on the same page with a modification.
On the other hand, the success page is a special place whre the analyitcs, remarketing, and fb pixel are implemented.
If you add a second success page you will need to modify all these extensions.

Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
Image


User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC

Post by katalin » Tue Jan 31, 2023 5:09 pm

agatha65 wrote:
Tue Jan 31, 2023 6:01 am
Because I want to have different success messages if user pays with COD or Credit card. If he uses credit card if the payment is accepted I want to let the user know it's good. If user chooses COD I will like to insert some info about how to pay on delivery.
This can be done on the same page with a modification.
On the other hand, the success page is a special place whre the analyitcs, remarketing, and fb pixel are implemented.
If you add a second success page you will need to modify all these extensions.
And how can I do that? Would you help me with this?

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by SohBH » Tue Jan 31, 2023 8:53 pm

catalog/controller/checkout/success.php
After
$this->cart->clear();

Code: Select all

if (isset($this->session->data['payment_method']['code'])) {
if ($this->session->data['payment_method']['code'] == 'cod') {
$data['addcontent'] = $this->language->get('text_cod_instruction');
} else {
$data['addcontent'] = $this->language->get('text_card_instruction');
}
} else {
$data['addcontent'] = '';
}
template/common/success.twig
Modify accordingly

Business Web Development | Content Creation | Analytics and Reporting | SEO


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by katalin » Thu Feb 02, 2023 12:58 am

SohBH wrote:
Tue Jan 31, 2023 8:53 pm
catalog/controller/checkout/success.php
After
$this->cart->clear();

Code: Select all

if (isset($this->session->data['payment_method']['code'])) {
if ($this->session->data['payment_method']['code'] == 'cod') {
$data['addcontent'] = $this->language->get('text_cod_instruction');
} else {
$data['addcontent'] = $this->language->get('text_card_instruction');
}
} else {
$data['addcontent'] = '';
}
template/common/success.twig
Modify accordingly
Works perfectly. Thanks!

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am
Who is online

Users browsing this forum: sidclel and 84 guests