File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Catalog/Ui/DataProvider/Product Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 448
448
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
449
449
</field >
450
450
</group >
451
+ <group id =" grid" translate =" grid" type =" text" sortOrder =" 45" showInDefault =" 1" >
452
+ <label >Admin Grids</label >
453
+ <field id =" show_approximate_products_amount_grid" translate =" label"
454
+ type =" select" sortOrder =" 1" showInDefault =" 1" canRestore =" 1" >
455
+ <label >Show approximate products amount in a product grid</label >
456
+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
457
+ </field >
458
+ </group >
451
459
</section >
452
460
<section id =" web" translate =" label" type =" text" sortOrder =" 20" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
453
461
<label >Web</label >
Original file line number Diff line number Diff line change 31
31
<max_height >1200</max_height >
32
32
</upload_configuration >
33
33
</system >
34
+ <admin >
35
+ <grid >
36
+ <show_approximate_products_amount_grid >0</show_approximate_products_amount_grid >
37
+ </grid >
38
+ </admin >
34
39
<general >
35
40
<validator_data >
36
41
<input_types >
Original file line number Diff line number Diff line change @@ -33,11 +33,9 @@ protected function _productLimitationJoinPrice()
33
33
*/
34
34
public function getSize ()
35
35
{
36
- $ sql = $ this ->getSelectCountSql ();
37
- $ possibleCount = $ this ->analyzeCount ($ sql );
38
-
39
- if ($ possibleCount > 20000 ) {
40
- return $ possibleCount ;
36
+ if ((bool )$ this ->_scopeConfig ->getValue ('admin/grid/show_approximate_products_amount_grid ' )) {
37
+ $ sql = $ this ->getSelectCountSql ();
38
+ return $ this ->analyzeCount ($ sql );
41
39
}
42
40
43
41
return parent ::getSize ();
You can’t perform that action at this time.
0 commit comments