test-magenx/module-quote

不适用

安装: 0

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:magento2-module

101.2.3 2021-10-10 22:13 UTC

README

此模块提供了客户购物车管理功能。

安装

The Magento_Quote 模块是 Magento 2 的基础模块之一。您无法禁用或卸载此模块。

The Magento_Quote 模块在数据库中创建以下表

  • quote
  • quote_address
  • quote_item
  • quote_address_item
  • quote_item_option
  • quote_payment
  • quote_shipping_rate
  • quote_id_mask

有关在 Magento 2 中安装模块的信息,请参阅 启用或禁用模块

可扩展性

扩展开发者可以与 Magento_Quote 模块交互。有关 Magento 扩展机制的更多信息,请参阅 Magento 插件

Magento 依赖注入机制 允许您覆盖 Magento_Quote 模块的功能。

事件

模块触发了以下事件

  • sales_quote_address_collection_load_after 事件在 \Magento\Quote\Model\ResourceModel\Quote\Address\Collection::_afterLoad 方法中。参数

    • quote_address_collection 是一个 $this 对象 (Magento\Quote\Model\ResourceModel\Quote\Address\Collection 类)
  • items_additional_data 事件在 \Magento\Quote\Model\Cart\Totals\ItemConverter::modelToDataObject 方法中。参数

    • item 是一个 quote_item 对象 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_remove_item 事件在 \Magento\Quote\Model\Quote::removeItem 方法中。参数

    • quote_item 是一个 quote_item 对象 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_add_item 事件在 \Magento\Quote\Model\Quote::addItem 方法中。参数

    • quote_item 是一个 quote_item 对象 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_product_add_after 事件在 \Magento\Quote\Model\Quote::addProduct 方法中。参数

    • items 是一个包含 quot_item 对象的数组 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_merge_before 事件在 \Magento\Quote\Model\Quote::merge 方法中。参数

    • quote 是一个 $this 对象 (\Magento\Quote\Model\Quote 类)
    • source 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • sales_quote_merge_after 事件在 \Magento\Quote\Model\Quote::merge 方法中。参数

    • quote 是一个 $this 对象 (\Magento\Quote\Model\Quote 类)
    • source 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • sales_convert_quote_to_order 事件在 \Magento\Quote\Model\Quote\Address\ToOrder::convert 方法中。参数

    • order 是一个订单对象 (\Magento\Sales\Model\Order 类)
    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • sales_quote_item_qty_set_after 事件在 \Magento\Quote\Model\Quote\Item::setQty 方法中。参数

    • item 是一个 $this 对象 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_item_set_product 事件在 \Magento\Quote\Model\Quote\Item::setProduct 方法中。参数

    • product 是一个产品对象 (\Magento\Catalog\Model\Product 类)
    • quote_item 是一个 $this 对象 (\Magento\Quote\Model\Quote\Item 类)
  • sales_quote_payment_import_data_before 事件在 \Magento\Quote\Model\Quote\Payment::importData 方法中。参数

    • payment 是一个 $this 对象 (\Magento\Quote\Model\Quote\Payment 类)
    • input 是一个数据对象 (\Magento\Framework\DataObject 类)
  • sales_quote_collect_totals_before 事件在 \Magento\Quote\Model\Quote\TotalsCollector::collect 方法中。参数

    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • sales_quote_collect_totals_after 事件在 \Magento\Quote\Model\Quote\TotalsCollector::collect 方法中。参数

    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • sales_quote_address_collect_totals_before 事件在 \Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals 方法中。参数

    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
    • shipping_assignment 是一个 shipping_assignment 对象 (\Magento\Quote\Model\ShippingAssignment 类)
    • total 是一个总计对象(\Magento\Quote\Model\Quote\Address\Total 类)
  • \Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals 方法中,sales_quote_address_collect_totals_after 事件。参数

    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
    • shipping_assignment 是一个 shipping_assignment 对象 (\Magento\Quote\Model\ShippingAssignment 类)
    • total 是一个总计对象(\Magento\Quote\Model\Quote\Address\Total 类)
  • \Magento\Quote\Model\QuoteManagement::placeOrder 方法中,checkout_submit_before 事件。参数

    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • \Magento\Quote\Model\QuoteManagement::placeOrder 方法中,checkout_submit_all_after 事件。参数

    • order 是一个订单对象 (\Magento\Sales\Model\Order 类)
    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • \Magento\Quote\Model\QuoteManagement::submitQuote 方法中,sales_model_service_quote_submit_before 事件。参数

    • order 是一个订单对象 (\Magento\Sales\Model\Order 类)
    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • \Magento\Quote\Model\QuoteManagement::submitQuote 方法中,sales_model_service_quote_submit_success 事件。参数

    • order 是一个订单对象 (\Magento\Sales\Model\Order 类)
    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
  • \Magento\Quote\Model\QuoteManagement::rollbackAddresses 方法中,sales_model_service_quote_submit_failure 事件。参数

    • order 是一个订单对象 (\Magento\Sales\Model\Order 类)
    • quote 是一个 quote 对象 (\Magento\Quote\Model\Quote 类)
    • exception 是一个异常对象(\Exception 类)
  • \Magento\Quote\Model\ResourceModel\Quote\Item\Collection::_assignProducts 方法中,prepare_catalog_product_collection_prices 事件。参数

    • collection 是一个产品集合对象(\Magento\Quote\Model\ResourceModel\Quote\Item\Collection 类)
    • store_id 是一个店铺 ID(int 类型)
  • \Magento\Quote\Model\QuoteManagement::_assignProducts 方法中,sales_quote_item_collection_products_after_load 事件。参数

    • collection 是一个产品集合对象(\Magento\Catalog\Model\ResourceModel\Product\Collection 类)

