// Backend (data.js) import { fetch } from 'wix-fetch'; export function getCoupons() { const url = 'https://api.yoursite.com/coupons'; // Thay bằng URL API của bạn return fetch(url) .then(response => response.json()) .then(json => json.coupons) .catch(error => console.error('Error:', error)); } // Frontend (page code) import { getCoupons } from 'backend/data.js'; $w.onReady(function () { getCoupons().then(coupons => { $w("#repeater1").data = coupons; }); }); // Thiết lập Repeater $w.onReady(function () { $w("#repeater1").onItemReady(($item, itemData, index) => { $item("#text1").text = itemData.title; $item("#text2").text = itemData.description; $item("#button1").label = "Sử Dụng Mã"; $item("#button1").link = itemData.link; }); });
top of page
I'm a product description. I'm a great place to add more details about your product such as sizing, material, care instructions and cleaning instructions.

I'm a product

SKU: 364115376135191
10₫Giá
Color
  • I'm a product detail. I'm a great place to add more information about your product such as sizing, material, care and cleaning instructions. This is also a great space to write what makes this product special and how your customers can benefit from this item.

Sản phẩm liên quan

bottom of page