bagisto-shipping-method-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shipping Method Development

配送方式开发

Overview

概述

Creating custom shipping methods in Bagisto allows you to tailor delivery options to meet your specific business needs. Whether you need special handling for fragile items, express delivery options, or region-specific shipping rules, custom shipping methods provide the flexibility your e-commerce store requires.
For our tutorial, we'll create a Custom Express Shipping method that demonstrates all the essential concepts you need to build any type of shipping solution.
在Bagisto中创建自定义配送方式,可让您根据特定业务需求定制配送选项。无论您需要为易碎物品提供特殊处理、极速配送选项,还是针对特定地区设置配送规则,自定义配送方式都能为您的电商店铺提供所需的灵活性。
在本教程中,我们将创建一个自定义极速配送方式,展示构建各类配送解决方案所需的核心概念。

When to Apply

适用场景

Activate this skill when:
  • Creating new shipping methods
  • Integrating shipping carriers (FedEx, UPS, DHL, USPS, etc.)
  • Adding shipping options to checkout
  • Modifying existing shipping configurations
  • Creating admin configuration for shipping methods
  • Implementing rate calculation logic
在以下场景中使用此技能:
  • 创建新的配送方式
  • 集成配送承运人(FedEx、UPS、DHL、USPS等)
  • 在结账流程中添加配送选项
  • 修改现有配送配置
  • 为配送方式创建后台管理配置
  • 实现费率计算逻辑

Bagisto Shipping Architecture

Bagisto配送系统架构

Bagisto's shipping system is built around a flexible carrier-based architecture that separates configuration from business logic.
Bagisto的配送系统基于灵活的承运人架构构建,将配置与业务逻辑分离。

Core Components

核心组件

ComponentPurposeLocation
Carriers ConfigurationDefines shipping method properties
Config/carriers.php
Carrier ClassesContains rate calculation logic
Carriers/ClassName.php
System ConfigurationAdmin interface forms
Config/system.php
Service ProviderRegisters shipping method
Providers/ServiceProvider.php
Shipping FacadeCollects and manages rates
Webkul\Shipping\Shipping
组件用途位置
承运人配置定义配送方式属性
Config/carriers.php
承运人类包含费率计算逻辑
Carriers/ClassName.php
系统配置后台管理界面表单
Config/system.php
服务提供者注册配送方式
Providers/ServiceProvider.php
Shipping Facade收集并管理配送费率
Webkul\Shipping\Shipping

Key Features

核心特性

  • Flexible Rate Calculation: Support for per-unit, per-order, weight-based, or custom pricing.
  • Configuration Management: Admin-friendly settings interface.
  • Multi-channel Support: Different rates and settings per sales channel.
  • Localization Ready: Full translation support.
  • Extensible Architecture: Easy integration with third-party APIs.
  • 灵活的费率计算:支持按单位、按订单、按重量或自定义定价。
  • 配置管理:面向管理员的友好设置界面。
  • 多渠道支持:每个销售渠道可设置不同的费率和配置。
  • 本地化就绪:完整的翻译支持。
  • 可扩展架构:轻松集成第三方API。

Reference files — load only what the current task needs

参考文件——仅加载当前任务所需内容

FileLoad when
implementation.mdBuilding a carrier — the step-by-step guide
carrier-api.mdThe base carrier class and the CartShippingRate model
reference.mdBuilt-in carriers, pricing examples, the Shipping facade, package layout, testing, pitfalls
REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.
文件加载时机
implementation.md构建承运人——分步指南
carrier-api.md基础承运人类和CartShippingRate模型
reference.md内置承运人、定价示例、Shipping facade、包结构、测试、常见陷阱
必备子技能:在完成任何更改前,请使用bagisto-change-verification。