Skip to content

Commit adacf15

Browse files
MC-40873: Product is shown as Out of Stock on CMS page when Category Permissions are enabled
1 parent 1bde67d commit adacf15

File tree

14 files changed

+14
-14
lines changed

14 files changed

+14
-14
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</button>
7979
</form>
8080
<?php else :?>
81-
<?php if ($item->getIsSalable()) :?>
81+
<?php if ($item->isAvailable()) :?>
8282
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
8383
<?php else :?>
8484
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ $_item = null;
287287
</form>
288288
<?php endif; ?>
289289
<?php else:?>
290-
<?php if ($_item->getIsSalable()):?>
290+
<?php if ($_item->isAvailable()):?>
291291
<div class="stock available">
292292
<span><?= $block->escapeHtml(__('In stock')) ?></span>
293293
</div>

app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
6363
. ' data-mage-init=\'{ "redirectUrl": { "event": "click", url: "' . $block->escapeUrl($block->getAddToCartUrl($_product)) . '"} }\'>'
6464
. '<span>' . $block->escapeHtml(__('Add to Cart')) . '</span></button>';
6565
} else {
66-
$info['button'] = $_product->getIsSalable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' :
66+
$info['button'] = $_product->isAvailable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' :
6767
'<div class="stock unavailable"><span>' . $block->escapeHtml(__('Out of stock')) . '</span></div>';
6868
}
6969

app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</button>
5353
<?php endif; ?>
5454
<?php else :?>
55-
<?php if ($_product->getIsSalable()) :?>
55+
<?php if ($_product->isAvailable()) :?>
5656
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
5757
<span><?= $block->escapeHtml(__('In stock')) ?></span>
5858
</div>

app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if ($exist = ($block->getProductCollection() && $block->getProductCollection()->
8888
</button>
8989
<?php endif; ?>
9090
<?php else :?>
91-
<?php if ($_item->getIsSalable()) :?>
91+
<?php if ($_item->isAvailable()) :?>
9292
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
9393
<?php else :?>
9494
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use Magento\Framework\App\Action\Action;
7777
</button>
7878
</form>
7979
<?php else: ?>
80-
<?php if ($_item->getIsSalable()): ?>
80+
<?php if ($_item->isAvailable()): ?>
8181
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
8282
<?php else: ?>
8383
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
?>
1313
<?php $_product = $block->getProduct() ?>
1414

15-
<?php if ($_product->getIsSalable()) : ?>
15+
<?php if ($_product->isAvailable()) : ?>
1616
<div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>">
1717
<span><?= $block->escapeHtml(__('In stock')) ?></span>
1818
</div>

app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $rating = 'short';
6060
</button>
6161
<?php endif; ?>
6262
<?php else : ?>
63-
<?php if ($item->getIsSalable()) : ?>
63+
<?php if ($item->isAvailable()) : ?>
6464
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
6565
<?php else : ?>
6666
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if ($exist = $block->getRecentlyComparedProducts()) {
7878
<?php endif; ?>
7979
</div>
8080
<?php else : ?>
81-
<?php if ($_product->getIsSalable()) : ?>
81+
<?php if ($_product->isAvailable()) : ?>
8282
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
8383
<?php else : ?>
8484
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if ($exist = $block->getRecentlyComparedProducts()) {
8383
</button>
8484
<?php endif; ?>
8585
<?php else : ?>
86-
<?php if ($_item->getIsSalable()) : ?>
86+
<?php if ($_item->isAvailable()) : ?>
8787
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
8888
<?php else : ?>
8989
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

0 commit comments

Comments
 (0)