Post by Favored1 » Sat Jun 01, 2019 3:30 am

In the Payment Checkout area, I Added Text to (Add Comments About Your Order). How Do I Make that Box Required? ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm

Post by DigitCart » Sat Jun 01, 2019 4:32 am

Hi
what is your OpenCart version?
are you using default checkout and default theme?

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by DigitCart » Sat Jun 01, 2019 4:39 am

For OpenCart 3.0, default checkout

Edit this file:
catalog\controller\checkout\payment_method.php

Find:
if (!$json) {

Add before it:

Code: Select all

if (empty(trim($this->request->post['comment']))) {
	$json['error']['warning'] = 'Comment is required!';
}

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by Favored1 » Sat Jun 01, 2019 4:59 am

Newest Version - I do my Custom Editing in the Admin Panel Via (Design > Theme Editor > Checkout > payment_method.twig). In there, I Don't seem to see if (!$json) {. I Need a Break, but Plan to Check Back a Bit Later. ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm

Post by straightlight » Sat Jun 01, 2019 10:03 am

Favored1 wrote:
Sat Jun 01, 2019 4:59 am
Newest Version - I do my Custom Editing in the Admin Panel Via (Design > Theme Editor > Checkout > payment_method.twig). In there, I Don't seem to see if (!$json) {. I Need a Break, but Plan to Check Back a Bit Later. ::)
In the above instructions, it does not indicate to go to a TWIG file. It rather indicates to go to a PHP file which is not available from the theme editor but rather from FTP or cPanel's file manager console.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Favored1 » Sat Jun 01, 2019 11:00 am

Yes, but All the other custom changes, I've made in the .twig Files. I Started Out Editing In the site cPanel, but Changes Weren't Saving. I Could Test Again. ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm

Post by Favored1 » Sat Jun 01, 2019 3:28 pm

Otay, I Assume that the Payment Checkout Box Is Now Required! I Had to Add a Red *. ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm

Post by Favored1 » Sun Jun 16, 2019 2:35 pm

A Few Weeks Ago, I Did Exactly what some of you Suggested in cPanel, and the Comments Box Isn't Always Answered. So Tonight I Looked In cPanel, and the Added Required Code Was Gone. How Do I Get the Required Code to Not Disappear?! ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm

Post by straightlight » Sun Jun 16, 2019 7:42 pm

How Do I Get the Required Code to Not Disappear?!
By not editing the cached files and, to notice the change live, see the FAQ: viewtopic.php?f=176&t=200804#p718325

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Favored1 » Sun Jun 16, 2019 8:36 pm

I Refreshed Modifications. But I'm Away from My Computer for Possibly a Day. I'll Check My cPanel Edit Again Soon! ::)

New member

Posts

Joined
Sun Apr 21, 2019 12:12 pm
Who is online

Users browsing this forum: No registered users and 3 guests