0
맞춤형 가격의 제품이 있습니다. 선택한 옵션에 따라 제품에 수수료를 추가하는 수식이 적용되므로 가격이 동일하지 않습니다. 내가 가진 문제는 당신이 순서 때 순서가 제품의 가격이 항상 0으로Magento : 주문 가격이 항상 0 인 제품을 다시 주문하십시오.
있다는 것이다 판매/컨트롤러/OrderController이, 함수 재정렬,이 있습니다 :
$order = Mage::registry('current_order');
$items = $order->getItemsCollection();
foreach ($items as $item) {
try {
$cart->addOrderItem($item);
...
내가 추가하는 경우 이 라인들은 맞춤형 가격을 검색 할 수 있지만 항목을 편집 할 수있는 방법을 찾을 수 없어 재주문에 가격이 추가됩니다.
$options = $item->getProductOptions();
$options = $options['info_buyRequest'];
$customPrice = $options['custom_price'];
내가 성공하지 않고, ($ cart-> addOrderItem ($ 항목) 전에 루프에서) 시도 것입니다.
$item->setSpecialPrice($customPrice);
$item->setCustomPrice($customPrice);
$item->setOriginalPrice($customPrice);
$item->setBaseOriginalPrice($customPrice);
$item->setBaseCost($customPrice);
$item->setBaseRowInvoiced($customPrice);
$item->setRowInvoiced($customPrice);
$item->save();
도움이 필요하십니까?
고마워요! 나는 이것을 시도 할 것이지만, $ item은 어디서 오는가? –
Ups, 미안 해요, 그건'$ observer-> getQuoteItem()'이 될 것입니다. 예제 코드를 업데이트했다. – Vinai
그래, 네 대답 전에 네가 알아 냈어. 잘 작동하고있어. 정말 고맙습니다! –