Show or Hide a button from dataset

Hi all, I am new to editor X and I am working on a page that has a repeater showing inventory. Some of the items can be sold and some cannot.

I am using a repeater on a standard page which is currently displaying all the items on the page from a dataset. But I have a button I want hidden on some items if the item is not for sale.

I have attached some sample images of my dataset and the page using the repeater which lists all the items and the button i want to hide if the item is not for sale (the button titled ‘Sale Enquiry’).

Please help me community. Remember I am not a great coder…

I’m not well-versed in code but you should be able to use this similar article that is for videos since it’s checking if the field is empty:
https://support.wix.com/en/article/velo-tutorial-hiding-a-video-player-when-there-is-no-video-to-play

Hi @sam , your code might look something like this:

$w.onReady(function () {

    $w('#YOUR-REPEATER').onItemReady(($item, itemData, index) => {
        if (!itemData.forSale) { 
            $item('#YOUR-BUTTON').hide();
        }
    })
});

Make sure the element IDs match the IDs in your code.