Magento控制器和模型内部服务器错误
下面是我的js代码:Magento控制器和模型内部服务器错误,magento,Magento,下面是我的js代码: $("#personalize_design_button").click(function(){ category_type = $(".cc-selector input[name='category']:checked").val(); shape_type = $(".shape-selector input[name='shape']:checked").val(); $.ajax({ url: "/index.php/desi
$("#personalize_design_button").click(function(){
category_type = $(".cc-selector input[name='category']:checked").val();
shape_type = $(".shape-selector input[name='shape']:checked").val();
$.ajax({
url: "/index.php/designs/designs/product/ctype/"+category_type+"/stype/"+shape_type,
type: "GET",
dataType: "json",
success: function(data)
{
alert(data);
},
error: function(error)
{
console.log("Error:");
console.log(error);
}
});
//$(".col-md-9").append('<div class="col-xs-18 col-sm-3 col-md-3"><div class="productbox"><div class="imgthumb img-responsive"><img src="http://lorempixel.com/250/250/business/?ab=1df"></div><div class="caption"><span style="float:left;">Modern Trendy Bedroom</span><span class="pull-right">Rs.129000</span><div class="caption"><span style="float:left;">Tag1</span><span style="float:left;">Tag2</span><span>Tag3</span></div><div class="caption"><span style="float:left;">Tag4</span><span style="float:left;">Tag5</span><span>Tag6</span></div></div></div></div>');
//$(".col-md-9").load('product_category.phtml');
});
还有我的模型课:
<?php
include 'http://52.25.99.121/ChromePhp.php';
class Homeliv_Designs_Model_Designs extends Mage_Core_Model_Abstract
{
const BEDROOM = 11;
public function getRecentProducts($category_type,$shape_type)
{
ChromePhp::log("inside model-----".$category_type);
$ctype = 0;
if($category_type == 1){
$ctype = BEDROOM;
}
//ChromePhp::log("inside model-----".$category_type);
$products = Mage::getSingleton('catalog/category')->load($ctype)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('price', array( 'lt' => 300000 ));
//->addAttributeToFilter('shapes', array( 'eq' => $shape_type ));
ChromePhp::log('Total products-----'.count($products);
foreach ($products as $_product){
ChromePhp::log('inside model-----'.$_product->getId().'------'.$_product->getShape());
}
ChromePhp::log('inside model-------'.count($products));
return $products;
}
}
查看服务器错误日志,查看问题所在获取此警告:ERR(3):警告:include():http://wrapper在服务器配置中被allow\u url\u include=0禁用。我想这不应该是个问题。另外,我不认为模型被调用了,否则第一个ChromePP日志行应该被认真调用……没有答案???不应该是个问题,但你正在做包含http://52.25.99.121/ChromePhp.php';
,如果没有http包装就无法工作,不是吗?那么如何修复它呢?自从我提出这个问题以来,我一直在挠头
<?php
include 'http://52.25.99.121/ChromePhp.php';
class Homeliv_Designs_Model_Designs extends Mage_Core_Model_Abstract
{
const BEDROOM = 11;
public function getRecentProducts($category_type,$shape_type)
{
ChromePhp::log("inside model-----".$category_type);
$ctype = 0;
if($category_type == 1){
$ctype = BEDROOM;
}
//ChromePhp::log("inside model-----".$category_type);
$products = Mage::getSingleton('catalog/category')->load($ctype)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('price', array( 'lt' => 300000 ));
//->addAttributeToFilter('shapes', array( 'eq' => $shape_type ));
ChromePhp::log('Total products-----'.count($products);
foreach ($products as $_product){
ChromePhp::log('inside model-----'.$_product->getId().'------'.$_product->getShape());
}
ChromePhp::log('inside model-------'.count($products));
return $products;
}
}