Variant price in a repeater

Question:
How can I display the price of a variant displayed within a repeater?
Product:
Wix Editor
What are you trying to achieve:
I am trying to display the price of a variant when displaying the filtered item in a repeater.

What have you already tried:
I have tired various googling methods and even attempted to put it in chat gpt even though it may be outdated. I have not gotten anything to work thus far.

Additional information:
I am fairly new to Wix coding but understand the basics of it. I know it might be a complicated request.

Can you show an example of what you want to do? Some images or any demo/live website.


I want to get it to show the variant price where $$$$ is. I can only get the base price of the item to show in that place. I would also like to eventually get another text element to show the +/- difference between the selection and other options.

You need code for this. You can’t do math with CMS.

//Pass the selected product data to a variable
let selectedProduct.

$w("#productsRepeaterId").onItemReady(($item, itemData, index) => {
    //rest of the code for other parts of the repater
    $item("#price").text = `Difference: ${selectedProduct.price - itemData.price} Price: ${itemData.price}`;
});

This is the idea of how you can show the difference of the prices between selectedProduct and current variant.

I do not where to put that code. I think that is for a future idea with a difference display. I appreciate the forethought but not to be rude, I am currently not worried about that. I am trying to figure out how to get #price within the items of the repeater to show the variant price.

This is the code i have so far for these 3 repeaters. The filters work but as I said above, i am in need to display the price on the items.

$w.onReady(() => {
    $w('#cpucollapse').onClick(() => {
        toggleBox($w('#cpubox'), $w('#cpuplussign'), $w('#cpuminussign'));
    });
    $w("#brandRep").onItemReady(($item, itemData, index) => {
        $item("#brandselectionbutton").onClick(() => {
            let filter = $w("#brandselectionbutton").label
            filter = $item("#brandselection").text = itemData.brand;
        $w("#dataset21").setFilter(wixData.filter()
            .eq('brand', filter))
         });
    });
    $w("#nameRep").onItemReady(($item, itemData, index) => {
        $item("#cpuselectionbutton").onClick(() => {
            $item("#cpuselection").text = itemData.variantName;
        });
    });
     $w("#seriesRep").onItemReady(($item, itemData, index) => {
        $item("#nameselectionbutton").onClick(() => {
            let filter = $w("#nameselectionbutton").label
            filter = $item("#nameselection").text = itemData.name;
        $w("#dataset22").setFilter(wixData.filter()
            .eq('productName', filter))
        $w("#seriesRep").forEachItem(($otherItem) => {
             $otherItem("#container2").hide();
            });
            $item("#container2").show();
            });
        });
  });

Thank you