简体   繁体   English

Joomla Virtuemart 2 plgVmOnSelectPayment()

[英]Joomla Virtuemart 2 plgVmOnSelectPayment()

How can I add a form or HTML output to plgVmOnSelectPayment() ? 如何将表单或HTML输出添加到plgVmOnSelectPayment() I see no documentation about that. 我没有有关此的文档。 I don't know this event Virtuemart payment select works. 我不知道该事件是Virtuemart Payment select的作品。 I want add after selection a form with input fields. 我想选择一个带有输入字段的表单后添加。 Can anyone help ? 有人可以帮忙吗?

The plgVmOnSelectPayment() from what I've reversed engineered doesn't give any output to the HTML, but you can modify the cart content with that event. 我进行反向工程后的plgVmOnSelectPayment()不会为HTML提供任何输出,但是您可以使用该事件来修改购物车内容。

I was myself in need of adding a form after a particular payment method was selected (to guarantee some additional data being supplied). 选择特定付款方式后,我本人需要添加表格(以确保提供一些其他数据)。 Depending on where you want it you can either edit the View for the cart and add an if-statement where you see if the particular payment method is chosen. 根据您想要的位置,您可以编辑购物车的“视图”并添加if语句,以查看是否选择了特定的付款方式。 And then later access this information from plgVmConfirmedOrder() (you can access it through the $_POST global. 然后,从plgVmConfirmedOrder()访问此信息(您可以通过$_POST全局访问它。

(This is an untested theory) If you want to add the information to the field you can access the display form and add information there through the plgVmDisplayListFEPayment() event. (这是未经检验的理论)如果要将信息添加到字段中,可以访问显示表单,并通过plgVmDisplayListFEPayment()事件在plgVmDisplayListFEPayment()添加信息。 Look in the vmPSPlugin class to see how they manage it there. 查看vmPSPlugin类,以了解他们如何在那里进行管理。 What I did was simply copy that to get an image into that form, but you should be able to add other things there as well. 我所做的只是简单地复制该图像以将该图像转换成该表单,但是您也应该能够在其中添加其他内容。 And then you might be able to access the information there through plgVmOnSelectPayment() and using the $_POST global. 然后,您也许可以通过plgVmOnSelectPayment()并使用$_POST全局访问那里的信息。

As a fair warning. 作为公平的警告。 All this I've gotten through reverse engineering VirtueMart. 我通过逆向工程VirtueMart获得的所有这些。 So it's neither pictue perfect nor might it be best practice. 因此,它既不完美,也不是最佳实践。 But the VirtueMart documentation leave not many other options :(. So if someone have a better way, I'm very interested in knowing that as well! 但是VirtueMart文档中没有很多其他选择:(。因此,如果有人有更好的方法,我也很想知道这一点!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM