refactor: rename shopLayoutData to storefrontLayoutData
Some checks failed
CI / ruff (push) Successful in 11s
CI / pytest (push) Failing after 46m49s
CI / validate (push) Successful in 23s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped

Align Alpine.js base component naming with storefront terminology.
Updated across all storefront JS, templates, and documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 19:06:45 +01:00
parent ec888f2e94
commit a6e6d9be8e
25 changed files with 130 additions and 130 deletions

View File

@@ -175,7 +175,7 @@
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('shoppingCart', () => {
const baseData = shopLayoutData();
const baseData = storefrontLayoutData();
return {
...baseData,

View File

@@ -146,7 +146,7 @@ window.CATEGORY_SLUG = '{{ category_slug | default("") }}';
document.addEventListener('alpine:init', () => {
Alpine.data('shopCategory', () => ({
...shopLayoutData(),
...storefrontLayoutData(),
// Data
categorySlug: window.CATEGORY_SLUG,

View File

@@ -218,7 +218,7 @@ window.STORE_ID = {{ store.id }};
document.addEventListener('alpine:init', () => {
Alpine.data('productDetail', () => {
const baseData = shopLayoutData();
const baseData = storefrontLayoutData();
return {
...baseData,

View File

@@ -145,7 +145,7 @@
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('shopProducts', () => ({
...shopLayoutData(),
...storefrontLayoutData(),
products: [],
loading: true,
filters: {
@@ -205,7 +205,7 @@ document.addEventListener('alpine:init', () => {
this.loadProducts();
},
// formatPrice is inherited from shopLayoutData() via spread operator
// formatPrice is inherited from storefrontLayoutData() via spread operator
async addToCart(product) {
console.log('[SHOP] Adding to cart:', product);

View File

@@ -170,7 +170,7 @@
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('shopSearch', () => ({
...shopLayoutData(),
...storefrontLayoutData(),
// Search state
searchInput: '',

View File

@@ -135,7 +135,7 @@
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('shopWishlist', () => ({
...shopLayoutData(),
...storefrontLayoutData(),
// Data
items: [],

View File

@@ -477,7 +477,7 @@
<script>
function checkoutPage() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// State
loading: true,
@@ -595,8 +595,8 @@ function checkoutPage() {
console.log('[CHECKOUT] Initializing...');
// Initialize session
if (typeof shopLayoutData === 'function') {
const baseData = shopLayoutData();
if (typeof storefrontLayoutData === 'function') {
const baseData = storefrontLayoutData();
if (baseData.init) {
baseData.init.call(this);
}

View File

@@ -7,7 +7,7 @@
{% block meta_description %}{{ page.meta_description or store.description or store.name }}{% endblock %}
{# Alpine.js component #}
{% block alpine_data %}shopLayoutData(){% endblock %}
{% block alpine_data %}storefrontLayoutData(){% endblock %}
{% block content %}
<div class="min-h-screen">

View File

@@ -7,7 +7,7 @@
{% block meta_description %}{{ page.meta_description or store.description or store.name }}{% endblock %}
{# Alpine.js component #}
{% block alpine_data %}shopLayoutData(){% endblock %}
{% block alpine_data %}storefrontLayoutData(){% endblock %}
{% block content %}
<div class="min-h-screen">

View File

@@ -16,7 +16,7 @@ const shopLog = {
* Shop Layout Data
* Base Alpine.js component for shop pages
*/
function shopLayoutData() {
function storefrontLayoutData() {
return {
// Theme state
dark: localStorage.getItem('shop-theme') === 'dark',
@@ -243,7 +243,7 @@ function shopLayoutData() {
}
// Make available globally
window.shopLayoutData = shopLayoutData;
window.storefrontLayoutData = storefrontLayoutData;
/**
* Language Selector Component

View File

@@ -318,7 +318,7 @@
<script>
function addressesPage() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// State
loading: true,

View File

@@ -163,7 +163,7 @@
<script>
function accountDashboard() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
showLogoutModal: false,
confirmLogout() {

View File

@@ -288,7 +288,7 @@
<script>
function shopProfilePage() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// State
profile: null,
@@ -508,7 +508,7 @@ function shopProfilePage() {
}
},
// formatPrice is inherited from shopLayoutData() via spread operator
// formatPrice is inherited from storefrontLayoutData() via spread operator
formatDate(dateStr) {
if (!dateStr) return '-';

View File

@@ -3,7 +3,7 @@
function customerLoyaltyDashboard() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// Data
card: null,

View File

@@ -3,7 +3,7 @@
function customerLoyaltyEnroll() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// Program info
program: null,

View File

@@ -3,7 +3,7 @@
function customerLoyaltyHistory() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// Data
card: null,

View File

@@ -86,7 +86,7 @@
<script>
function customerLoyaltyEnrollSuccess() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
walletUrls: { google_wallet_url: null, apple_wallet_url: null },
async init() {
try {

View File

@@ -253,7 +253,7 @@
<script>
function shopMessages() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
loading: true,
conversations: [],
selectedConversation: null,

View File

@@ -340,7 +340,7 @@
<script>
function shopOrderDetailPage() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// State
order: null,
@@ -416,7 +416,7 @@ function shopOrderDetailPage() {
return this.statuses[status]?.class || 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200';
},
// formatPrice is inherited from shopLayoutData() via spread operator
// formatPrice is inherited from storefrontLayoutData() via spread operator
formatDateTime(dateStr) {
if (!dateStr) return '-';

View File

@@ -134,7 +134,7 @@
<script>
function shopOrdersPage() {
return {
...shopLayoutData(),
...storefrontLayoutData(),
// State
orders: [],
@@ -209,7 +209,7 @@ function shopOrdersPage() {
return this.statuses[status]?.class || 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200';
},
// formatPrice is inherited from shopLayoutData() via spread operator
// formatPrice is inherited from storefrontLayoutData() via spread operator
formatDate(dateStr) {
if (!dateStr) return '-';