Question

J'ai donc reçu du code PHP, mais je tiens à séparer "Echo" de "Echo" de sorte que je peux donc les mettre en 2 divs afin que je puisse leur donner individuellement CSS (j'ai posté le code exact de monplacer).Ce code est de donner un message frontal pour que les gens puissent voir que les articles sont destinés à la rétroaction avant la phase de caisse.

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

Était-ce utile?

La solution

<?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
} 
?>
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top