有关 Magento 2 中事件的信息,请参阅 事件和观察者

公共 API

数据

  • \Magento\Quote\Api\Data\AddressAdditionalDataInterface

    • 提供带有报价地址信息的附加数据
  • \Magento\Quote\Api\Data\AddressInterface

    • 报价地址数据
  • \Magento\Quote\Api\Data\CartInterface

    • 报价数据
  • \Magento\Quote\Api\Data\CartItemInterface

    • 报价项目数据
  • \Magento\Quote\Api\Data\CartSearchResultsInterfac

    • 报价搜索结果数据
  • \Magento\Quote\Api\Data\CurrencyInterface

    • 货币数据
  • \Magento\Quote\Api\Data\EstimateAddressInterface

    • 估计地址数据
  • \Magento\Quote\Api\Data\PaymentInterface

    • 支付数据
  • \Magento\Quote\Api\Data\PaymentMethodInterface

    • 支付方式数据
  • \Magento\Quote\Api\Data\ProductOptionInterface

    • 产品选项数据
  • \Magento\Quote\Api\Data\ShippingAssignmentInterface

    • 配送分配数据
  • \Magento\Quote\Api\Data\ShippingInterface

    • 配送数据
  • \Magento\Quote\Api\Data\ShippingMethodInterface

    • 配送方式数据
  • \Magento\Quote\Api\Data\TotalsAdditionalDataInterface

    • 为总计集合提供附加数据
  • \Magento\Quote\Api\Data\TotalSegmentInterface

    • 总计段数据
  • \Magento\Quote\Api\Data\TotalsInterfacee

    • 报价总计数据
  • \Magento\Quote\Api\Data\TotalsItemInterface

    • 报价项总计数据

通用

  • \Magento\Quote\Api\ChangeQuoteControlInterface
    • 检查用户是否有权更改报价

