사용자 정의 모듈의 주문 가격 형식
-
11-12-2019 - |
문제
마젠토 가격 데이터 형식이 완료되어 약간 혼란스럽습니다. 그리드에 주문 금액을 표시해야 하는 맞춤 모듈을 작업 중입니다. 완료했는데 잘 작동하지만 소수점 4자리(예: 14.0000)가 표시됩니다. 필요합니다. 14.00처럼만 표시되고,
내 그리드에 인쇄 주문 금액이 아래와 같은 열 추가 기능이 있습니다.
$this->addColumn('order_amount', array(
'header' => Mage::helper('manoreport')->__('Order Amount'),
'width' => '100px',
'type'=>'price',
'index' => 'subtotal_invoiced',
));
하지만 아직은 이것뿐인 것 같아
어떤 제안.?미리 감사드립니다 :)
해결책
통화를 지정해야 합니다.
$this->addColumn('order_amount', array(
'header' => Mage::helper('manoreport')->__('Order Amount'),
'width' => '100px',
'type' => 'price',
'index' => 'subtotal_invoiced',
'currency_code' => 'CURRENCY CODE HERE'
));
통화가 주문마다 다를 수 있는 경우(대부분 그럴 가능성이 높음) 열을 유형으로 만들 수 있습니다. currency
대신에 price
.
$this->addColumn('order_amount', array(
'header' => Mage::helper('manoreport')->__('Order Amount'),
'width' => '100px',
'type' => 'currency',
'index' => 'subtotal_invoiced',
'currency' => 'order_currency_code'//this will take the currency from the order - this represents the column that holds the currency code
));
제휴하지 않습니다 magento.stackexchange