0
좀 var.For에이 같은이, 내가로 json_encode을 통해 특정 제품의 등급 가격을 얻고있다() 함수 계층 데이터를 입력 할
var tierPrices = <?php echo json_encode($_product->getTierPrice()) ?>;
var getPrice = function(qty){
qty = Number(qty);
var i = tierPrices.length;
while(i--)
{
if(qty >= tierPrices[i]['price_qty']){
return tierPrices[i]['price'];
}
}
return null;
};
var price = getPrice(this.value);
을
var price = "<?php echo Mage::helper('core')->currency?>"+(getPrice(this.value));
그러나 두 상점을위한 계층 가격의 값이 같은오고있다 : 내가 필요로하는 것은 항상 기본 디스플레이 매점에 대한 계층의 가격을 선택하기 때문에 다른 매장에 따라 가격 값을 얻을 수있다이 시도. 다른 매장 통화에 따라 계층 가격이 어떻게 책정됩니까?
상점 ID가 '1'또는 상점 ID가 '2'.it 가격의 동일한 배열을 데려 오는 경우는, 계층 가격이오고있는 계층 Prices.Same 작동되지 않았습니다. –
그 코드를 어떻게 따라야할까요? –
$ storeId = Mage :: app() -> getStore() -> getId(); "store id is"echo $ storeId; $ products = Mage :: getModel ('catalog/product') -> setStoreId ($ storeId); $ cpid = Mage :: registry ('current_product') -> getId(); $ products-> load ($ cpid); $ array = $ products-> getTierPrice(); print_r ($ array); –