访客

  • \Magento\Quote\Api\GuestBillingAddressManagementInterface

    • 将指定的账单地址分配给指定的报价
    • 获取指定报价的账单地址
  • \Magento\Quote\Api\GuestCartItemRepositoryInterface

    • 获取分配给指定报价的列表项
    • 添加/更新指定的购物车访客项
    • 从指定的报价中删除指定的项
  • \Magento\Quote\Api\GuestCouponManagementInterface

    • 通过报价 ID 获取指定报价的优惠券
    • 通过代码向指定报价添加优惠券
    • 通过报价 ID 从指定报价中删除优惠券
  • \Magento\Quote\Api\GuestCartManagementInterface

    • 获取分配给指定报价的列表项
    • 添加/更新指定的报价项
    • 从指定的报价中删除指定的项
  • \Magento\Quote\Api\GuestPaymentMethodManagementInterface

    • 将指定的支付方法添加到指定的购物车报价中
    • 获取指定购物车报价的支付方法
    • 获取指定购物车报价的可用的支付方法列表
  • \Magento\Quote\Api\GuestShipmentEstimationInterface

    • 根据地址估计配送,并返回可用配送方式列表
  • \Magento\Quote\Api\GuestShippingMethodManagementInterface

    • 获取指定报价的适用运输方式列表
    • 估算运输费用
  • \Magento\Quote\Api\GuestCartRepositoryInterface

    • 获取针对访客用户的报价
  • \Magento\Quote\Api\GuestCartTotalManagementInterface

    • 为报价设置运输/账单方式以及额外数据,并为访客收集总额
  • \Magento\Quote\Api\GuestCartTotalRepositoryInterface

    • 获取访客用户的报价总额
  • \Magento\Quote\Model\GuestCart\GuestShippingAddressManagementInterface

    • 将指定运输地址分配给指定报价
    • 获取指定报价的运输地址
  • \Magento\Quote\Model\GuestCart\GuestShippingMethodManagementInterface

    • 为指定报价设置承运人和运输方式代码
    • 获取指定报价的所选运输方式

注册客户

  • \Magento\Quote\Api\BillingAddressManagementInterface

    • 将指定的账单地址分配给指定的报价
    • 获取指定报价的账单地址
  • \Magento\Quote\Api\CartItemRepositoryInterface

    • 获取分配给指定报价的列表项
    • 添加/更新指定的报价项
    • 从指定的报价中删除指定的项
  • \Magento\Quote\Api\CartManagementInterface

    • 为访客创建一个空的报价和购物车
    • 如果客户还没有报价,则为指定客户创建一个空的报价和购物车
    • 返回指定客户的报价信息
    • 将指定客户分配给指定购物报价
    • 为指定报价下单
  • \Magento\Quote\Api\CartRepositoryInterface

    • 通过报价ID获取报价
    • 获取符合指定搜索条件的购物车列表
    • 通过客户ID获取报价
    • 通过报价ID获取活动报价
    • 通过客户ID获取活动报价
    • 保存报价
    • 删除报价
  • \Magento\Quote\Api\CartTotalManagementInterface

    • 为报价设置运输/账单方式以及额外数据并收集总额
  • \Magento\Quote\Api\CartTotalRepositoryInterface

    • 通过报价ID获取报价总额
  • \Magento\Quote\Api\CouponManagementInterface

    • 通过报价 ID 获取指定报价的优惠券
    • 通过代码向指定报价添加优惠券
    • 通过报价 ID 从指定报价中删除优惠券
  • \Magento\Quote\Api\PaymentMethodManagementInterface

    • 将指定的支付方法添加到指定的购物车报价中
    • 获取指定购物车报价的支付方法
    • 获取指定购物车报价的可用的支付方法列表
  • \Magento\Quote\Api\ShipmentEstimationInterface

    • 根据地址估计配送,并返回可用配送方式列表
  • \Magento\Quote\Api\ShippingMethodManagementInterface

    • 根据报价ID和地址估算运输费用
    • 根据报价ID和地址ID估算运输费用
    • 获取指定报价的适用运输方式列表
  • \Magento\Quote\Model\ShippingAddressManagementInterface

    • 将指定运输地址分配给指定报价
    • 获取指定报价的运输地址
  • \Magento\Quote\Model\ShippingMethodManagementInterface

    • 为指定报价设置承运人和运输方式代码
    • 获取指定报价的所选运输方式

模型

  • \Magento\Quote\Model\Quote\Address\FreeShippingInterface

    • 检查是否为免费运输
  • \Magento\Quote\Model\Quote\Address\RateCollectorInterface

    • 根据提供的运输数据检索所有方法
  • \Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface

    • 将掩码报价ID转换为报价ID(实体ID)
  • \Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface

    • 将报价ID转换为掩码报价ID

有关 Magento 2 公共 API 的信息,请参阅 公共接口 & APIs