我有一个app/design/frontend/hopnew/default/template/checkout/cart/shipping.phtml
文件。在其中,我要做的就是获取上次表单提交中设置的运输方式。我已经尝试了所有这些陈述,但它们都没有回应:
<?php
echo $this->getAddressShippingMethod();
echo "111<br />";
echo $this->getAddress()->getShippingMethod();
echo "222<br />";
echo $this->getQuote()->getShippingAddress()->getShippingMethod();
echo "333<br />";
echo $this->getCheckout()->getQuote();
echo "444<br />";
echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod();
echo "555<br />";
echo $this->getQuote();
echo "666<br />";
echo $this->getCheckout();
echo "777<br />";
echo $this->getAddress();
echo "888<br />";
echo Mage::getSingleton('checkout/session')->getQuote();
echo "999<br />";
echo Mage::getSingleton('checkout/session')->getCheckout();
echo "10<br />";
echo Mage::getSingleton('checkout/session')->getAddress();
echo "11<br />";
// echo $this->_getQuote()->getShippingAddress()->getShippingMethod();
echo "12<br />";
我已经确认estimateUpdatePostAction()
inapp/code/core/Mage/Checkout/controllers/CartController.php
确实保存了运输方式。
那么现在如何从 shipping.phtml 文件中获取它?