Green Tea + Tea Tree Oil Hand Poured Soap is definitely one of the favorites! Made with an aloe and shea butter base, adding tea tree essential oil and green tea powder making this a wonderfully unique smell of pure freshness!
import { cart } from 'wix-stores'; import wixLocation from 'wix-location'; $w.onReady(async function () { // Get URL query parameters const query = wixLocation.query; const productsParam = query.products; const couponCode = query.coupon; if (!productsParam) { console.log("No products found in URL."); return; } try { // Decode the products parameter const decodedProducts = decodeURIComponent(productsParam); // Example decoded: "12345:3,23456:1" const productEntries = decodedProducts.split(','); let lineItems = []; productEntries.forEach(entry => { const [productId, quantity] = entry.split(':'); if (productId && quantity) { lineItems.push({ productId: productId, quantity: Number(quantity) }); } }); // Add products to cart await cart.addProducts(lineItems); // Apply coupon if exists if (couponCode) { await cart.applyCoupon(couponCode); } // Redirect to Wix native checkout await cart.showMiniCart(); await cart.checkout(); } catch (error) { console.error("Checkout error:", error); } });
# views.py from django.http import JsonResponse from django.views import View class CheckoutView(View): def get(self, request): products_param = request.GET.get('products', '') coupon = request.GET.get('coupon', None) # Parse products product_quantities = {} if products_param: for entry in products_param.split(','): try: product_id, quantity = entry.split(':') product_quantities[product_id] = int(quantity) except ValueError: continue # Skip malformed entries # Build response response_data = { 'products': product_quantities, 'coupon': coupon if coupon else 'No coupon applied' } return JsonResponse(response_data) # urls.py from django.urls import path from .views import CheckoutView urlpatterns = [ path('checkout/', CheckoutView.as_view(), name='checkout'), ]