简体   繁体   English

Magento addBeforeInitFunction在支付类中

[英]Magento addBeforeInitFunction in the payment class

In the magento script optcheckout.js -> Payment(Class) there is a function 在magento脚本optcheckout.js -> Payment(Class)有一个函数

 addBeforeInitFunction

The payment function is instantiated on the payment.phtml page. 付款功能在payment.phtml页面上实例化。

var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>');

console.log(payment.form);

payment.addBeforeInitFunction('test', function(){
    console.log('test');
});
payment.addAfterInitFunction('test1', function(){
    console.log('test1');
});
payment.addBeforeValidateFunction('test2', function(){
    console.log('test2');
});
payment.addAfterValidateFunction('test3'), function() {
    console.log('test3');
}

Should I be adding these calls somewhere else? 我应该在其他地方添加这些电话吗? The only one that registers to the Hash is addAfterValidateFunction . 注册到哈希的唯一一个是addAfterValidateFunction Has anyone dealt with this before? 有人处理过吗?

I dont know why, but after this last version 1.9.1, I cant load/run script tags inside child blocks. 我不知道为什么,但是在此最新版本1.9.1之后,我无法在子块中加载/运行脚本标签。 Until 1.7 I could set a child for Credit Card Form Block using events, and apply some javascripts inside. 直到1.7,我可以使用事件为“信用卡表格块”设置一个孩子,并在其中应用一些JavaScript。 Now it won't works. 现在将无法使用。 So that payment methods seems very useful. 这样付款方式似乎非常有用。

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

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