또한 노드 - product.tpl을 할 수 /관리/저장/설정/저장/편집/형식으로 갈 수있다 .PHP 파일, 그래서이 가격을 얻을 수있는 방법 인 경우 사용 : 그것이 있어야보다이 좀 더되었다
<?php
$context = array(
'type' => 'product',
'revision' => 'altered', // using altered to get the bare price with no themeing
'field' => 'sell_price',
'subject' => array('node' => $node)
);
$dp = uc_price($node->sell_price, $context);
$context['field'] = 'list_price';
$lp = uc_price($node->list_price, $context);
?>
<div class="price clear-block <?php if($dp != $lp) print 'discounted'; ?>">
<?php print 'From: ' . $node->content['display_price']['#value']; ?>
<?php //print $node->content['list_price']['#value']; ?>
</div>
내용 [ 'DISPLAY_PRICE'] [ '# 값']; ?>
당신이 테마 할인 된 가격 :-) 그냥 내 프로젝트 중 하나으로부터 복사
하지 않으려면
.
마지막 : 당신은 아마 theme_uc_product_price를 사용할 수 있습니다 당신이
function zen_uc_product_price($price, $context, $options = array()) {
$output = '<div class="product-info '. implode(' ', (array)$context['class']) .'">';
$output .= uc_price($price, $context, $options);
$output .= '</div>';
return $output;
}
가 "에서"추가 할 때의 $ 컨텍스트 변수를 검사 uc_product.module에서 기본 구현에 template.php (붙여 넣기에 함수를 추가 부분.
출처
2010-07-11 09:38:46
Tom
다음은 제품 페이지 주제에 대한 자습서입니다. http://www.ubercart.org/forum/development/3868/nifty_products_tutorial_part_1, uc_currency 형식을 사용하지 마십시오. 특히 가격을 사용하는 경우 uc_price가 올바른 방법입니다. 멀티 가격 모듈 및 uc_vat에서와 같이 핸들러 – Tom