Post by andyjb » Sun Nov 24, 2024 1:18 am

Hello everyone,
I'm using Version 4.0.2.3

Could anyone guide me in how I could make "Free Checkout" the default payment option even when order values are above zero. The site I'm creating is for an organisation that loan out items to members so no payments are actually made.

Many thanks

New member

Posts

Joined
Sun Dec 14, 2014 9:54 am

Post by softmonke » Sun Nov 24, 2024 3:18 am

andyjb wrote:
Sun Nov 24, 2024 1:18 am
Hello everyone,
I'm using Version 4.0.2.3

Could anyone guide me in how I could make "Free Checkout" the default payment option even when order values are above zero. The site I'm creating is for an organisation that loan out items to members so no payments are actually made.

Many thanks
Free checkout payment method will automatically appear when the cart totals is 0. Since there is no payment, perhaps you can just set all your product prices to zero, and at checkout, the free checkout payment method should appear (provided that you've enabled it).

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by andyjb » Sun Nov 24, 2024 6:08 pm

Hi softmonke,
Thanks for your reply. I have the option working for zero values. The system I'm working on needs to have values so that members see the replacement prices of items they're borrowing and hopefully will encourage them to look after the loan items when they see they actually cost something. Also use it at the annual AGMs to tell ppl total values of items borrowed during the previous year.

Is there a code change that you know of that I can apply to force the free checkout to run each time?

Many thanks.

New member

Posts

Joined
Sun Dec 14, 2014 9:54 am

Post by OSWorX » Sun Nov 24, 2024 9:00 pm

andyjb wrote:
Sun Nov 24, 2024 6:08 pm
Is there a code change that you know of that I can apply to force the free checkout to run each time?
Simple:

open ../extension/opencart/catalog/model/payment/free_checkout.php
and change (comment that out) line 27 - 33.:

Code: Select all

if ((float)$total <= 0.00) {
	$status = true;
} elseif ($this->cart->hasSubscription()) {
	$status = false;
} else {
	$status = false;
}
to

Code: Select all

$status = true;
Note: now Free Checkout is always visible, also when there is a product chosen with subscription!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by andyjb » Tue Nov 26, 2024 9:23 pm

OSWorX Thank you very much. That code change works.

Any idea if there's anyway to make that payment option appear by default so users don't have to select it?

New member

Posts

Joined
Sun Dec 14, 2014 9:54 am

Post by OSWorX » Tue Nov 26, 2024 11:43 pm

andyjb wrote:
Tue Nov 26, 2024 9:23 pm
OSWorX Thank you very much. That code change works.

Any idea if there's anyway to make that payment option appear by default so users don't have to select it?
No problem.

Have you also other payment methods enabled?
If so, set the position of the one which shall be the first to 1 - the first one is always selected by default.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: paulfeakins and 3 guests