Items grid stock info
Posted: 01 Nov 2024, 12:57
Hey guys,
I have a rather specific problem here. So I am overriding a file layouts/com_phocacart/items_grid.php and the reason is I needed to create a design specific card from each product. Now the only thing I need to also implement is some sort of Sold out label for each item (if its sold out). So my question is - can I somehow get the info about stock being 0 for all variants of a product here? Because I didnt find this in any of the variables that are in this file:
I basically just need to know if there are no variants with remaining stock or if the product has no variants and there is 0 stock. Then I could use it as a condition to implement the sold out tag...
Btw - it might be some straightforward thing I just didnt notice... Please let me know. Thank you!
I have a rather specific problem here. So I am overriding a file layouts/com_phocacart/items_grid.php and the reason is I needed to create a design specific card from each product. Now the only thing I need to also implement is some sort of Sold out label for each item (if its sold out). So my question is - can I somehow get the info about stock being 0 for all variants of a product here? Because I didnt find this in any of the variables that are in this file:
Code: Select all
$d = $displayData;
$t = $d['t'];
$s = $d['s'];
$col = $d['col'];
Btw - it might be some straightforward thing I just didnt notice... Please let me know. Thank you!