Um pouco de php/html help
-
12-12-2019 - |
Pergunta
Então, eu tenho um código php, mas eu quero separar o 'echo' a partir da eco 'esse' para que eu possa colocá-los em 2 DIVs para que eu possa dar-lhes individuais css (de eu ter postado o código exato do meu site).Este código é para dar um frontend mensagem para que as pessoas possam ver que os itens são para o atraso ANTES da fase de check-out.
<div class="extra-info">
<?php $inventory = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
$inv_qty = (int)$inventory->getQty();
if ($inventory->getBackorders() >= 0 && $inv_qty == 0) {
echo "TO ORDER - LEAD TIME APROX. 3 WEEKS";
} else {
echo $this->getChildHtml('product_type_availability');
}
?>
</div>
Thx,
Solução
<?php $inventory = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
$inv_qty = (int)$inventory->getQty();
if ($inventory->getBackorders() >= 0 && $inv_qty == 0) {
?>
<div class="extra-info-a">TO ORDER - LEAD TIME APROX. 3 WEEKS</div>
<?php
} else {
?>
<div class="extra-info-b"><?php echo $this->getChildHtml('product_type_availability');?></div>
<?php
}
?>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange