分类
Magento

magento2 update checkoutConfig totalsData

di.xml

    <type name="Magento\Quote\Model\Cart\CartTotalRepository">
        <plugin name="Amasty_Rules::cart_total_repository_get" type="Maijindou\Rules\Plugin\Cart\CartTotalRepository" />
    </type>

    /**
     * @param \Magento\Quote\Model\Cart\CartTotalRepository $subject
     * @param \Magento\Quote\Model\Cart\Totals $quoteTotals
     *
     * @return \Magento\Quote\Model\Cart\Totals
     */
    public function afterGet(\Magento\Quote\Model\Cart\CartTotalRepository $subject, $quoteTotals)
    {
        return $quoteTotals;
    }