【问题标题】:Magento $this-> function with AJAXMagento $this-> 带有 AJAX 的函数
【发布时间】:2016-12-04 02:02:24
【问题描述】:

我创建了一个包含产品数据的页面,该页面通过“要求”包含在主页中。当我打开家时,它工作得很好。

<?php require ("$path/public_html/page.php"); ?>

但我有一个包含相同页面的 AJAX 代码,还有一些额外的功能,例如:

... .load('http://www.website.com/page.php?id='+code)

当页面被请求时,它在 $this-> 函数中停止并返回 500 Internal Server Error:

 $this->getPriceHtml($_product, true,

为什么 $this-> 函数不适用于 AJAX?

【问题讨论】:

    标签: php ajax magento


    【解决方案1】:

    最大的问题是您不了解 OOP 以及 Magento 的工作原理。如果没有初始化 Magento (Mage::run(...)),您将无法使用 Magento 应用程序部件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-17
      • 1970-01-01
      • 1970-01-01
      • 2011-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多