feat: Add product images support with WP Media Library integration

- Add WP Media Library integration for product and variation images
- Support images array (URLs) conversion to attachment IDs
- Add images array to API responses (Admin & Customer SPA)
- Implement drag-and-drop sortable images in Admin product form
- Add image gallery thumbnails in Customer SPA product page
- Initialize WooCommerce session for guest cart operations
- Fix product variations and attributes display in Customer SPA
- Add variation image field in Admin SPA

Changes:
- includes/Api/ProductsController.php: Handle images array, add to responses
- includes/Frontend/ShopController.php: Add images array for customer SPA
- includes/Frontend/CartController.php: Initialize WC session for guests
- admin-spa/src/lib/wp-media.ts: Add openWPMediaGallery function
- admin-spa/src/routes/Products/partials/tabs/GeneralTab.tsx: WP Media + sortable images
- admin-spa/src/routes/Products/partials/tabs/VariationsTab.tsx: Add variation image field
- customer-spa/src/pages/Product/index.tsx: Add gallery thumbnails display
This commit is contained in:
Dwindi Ramadhana
2025-11-26 16:18:43 +07:00
parent 909bddb23d
commit f397ef850f
69 changed files with 12481 additions and 156 deletions

View File

@@ -0,0 +1,93 @@
import React from 'react';
import { Link } from 'react-router-dom';
export default function Footer() {
const currentYear = new Date().getFullYear();
return (
<footer className="border-t bg-muted/50 mt-auto">
<div className="container-safe py-8">
<div className="grid grid-cols-1 md:grid-cols-4 gap-8">
{/* About */}
<div>
<h3 className="font-semibold mb-4">About</h3>
<p className="text-sm text-muted-foreground">
Modern e-commerce experience powered by WooNooW.
</p>
</div>
{/* Shop */}
<div>
<h3 className="font-semibold mb-4">Shop</h3>
<ul className="space-y-2 text-sm">
<li>
<Link to="/" className="text-muted-foreground hover:text-foreground transition-colors">
All Products
</Link>
</li>
<li>
<Link to="/cart" className="text-muted-foreground hover:text-foreground transition-colors">
Shopping Cart
</Link>
</li>
<li>
<Link to="/checkout" className="text-muted-foreground hover:text-foreground transition-colors">
Checkout
</Link>
</li>
</ul>
</div>
{/* Account */}
<div>
<h3 className="font-semibold mb-4">Account</h3>
<ul className="space-y-2 text-sm">
<li>
<Link to="/account" className="text-muted-foreground hover:text-foreground transition-colors">
My Account
</Link>
</li>
<li>
<Link to="/account/orders" className="text-muted-foreground hover:text-foreground transition-colors">
Order History
</Link>
</li>
<li>
<Link to="/account/profile" className="text-muted-foreground hover:text-foreground transition-colors">
Profile Settings
</Link>
</li>
</ul>
</div>
{/* Support */}
<div>
<h3 className="font-semibold mb-4">Support</h3>
<ul className="space-y-2 text-sm">
<li>
<a href="#" className="text-muted-foreground hover:text-foreground transition-colors">
Contact Us
</a>
</li>
<li>
<a href="#" className="text-muted-foreground hover:text-foreground transition-colors">
Shipping Info
</a>
</li>
<li>
<a href="#" className="text-muted-foreground hover:text-foreground transition-colors">
Returns
</a>
</li>
</ul>
</div>
</div>
{/* Copyright */}
<div className="mt-8 pt-8 border-t text-center text-sm text-muted-foreground">
<p>&copy; {currentYear} WooNooW. All rights reserved.</p>
</div>
</div>
</footer>
);
}