在 opencart 结账时添加额外字段

发布于 2024-12-08 04:11:56 字数 177 浏览 0 评论 0原文

我正在使用 opencart v.1.5.1 如何在 opencart 结帐页面上添加额外的文本区域?

我已经使用 Photoshop 添加了第 6 步,如何在 opencart 上进行编码?

添加步骤 6

I'm using opencart v.1.5.1 How do I add extra text area on opencart checkout page?

I've added Step 6 using photoshop, how do I code that on opencart?

Add step 6

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2024-12-15 04:11:56

我不知道你的编程背景,但你需要熟悉 PHP、AJAX、JavaScript,当然还有 MySQL,你还应该了解 MVC 架构。如果您认为您对这些有足够的了解,那么您需要执行以下操作:
创建一个控制器类并命名它,让我们说“备注”

     class ControllerCheckoutRemarks extends Controller { 
        public function index() {
// Your code 
    }
    }

添加处理数据所需的代码,您可以通过查看“checkout/guest/shipping”控制器类获得一些想法。您需要的与该类所做的非常相似。
如果您需要与数据库交互以处理数据,那么您需要在 Model 文件夹下的同一路径中创建一个 Model 类,并在其中编写您的函数。同样,您可以从其他模型类中得到这个想法。但我认为您不需要这个,可能您想将此信息添加到您的订单中,为此您应该修改 Order 类,包括 Controller 和 Model !

最后,您需要为其创建一个模板文件,再次打开“checkout/guest/shipping”的模板文件,看看他们是如何做到的,然后您创建自己的模板文件。

对于控制器和模型类,请确保正确命名它们。
您还需要做一件事,第 5 步的控制器类将重定向设置为下一步,默认情况下是确认。更改此行并使其重定向到您的部分,并对新部分执行相同的操作并将其重定向到确认:

url: 'index.php?route=checkout/shipping'

我只能指导您做什么,如何做是您的工作:D如果您是程序员,那么我我认为你不会有任何问题。如果你不是,我想你需要有人为你做这件事:)

I don't know about your programming background, but you need to be a little bit more than familiar with PHP, AJAX, JavaScript and of course MySQL, you should also know about the MVC architecture. If you think you have enough knowledge of those then here is what you need to do:
Create a controller class and name it lets say "remarks"

     class ControllerCheckoutRemarks extends Controller { 
        public function index() {
// Your code 
    }
    }

add the code you need to process the data, you can get some ideas by looking at "checkout/guest/shipping" controller class. What you need is quite similar to what that class does.
if you need to interact with the database in order to process the data then you need to create a Model class in the same route under the Model folder and write your functions in it. again you can get the idea from other model classes. But I don't think you need this, probably you want to add this information to your order, in order to do that you should modify the Order class, both Controller and the Model !

Finally you need to create a template file for it, once again open the template file for "checkout/guest/shipping" and see how they did it, then you create your own.

For the controller and model classes make sure you name them properly.
There is one more thing you need to do, The controller class for the step 5 sets the redirect to the next step which by default is the Confirmation. Change this line and make it redirect to your section and do the same thing for the new section and redirect it to Confirm:

url: 'index.php?route=checkout/shipping'

I can only guide you what to do, how to do it is your job :D If you are a programmer then I don't think you'll have any problem with it. if you're not i guess you'll need someone to do it for you :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文