我希望能夠通過API調用以獲取包含URL密鑰等詳細信息的所有類別的數組。到底這個目標會是這樣得到所有類別的數組,包含Magento中的詳細信息
$massage_cats=array(
array("entity_id"=>78,
"name"=>"Massage Oils and Tools",
"url_key"=>"massage-oils-and-tools",
"url_path"=>"essential-accessories/massage-oils-and-tools.html"),
array("entity_id"=>79,
"name"=>"Massage Oils",
"url_key"=>"massage-oils",
"url_path"=>"essential-accessories/massage-oils-and-tools/massage-oils.html")
);
數組所以我想調出類似
$massage_cats= array();
$allcats = Mage::getModel('catalog/cats?')->loadAll();
foreach($allcats $k=>$item){
array_push($massage_cats,$item->loadDetails());
}
我知道這完全是編造的,而不是真正的API,但是這是基本上是目標。我確實需要我輸出的輸出。關於代碼實現需求的想法?
So darn close .. $ url_path = $ category-> getUrl();是不是網址ie:我應該有基本配件/按摩油和工具.html我有http://domain.com/importScript.php/essential-accessories/massage-oils-and-tools。 html和甚至http://domain.com/importScript.php/catalog/category/view/s/in-the-shower/id/91/ – 2012-02-25 23:12:43
啊,試試'$ url_path = $ category-> getUrlPath(); ' – seanbreeden 2012-02-25 23:46:58
是我嘗試的第一件事情之一,但我得到了「/按摩油和工具」,我應該得到「按摩油和工具」貓的「基本配件/按摩油和工具」與父母「基本配件」.. – 2012-02-25 23:50:16