Exibir “Entrega Grátis” se Valor = 0 no campo de texto do atributo
-
28-09-2020 - |
Pergunta
por favor visite isto link
procurar R$ 10 usando Ctrl + F
aqui estou exibindo o valor do atributo [10], se valor = 0 => link
Now value is 10 ,if value = 0, I want to display "Selling Price (Free Delivery )" :
Means instead of "Selling Price + Rs 0 Delivery", I want to display "Selling Price ( Free delivery ) "
código do atributo:"mp_local_shipping_charge"
Preço.phtml
<span class="price-label"><?php echo $_specialPriceStoreLabel ?></span>
<span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"
<?php if($helperSettings->isShowOfferPrice($_product)):?> itemprop="lowPrice"<?php endif;?>>
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
<p class="sell_price"><?php echo "Selling Price"; ?>
<?php
echo "+ Rs " . $_product->getData("mp_local_shipping_charge") . " Delivery ";
?>
Solução
<span class="price-label"><?php echo $_specialPriceStoreLabel ?></span>
<span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"
<?php if($helperSettings->isShowOfferPrice($_product)):?> itemprop="lowPrice"<?php endif;?>>
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
<?php
$deliveryPrice = $_product->getData("mp_local_shipping_charge");
if($deliveryPrice == 0){
<p class="sell_price"><?php echo "Selling Price (Free Delivery )"; ?>
}elseif(empty($deliveryPrice)){
<p class="sell_price"><?php echo "Selling Price"; ?>
<?php echo "+ Rs 50 Delivery "; ?>
<?php }else {?>
<p class="sell_price"><?php echo "Selling Price"; ?>
<?php
echo "+ Rs " . $_product->getData("mp_local_shipping_charge") . " Delivery ";
?>
<?php } ?>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange