Pregunta

Así que obtuve un código PHP, pero quiero separar el 'eco' del 'eco de esto' para poder ponerlos en 2 divs para que pueda darles CSS individuales (he publicado el código exacto de misitio).Este código es para administrar un mensaje de frontend para que las personas puedan ver que los artículos sean para pendiente antes de la fase de pago.

<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,

¿Fue útil?

Solución

<?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 bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top