【问题标题】:$this->getQuote()->setData(); not working in saveBilling() in Onepage checkout Magento$this->getQuote()->setData();在 Onepage 结帐 Magento 中的 saveBilling() 中不起作用
【发布时间】:2014-12-04 07:18:55
【问题描述】:

我正在尝试在Onepage.phpsaveBilling() 方法中为客户设置自定义属性 Onepage.php 的路径是

/app/code/core/Mage/Checkout/Model/Type/Onepage.php

saveBilling()我写了下面的代码

$this->getQuote()->setData("customer_dri_license","22");

如您所见,我正在尝试设置值 22 for customer_dri_license

我想在saveOrder() 中检索这个值,因为我已经写在下面的代码行

$this->getQuote()->getData("customer_dri_license")

但我没有收到saveBilling() 中设置的值“22”

如果我遗漏了什么,请告诉我。

【问题讨论】:

    标签: php attributes magento-1.8


    【解决方案1】:

    继续假设您需要将 Quote 放入变量中,然后对其进行操作:

    $quote = $this->getQuote();
    $quote->setCustomerDriLicense('22');
    $quote->save(); //save if you want to come back to it somewhere else later?
    ...
    $dri_license = $quote->getCustomerDriLicense();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-11
      • 2013-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多