문제

I want to change cart sequence on cart page Price ascending wise. Please share a page link item collection for cart page.

도움이 되었습니까?

해결책

You can use plugin for this

di.xml

<type name="Magento\Quote\Model\Quote">
    <plugin name="append_order_by" type="Vendor\Module\Plugin\Quote" sortOrder="10" />
</type>

Vendor\Module\Plugin\Quote.php

<?php
namespace Vendor\Module\Plugin;

class Quote
{

    public function afterGetItemsCollection($subject, $collection)
    {
        $select = $collection->getSelect();
        $select->order('price ASC');
        //$select->order('row_total ASC'); // If you want to set as per row total
        return $collection;
    }

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top