Post by hunti » Tue Nov 29, 2022 8:11 am

Hello,

Version 1.5.6.4

I need to add an additional checkbox to the checkout which if checked will call a certain address after creating an order.

I add this to template/confirm.tpl
<input type="checkbox" name="test" checked>

How to read if a checkbox is checked in controller/checkout/confirm.php ?? If I use:
if (isset($_POST['test'])) this not working

Newbie

Posts

Joined
Sun Oct 21, 2018 8:58 pm

Post by straightlight » Tue Nov 29, 2022 9:04 am

It would ease the task to upgrade your OC version as to use custom fields. Then, to create an Event Trigger that will allow you to specify the action in regard to a specific address field. Or you could look an extension in the Marketplace that could suit your needs. If none of the extension can provide what you're specifically looking for, you could always create a new service request in the Commercial Support section of the forum to get this done as a custom job.

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 OSWorX » Tue Nov 29, 2022 12:30 pm

straightlight wrote:
Tue Nov 29, 2022 9:04 am
It would ease the task to upgrade your OC version as to use custom fields. Then, to create an Event Trigger that will allow you to specify the action in regard to a specific address field.
No - why?
Because OP use 1.5.6.4 - which has no triggers or events ..

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


User avatar
Guru Member

Posts

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

Post by straightlight » Tue Nov 29, 2022 9:56 pm

OSWorX wrote:
Tue Nov 29, 2022 12:30 pm
straightlight wrote:
Tue Nov 29, 2022 9:04 am
It would ease the task to upgrade your OC version as to use custom fields. Then, to create an Event Trigger that will allow you to specify the action in regard to a specific address field.
No - why?
Because OP use 1.5.6.4 - which has no triggers or events ..
As the reason why it was suggested to upgrade since modern versions of OC do have these features built-in as well as it has been suggested alternatively to look on the Marketplace or for Commercial Support.

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 hunti » Wed Nov 30, 2022 4:34 am

straightlight wrote:
Tue Nov 29, 2022 9:04 am
It would ease the task to upgrade your OC version as to use custom fields. Then, to create an Event Trigger that will allow you to specify the action in regard to a specific address field. Or you could look an extension in the Marketplace that could suit your needs. If none of the extension can provide what you're specifically looking for, you could always create a new service request in the Commercial Support section of the forum to get this done as a custom job.
Since when did this community forum become commercial?

Newbie

Posts

Joined
Sun Oct 21, 2018 8:58 pm

Post by straightlight » Wed Nov 30, 2022 4:35 am

hunti wrote:
Wed Nov 30, 2022 4:34 am
straightlight wrote:
Tue Nov 29, 2022 9:04 am
It would ease the task to upgrade your OC version as to use custom fields. Then, to create an Event Trigger that will allow you to specify the action in regard to a specific address field. Or you could look an extension in the Marketplace that could suit your needs. If none of the extension can provide what you're specifically looking for, you could always create a new service request in the Commercial Support section of the forum to get this done as a custom job.
Since when did this community forum become commercial?
A ... very long time ago.

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 Johnathan » Wed Nov 30, 2022 6:18 am

Just to be clear, the OpenCart forums are NOT commercial --- there is one sub-forum for Commercial Support. The purpose of that forum is for people to post requests where they want to hire someone to help. All the other forums are for questions and answers by the community.

However, you're not always going to find someone that is able to willing to help you with your issue for free. I think straightlight was saying that if you can't figure it out, you could post in the Commercial Support forum to hire someone to create the modification you need. You don't have to, but it's an option.

In terms of what you're actually trying to do, you would need to send an ajax call to the server when that checkbox is checked. Then you would process that value on the server, and run whatever code you're trying to do. If you're not familiar with how to create ajax calls, you can start here:

https://www.tutorialsteacher.com/jquery ... jax-method

You're probably better off putting the checkbox BEFORE the Confirm Order step, so it can be added to the order when the order is built. The confirm.php file is called when the Confirm Order step is LOADED, so you need to have the data sent and processed before the final step of checkout.

I can't walk you through the entire process, but hopefully that helps. You might be better off just finding an extension that can do what you want (rather than spend hours of your time trying to do it yourself). You can check the opencart.com marketplace if you want to try finding one:

https://www.opencart.com/index.php?rout ... /extension

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 72 guests