VOOZH about

URL: https://deepwiki.com/gp247net/shop

⇱ gp247net/shop | DeepWiki


Loading...
Menu

GP247/Shop Overview

Purpose and Scope

This document provides a high-level overview of the GP247/Shop e-commerce package, explaining its role within the GP247 ecosystem, architectural design, and core subsystems. GP247/Shop transforms a GP247-based application into a full-featured online store with product catalog management, order processing, customer accounts, and extensible payment/shipping integrations.

For detailed information about specific subsystems, see:

Sources: readme.md1-128 readme_vi.md1-135


Package Position in GP247 Ecosystem

GP247/Shop is a Laravel package that builds upon the GP247 ecosystem foundation. It requires gp247/core and gp247/front as dependencies and integrates through Laravel's service provider pattern.

Ecosystem Dependency Hierarchy


Sources: readme.md14-17 readme_vi.md19-20

The package can be installed in two ways:

Installation MethodComponents IncludedPrimary Use Case
Option 1: Modularcomposer require gp247/shop added to gp247/cmsCustom integration, selective features
Option 2: Full Stackcomposer create-project gp247/s-cartComplete e-commerce site, rapid deployment

Sources: readme.md66-100 readme_vi.md69-108


Architectural Principles

GP247/Shop follows five core architectural principles that enable flexibility, scalability, and extensibility:

1. Modular Service Provider Integration

The ShopServiceProvider class acts as the integration hub, registering all package components with the Laravel application container. This includes middleware, commands, view namespaces, translations, and configuration files.


Sources: readme.md75-81 readme_vi.md78-85

2. Configuration-Driven Behavior

Rather than hardcoding business rules, the system stores configurations in the admin_config table with a hierarchical group/code/key structure. This allows different stores to have different behaviors without code modifications.

Configuration GroupControlsExample Keys
admin_configAdmin panel settingsADMIN_NAME, ADMIN_TITLE, ADMIN_LOGO
display_configProduct display rulesproduct_top, product_list, product_detail
captcha_configCAPTCHA requirementscaptcha_mode, captcha_method
email_configEmail triggersemail_action_new_order, email_action_register
order_configOrder validationCustomer field requirements, checkout behavior

Configurations are accessed via helper functions: gp247_config($key, $default) and gp247_config_admin($key, $default).

Sources: readme.md20-63 readme_vi.md23-66

3. Hybrid Multi-Tenant Architecture

The system supports two tenant modes: root store (marketplace administrator with omniscient access) and vendor stores (isolated access to own data).


Sources: readme.md46-50 readme_vi.md49-53

4. Plugin Extensibility at Business Decision Points

Plugins extend functionality at critical junctures: payment processing, shipping calculation, and order total calculation. The system discovers plugins dynamically from the admin_config table.


Sources: readme.md36-43 readme_vi.md39-46

5. Domain-Driven Database Design

The database schema organizes 39 tables into four logical domains:

DomainTablesIsolation Strategy
Catalogshop_product, shop_category, shop_brand, shop_supplier, etc.Junction tables (shop_product_store, shop_category_store)
Transactionsshop_order, shop_order_detail, shop_order_history, shop_order_total, shop_shoppingcartDirect store_id column
Customersshop_customer, shop_customer_addressDirect store_id column
Referenceshop_currency, shop_order_status, shop_payment_status, shop_shipping_status, shop_taxShared (no isolation)

Sources: readme.md21-25 readme_vi.md24-28


Major Subsystems and Code Organization

GP247/Shop organizes code into subsystems that correspond to business domains. Each subsystem includes models, controllers (admin/front), and views.

Subsystem Map with Key Classes


Sources: readme.md20-50 readme_vi.md23-53

File Structure Overview

