Hot answers tagged

1 vote

How to get ordered product count in magento 2.4

Try this <?php $orderItems = $_order->getAllItems(); $productItemcount = 0; $productItemcount = count($orderItems);
Ravindrasinh Zala's user avatar
1 vote
Accepted

Multiple sorting, get first count of sorting

You can fetch collection count by the following methods. $collection->getSize(); OR $collection->count(); You can fetch collection count while using pagination in the following way. $...
Jitendra Patel's user avatar
1 vote
Accepted

How to get the size of a collection without loading the full collection in Magento 2

You can use getSize() method for this. Usage: $collection->getSize(); getSize() method execute a count SQL query into the database and give you the count. You can read in detail by below article. ...
Amit Saini's user avatar
1 vote
Accepted

Change qty input to the counter of the number of products on mini-cart

rewrite file /vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html to app/design/frontend/Vendor/Module/Magento_Checkout/web/template/minicart/item/default.html and ...
Donnie Darko's user avatar
1 vote

Magento site loading stage cart item count shows '0' at few seconds

Minicart is dynamic and loaded via KnockoutJS ,I believe, which means the count will be updated once the DOM is loaded and JS is executed
Deggial's user avatar
  • 120
1 vote

Magento 2 - how to use count and group by clause in collection

Something like this namespace Xigen\Demo\Block\Index; /** * Index class */ class Index extends \Magento\Framework\View\Element\Template { /** * Constructor * * @param \Magento\...
Dominic Pixie's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible