I have multi-source inventory and have set up one main source and other sources that are suppliers. I want to show message to call first if product is not available in main source. Or maybe even show "call us" if the source is enabled but not available. As some suppliers don't have inventory file yet.

Here is corrent code for product page:

<?php if ($block->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable()): ?>
        <div class="stock available" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('Availability') ?><span><?php /* @escapeNotVerified */ echo __('In stock') ?></span>
    <?php else: ?>
        <div class="stock unavailable" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('Availability') ?><span><?php /* @escapeNotVerified */ echo __('Out of stock') ?></span>
    <?php endif; ?>
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.