// Import necessary Wix modules
import wixData from 'wix-data';
import wixCRM from 'wix-crm';
import wixWindow from 'wix-window';
import wixPay from 'wix-pay';
import wixMarketing from 'wix-marketing';
// Function to handle form submission
export function submitLeadForm(event) {
event.preventDefault(); // Prevent default form submission
// Get form values
const name = $w('#nameInput').value;
const email = $w('#emailInput').value;
// Create lead object
const lead = {
name,
email,
date: new Date()
};
// Save lead to the Leads dataset
wixData.insert('Leads', lead)
.then(() => {
// Add lead to Wix CRM
wixCRM.createContact({ name, emails: [email] })
.then(() => {
// Show thank you message or redirect
$w('#thankYouMessage').show();
$w('#leadForm').hide();
})
.catch((err) => {
console.error('Error creating contact in CRM:', err);
});
})
.catch((err) => {
console.error('Error saving lead:', err);
});
}
// Function to track user behavior and dynamically recommend products
export function trackUserBehavior() {
// Track button clicks and dynamically recommend products
$w('#specialOfferButton').onClick(() => {
wixWindow.trackEvent('Click', {
category: 'Button',
label: 'Special Offer'
});
// Show personalized recommendation based on user behavior
showPersonalizedRecommendation();
});
// Track page views
wixWindow.trackEvent('Pageview', {
category: 'Page',
label: 'Landing Page'
});
}
// Function to show personalized recommendations
function showPersonalizedRecommendation() {
// Example: Fetch and show a special offer based on user behavior
wixData.query('Products')
.limit(1)
.find()
.then((results) => {
if (results.items.length > 0) {
const product = results.items[0];
$w('#personalizedRecommendation').text = `Special Offer: ${product.name} for just $${product.price}!`;
$w('#personalizedRecommendation').show();
}
})
.catch((err) => {
console.error('Error fetching product:', err);
});
}
// Function to handle sales transactions
export function processSale(productId, price) {
// Trigger the payment process
wixPay.startPayment({
items: [{
name: productId,
price: price,
quantity: 1
}],
amount: price
})
.then((result) => {
if (result.status === 'Successful') {
// Save sale information to the Sales dataset
const sale = {
productId,
price,
date: new Date(),
transactionId: result.transactionId
};
wixData.insert('Sales', sale)
.then(() => {
// Show thank you message or confirmation
$w('#thankYouMessage').text = 'Thank you for your purchase!';
$w('#thankYouMessage').show();
})
.catch((err) => {
console.error('Error saving sale:', err);
});
} else {
console.error('Payment failed:', result);
}
})
.catch((err) => {
console.error('Payment processing error:', err);
});
}
// Function to handle abandoned carts
export function handleAbandonedCart(userId, cartItems) {
const abandonedCart = {
userId,
cartItems,
date: new Date()
};
// Save abandoned cart to the AbandonedCarts dataset
wixData.insert('AbandonedCarts', abandonedCart)
.then(() => {
// Send email reminder about the abandoned cart
wixCRM.emailContact(userId, 'abandonedCartReminder', {
variables: {
cartItems: JSON.stringify(cartItems)
}
})
.then(() => {
console.log('Abandoned cart reminder sent');
})
.catch((err) => {
console.error('Error sending abandoned cart reminder:', err);
});
})
.catch((err) => {
console.error('Error saving abandoned cart:', err);
});
}
// Function to show dynamic promotions
function showDynamicPromotions() {
wixData.query('Promotions')
.limit(1)
.find()
.then((results) => {
if (results.items.length > 0) {
const promotion = results.items[0];
$w('#dynamicPromotion').text = `Special Promotion: ${promotion.title} - ${promotion.description}`;
$w('#dynamicPromotion').show();
}
})
.catch((err) => {
console.error('Error fetching promotion:', err);
});
}
// Function to bind events and track user behavior
$w.onReady(function () {
$w('#leadForm').onSubmit(submitLeadForm);
trackUserBehavior();
// Example: Bind sales process to a button
$w('#buyNowButton').onClick(() => {
processSale('product123', 29.99);
});
// Example: Handle abandoned cart
$w('#abandonCartButton').onClick(() => {
const userId = 'user123';
const cartItems = [{ productId: 'product123', quantity: 1 }];
handleAbandonedCart(userId, cartItems);
});
// Show dynamic promotions
showDynamicPromotions();
});
// Import necessary Wix modules
import wixData from 'wix-data';
import wixCRM from 'wix-crm';
import wixWindow from 'wix-window';
import wixPay from 'wix-pay';
import wixMarketing from 'wix-marketing';
// Function to handle form submission
function submitLeadForm(event) {
event.preventDefault(); // Prevent default form submission
// Get form values
const name = $w('#nameInput').value;
const email = $w('#emailInput').value;
// Create lead object
const lead = {
name,
email,
date: new Date()
};
// Save lead to the Leads dataset
wixData.insert('Leads', lead)
.then(() => {
// Add lead to Wix CRM
wixCRM.createContact({ name, emails: [email] })
.then(() => {
// Show thank you message or redirect
$w('#thankYouMessage').show();
$w('#leadForm').hide();
})
.catch((err) => {
console.error('Error creating contact in CRM:', err);
});
})
.catch((err) => {
console.error('Error saving lead:', err);
});
}
// Function to track user behavior and dynamically recommend products
function trackUserBehavior() {
// Track button clicks and dynamically recommend products
$w('#specialOfferButton').onClick(() => {
wixWindow.trackEvent('Click', {
category: 'Button',
label: 'Special Offer'
});
// Show personalized recommendation based on user behavior
showPersonalizedRecommendation();
});
// Track page views
wixWindow.trackEvent('Pageview', {
category: 'Page',
label: 'Landing Page'
});
}
// Function to show personalized recommendations
function showPersonalizedRecommendation() {
// Example: Fetch and show a special offer based on user behavior
wixData.query('Products')
.limit(1)
.find()
.then((results) => {
if (results.items.length > 0) {
const product = results.items[0];
$w('#personalizedRecommendation').text = `Special Offer: ${product.name} for just $${product.price}!`;
$w('#personalizedRecommendation').show();
}
})
.catch((err) => {
console.error('Error fetching product:', err);
});
}
// Function to handle sales transactions
function processSale(productId, price) {
// Trigger the payment process
wixPay.startPayment({
items: [{
name: productId,
price: price,
quantity: 1
}],
amount: price
})
.then((result) => {
if (result.status === 'Successful') {
// Save sale information to the Sales dataset
const sale = {
productId,
price,
date: new Date(),
transactionId: result.transactionId
A natural tan and sculpt all year round, our bronzer has the perfect balance of red and brown tones to enhance your makeup look. Dust our bronzer across your cheeks and forehead for a flattering, complete look with a silky, smooth texture. You can pair your favorite blush with our bronzer for a multidimensional look. Mattifying to reduce shine, our bronzer is designed to match every skin tone.
Made in North America.
Benefits
Compatible with all skin types with a silky texture for even coverage
Formulated with a balance of red and brown tones to amplify the natural effects of our bronzer
Vegan
Paraben & talc free
Recyclable packaging
Net wt. 0.44 oz / 12.5 g
Application
Use a bronzing brush to lightly sweep on the powder and tap off excess product
Swipe a line of powder from your ear to the apple of your cheek and blend it out with small circular strokes
Swirl the brush in small circles across your hairline from one temple to the other
Lastly, to chisel your jaw, blend more bronzer along the edge of your jawline
Ingredients
Mica, Nylon-12, Titanium Dioxide, Magnesium Stearate, Bismuth Oxychloride, Boron Nitride, Diisostearyl Malate, Pentaerythrityl Tetraisostearate, Silicone Oil, Phenoxyethanol, Tocopheryl Acetate. May Contain: Ci 77491, Ci 77492, Ci 77499, Red 40 Lake
bottom of page
// Function to handle form submission
function submitLeadForm(event) {
event.preventDefault(); // Prevent default form submission
// Get form values
const name = $w('#nameInput').value;
const email = $w('#emailInput').value;
// Create lead object
const lead = {
name,
email,
date: new Date()
};
// Save lead to the Leads dataset
wixData.insert('Leads', lead)
.then(() => {
// Add lead to Wix CRM
wixCRM.createContact({ name, emails: [email] })
.then(() => {
// Show thank you message or redirect
$w('#thankYouMessage').show();
$w('#leadForm').hide();
})
.catch((err) => {
console.error('Error creating contact in CRM:', err);
});
})
.catch((err) => {
console.error('Error saving lead:', err);
});
}
// Function to track user behavior and dynamically recommend products
function trackUserBehavior() {
// Track button clicks and dynamically recommend products
$w('#specialOfferButton').onClick(() => {
wixWindow.trackEvent('Click', {
category: 'Button',
label: 'Special Offer'
});
// Show personalized recommendation based on user behavior
showPersonalizedRecommendation();
});
// Track page views
wixWindow.trackEvent('Pageview', {
category: 'Page',
label: 'Landing Page'
});
}
// Function to show personalized recommendations
function showPersonalizedRecommendation() {
// Example: Fetch and show a special offer based on user behavior
wixData.query('Products')
.limit(1)
.find()
.then((results) => {
if (results.items.length > 0) {
const product = results.items[0];
$w('#personalizedRecommendation').text = `Special Offer: ${product.name} for just $${product.price}!`;
$w('#personalizedRecommendation').show();
}
})
.catch((err) => {
console.error('Error fetching product:', err);
});
}
// Function to handle sales transactions
function processSale(productId, price) {
// Trigger the payment process
wixPay.startPayment({
items: [{
name: productId,
price: price,
quantity: 1
}],
amount: price
})
.then((result) => {
if (result.status === 'Successful') {
// Save sale information to the Sales dataset
const sale = {
productId,
price,
date: new Date(),
transactionId: result.transactionId
};
wixData.insert('Sales', sale)
.then(() => {
// Show thank you message or confirmation
$w('#tha