DirectoryPurposeKey Files
src/DB/Migrations/Database table definitions39 migration files defining schema
src/DB/Seeders/Initial data populationDataShopInitializeSeeder, DataShopDefaultSeeder
src/Models/Eloquent modelsShopProduct, ShopOrder, ShopCustomer, ShopCategory, etc.
src/Admin/Controllers/Admin panel controllersAdminProductController, AdminOrderController, etc.
src/Front/Controllers/Frontend controllersShopProductController, ShopCartController, etc.
src/Api/Controllers/REST API endpointsMemberAuthController, UserController
src/Admin/Middleware/Admin middlewareAdminAuthenticate, AdminPermission, AdminStoreId
src/Front/Middleware/Frontend middlewareCurrency, EmailVerified, FrontStoreId
src/Service/Business logic servicesCartService
src/Library/Utility librariesHelpers/, Mapping/
Views/admin/Admin panel viewsBlade templates for admin interface
Views/front/Frontend viewsBlade templates for store frontend
config/Configuration filesgp247_config.php
lang/TranslationsMulti-language support files

Sources: readme.md106-122 readme_vi.md113-130


Bootstrap and Initialization Flow

When the package is installed and registered, the following initialization sequence occurs:


Sources: readme.md72-87 readme_vi.md75-93

Artisan Commands Provided

CommandPurpose
gp247:shop-installRun migrations and seeders to initialize shop database and configuration
gp247:shop-samplePopulate database with sample products, categories, and orders for testing
gp247:shop-uninstallRemove shop tables and configurations (destructive)

Sources: readme.md84-87 readme_vi.md89-93


Feature Summary

GP247/Shop delivers comprehensive e-commerce capabilities across multiple functional areas:

Core E-commerce Features

Feature AreaCapabilitiesAdmin ControllersFrontend Controllers
Product CatalogCategories, attributes, variants, inventory, bulk import/exportAdminProductController, AdminCategoryController, AdminAttributeGroupControllerShopProductController, ShopCategoryController, ShopBrandController
Order ProcessingOrder tracking, multiple payment gateways, shipping methods, status managementAdminOrderController, AdminOrderStatusControllerShopOrderController, ShopCartController
Customer ManagementProfiles, addresses, order history, groups, discountsAdminCustomerControllerShopAccountController, MemberAuthController
MarketingPromotions, coupons, newsletters, reviews, ratingsAdminPromotionController, AdminNewsControllerShopNewsController
Shopping ExperienceCart, wishlist, comparison, recently viewedN/AShopCartController
Multi-vendorVendor dashboard, commission management, vendor products/ordersAdminSupplierController, AdminReportControllerN/A

Sources: readme.md20-50 readme_vi.md23-53

Inherited GP247 Ecosystem Features

The package inherits powerful CMS capabilities from the GP247 ecosystem:

  • Page content management with WYSIWYG editor
  • Flexible template system with theme switching
  • Extensible plugin architecture
  • Navigation and link management with drag-drop menu builder
  • Integrated contact and subscription forms
  • Multi-language support with translation management
  • SEO optimization (meta tags, sitemaps, friendly URLs)
  • Responsive design with mobile-first approach
  • Security features (CSRF protection, XSS filtering, permission system)
  • Backup and restore capabilities

Sources: readme.md52-62 readme_vi.md55-66


Customization and Extension Points

GP247/Shop provides multiple extension mechanisms for customization:

View Customization

Views can be published and customized at two levels:


Sources: readme.md106-122 readme_vi.md113-130

Plugin Extension Points

Plugins can be added to extend functionality at three primary integration points:

Plugin TypeInterface MethodsUse Cases
ShippinggetInfo(), endApp()Custom shipping rate calculation, carrier integration, tracking
PaymentprocessOrder(), handleCallback()Payment gateway integration, transaction processing
TotalprocessDataTotal()Custom fees, tax calculation, loyalty point redemption

Plugins are discovered dynamically via the admin_config table and must follow naming conventions (e.g., all plugins require an AppConfig class with defined interface methods).

Sources: readme.md27-33 readme_vi.md30-36


Technical Dependencies

GP247/Shop requires the following technology stack:

ComponentVersion/RequirementPurpose
Laravel11.xApplication framework
PHP≥8.2Runtime environment
DatabaseMySQL 5.7+, MariaDB 10.3+, or PostgreSQL 10+Data persistence
gp247/core^9.0Core utilities and configuration system
gp247/front^9.0Frontend template system
Laravel Sanctum^4.0API authentication (for customer API)

Sources: readme.md64-87 readme_vi.md67-93


Related Documentation

For detailed information about specific subsystems and implementation details, refer to:

Sources: readme.md1-128 readme_vi.md1-135