2012-10-17 4 views
1

Magento 1.7.0.2를 설치했습니다. 쿠폰으로 쇼핑 카트 장바구니 규칙을 만들었습니다. magento (장바구니, 체크 아웃, ...)로 표시된 할인 금액이 극값 인 경우를 제외하고는 모든 것이 좋습니다. 나는 극값이 2^64 (18 446 744 073 709 550 520)라는 것을 알아 냈습니다. 규칙의 구성은 중요하지 않습니다. 표시된 할인은 항상 2^64입니다. 마젠 토 쿠폰은 극한 할인을 표시합니다

cart total example

소계 괜찮

은 배송이 합이 합계의 할인 (10 %)을 적용한 후 11669.이다 괜찮 (10,961) 결과 9864. 9864 + 708 = 10,573 인 것이다 수용 가능한 결과. 그래서 표시된 할인을 제외한 모든 것이 완벽합니다.

어디서 잘못 될지 모르겠습니다. 관련 파일을 찾을 수 없습니다. 도와주세요.

고마워, 이스트 반

답변

2

결국 나는 해결책을 찾아 냈다. 이 오류의 원인은 간단합니다. magento가 저장 한 할인 금액은 서명되어 있습니다. 즉, 음수 부호가 있음을 의미합니다.

<tr> 
    <th colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> 
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> 
     <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?> 
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> 
</th> 
<td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> 
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> 
     <?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?> 
    <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> 
</td> 

: 파일 응용 프로그램/디자인/프론트 엔드/[yourfrontend]/[yourtheme] /template/checkout/total/default.phtml (이 양이 화면에 기록되는 곳이다) 다음 코드가 포함

문제는 formatPrice() 함수와 음수 매개 변수입니다. 간단한 해결책은 abs() php 함수입니다.

<?php echo $this->helper('checkout')->formatPrice(abs($this->getTotal()->getValue())) ?> 

그리고 여기에 우리가 갈 수있는 라인

<?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?> 

변경 문제가 해결.

도움이 되었기를 바랍니다.

관련 문제