2Checkout 付款扩展 Magento 错误“'href' of undefined”prototype.js:612:64)

2Checkout Payment Extension Magento Error "'href' of undefined" prototype.js:612:64)

我尝试使用 2Checkout Payment Extension Magento 处理付款时出现错误,控制台打印如下。任何人都知道这个问题。

prototype.js:828 Uncaught TypeError: Cannot set property 'href' of undefined
at eval (eval at <anonymous> (https://example.com/js/prototype/prototype.js:612:64), <anonymous>:4:55)
at https://example.com/js/prototype/prototype.js:612:64
at https://example.com/js/prototype/prototype.js:865:29
at https://example.com/js/prototype/prototype.js:825:18
at Array.forEach (native)
at Array.each (https://example.com/js/prototype/prototype.js:824:12)
at Array.collect (https://example.com/js/prototype/prototype.js:864:10)
at String.evalScripts (https://example.com/js/prototype/prototype.js:612:34)
at Function.<anonymous> (https://example.com/js/prototype/prototype.js:391:23)
at https://example.com/js/prototype/prototype.js:416:23
(anonymous) @   VM297:4
(anonymous) @   prototype.js:612
(anonymous) @   prototype.js:865
(anonymous) @   prototype.js:825
each    @   prototype.js:824
collect @   prototype.js:864
evalScripts @   prototype.js:612
(anonymous) @   prototype.js:391
(anonymous) @   prototype.js:416

最后,我修正了那个错误。我更改了 observer.php 上的代码 它位于 /app/code/local/Craig/Tco/Model / observer.php

if (Mage::getStoreConfig('payment/tco/inline')

之下
if ($$("a.top-link-cart")) { //old observer.php line 70

我把这个改成

if ($$("a.top-link-cart").length) {

在其他方面也一样

if ($$("a.top-link-cart")) {

if ($$("a.top-link-cart").length) {

您可以在 2Checkout-Magento-Error

上找到有关此错误的更多信息