Customize a repeater "like a shop"

I want to build a new affiliate marketing website with this service. I tried different ways to build my own shop:

  • I used “wix shop”, but i can’t add descriptions under my “products” page and only in my single product page; i can’t customize the “buy” button for each product with an external url.
  • The most similar result that i want is with repeater: the “products” page connected to a database is what i want, showing my product with a description, a button linked to the dynamic product page where i can add another button with the external affiliate link.

The problem is when i have like 100 products; i just want the repeater to work like the shop, with the automatic “show more” when someone scrolls down the page to see more products.

Is this possible or i have to change the service to a more customizable one because this isn’t possible? Thanks!

Hi,

You can achieve that by adding a Load More button and connecting it to the Load More dataset function.
On the dataset settings you can select the number of elements to display, this will be the number of elements to load every time the user clicks the Load More button.

To finish the implementation you can add this simple code below to the Load More button onClick event to hide it once there are no more items to load:


let numberOfItemsToDisplay = 10; //copy this number from the dataset settings 
let increment = numberOfItemsToDisplay; //the number becomes the increment

export function showmore_click(event, $w) {
	let count = $w("#dataset1").getTotalCount();
	numberOfItemsToDisplay = numberOfItemsToDisplay + increment;
	if (numberOfItemsToDisplay >= count) {
		$w('#showmore').hide();
	}
}; 
2 Likes

Thank you so much for the answer! Perfect service!