File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
frontend/web/template/product Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ public function getCurrentProductData()
153153 $ this ->productRenderCollectorComposite
154154 ->collect ($ product , $ productRender );
155155 $ data = $ this ->hydrator ->extract ($ productRender );
156+ $ data ['is_available ' ] = $ product ->isAvailable ();
156157
157158 $ currentProductData = [
158159 'items ' => [
Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ define([
5555 return row [ 'is_salable' ] ;
5656 } ,
5757
58+ /**
59+ * Depends on this option, stock status text can be "In stock" or "Out Of Stock"
60+ *
61+ * @param {Object } row
62+ * @returns {Boolean }
63+ */
64+ isAvailable : function ( row ) {
65+ return row [ 'is_available' ] ;
66+ } ,
67+
5868 /**
5969 * Depends on this option, "Add to cart" button can be shown or hide. Depends on backend configuration
6070 *
Original file line number Diff line number Diff line change 1515 </ button >
1616 </ if >
1717
18- < ifnot args ="isSalable ($row()) ">
18+ < if args ="isAvailable ($row()) === false ">
1919 < div class ="stock unavailable ">
2020 < text args ="$t('Availability') "/>
2121 < span translate ="'Out of stock' "/>
2222 </ div >
23- </ ifnot >
23+ </ if >
2424</ if >
You can’t perform that action at this time.
0 commit comments