Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 获得;使用帐单地址“;从Onepage签出的“发货地址”部分_Magento - Fatal编程技术网

Magento 获得;使用帐单地址“;从Onepage签出的“发货地址”部分

Magento 获得;使用帐单地址“;从Onepage签出的“发货地址”部分,magento,Magento,我试图让礼品选项消息仅在客户发送到与一页结帐流程中的帐单地址不同的地址时显示。我可以从账单部分通过 $this->getQuote()->getShippingAddress()->getData('same_as_billing') 而且效果很好。但是,如果客户将其作为配送方式,并回击以更改配送地址,则该字段似乎不会得到更新。我试着检查了一下 $this->getQuote()->getShippingAddress()->getData('use_bil

我试图让礼品选项消息仅在客户发送到与一页结帐流程中的帐单地址不同的地址时显示。我可以从账单部分通过

$this->getQuote()->getShippingAddress()->getData('same_as_billing')
而且效果很好。但是,如果客户将其作为配送方式,并回击以更改配送地址,则该字段似乎不会得到更新。我试着检查了一下

$this->getQuote()->getShippingAddress()->getData('use_billing_address')
但这些数据并不存在。事实上,当我在additional.phtml中有这两行代码时:

Mage::log("Same as billing: ".$this->getQuote()->getShippingAddress()->getData('same_as_billing'));
Mage::log("Use billing: ".$this->getQuote()->getShippingAddress()->getData('use_billing_address'));

当我从发货地址转到发货方法时,它不会触发。有人能给我一些指导吗?

我最终使用了javascript函数而不是PHP,因为它不会重新加载页面来访问每个部分

在template/giftmessage/inline.phtml中,我添加了以下内容:

    function _showHideGift() {
        var flag=document.getElementById('shipping:same_as_billing').checked;
        if(!flag){
            document.getElementById('gift-messages').style.display="block";
        }else{
            document.getElementById('gift-messages').style.display="none";
    }}
然后使用toogleVisilibityOnObjects调用调用CDATA内块下方的函数