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」などの利用可能なブロックコードの完全なリスト/ドキュメントを探しています。