我正在尝试从 wordpress 访问 magento。下面是我用来访问magento侧边栏购物车的简单代码。
<?php
/*
* Initialize magento.
*/
require_once '/Applications/XAMPP/xamppfiles/htdocs/conover-store/app/Mage.php';
Mage::init();
/*
* Add specific layout handles to our layout and then load them.
*/
$layout = Mage::app()->getLayout();
$layout->getUpdate()
->addHandle('default')
->addHandle('some_other_handle')
->load();
/*
* Generate blocks, but XML from previously loaded layout handles must be
* loaded first.
*/
$layout->generateXml()
->generateBlocks();
/*
* Now we can simply get any block in the usual way.
*/
$cart = $layout->getBlock('header')->toHtml();
echo $cart;
?>
我正在寻找可用块代码的完整列表/文档,例如“cart_sidebar”、“header”等,