Magento2 rewrite: product resource collection class does not effect on functionsRewrite core classes or override?Trying to rewrite Catalog Product CollectionMagento 2 - Custom Product Collection not Getting Filtered by Layered NavigationMagento 2: How to Override Abstract Class for Product Category Indexing Issue?Magento2 plugin does not working on class MagentoOfflineShippingModelCarrierFreeshippingrewrite ` MagentoCatalogModelResourceModelProductCollection` showing error `Select' not found`Magento 2 product model override not working correctlyMagento2 Override Resource Model does not WorkMagento 2 override the product collection(MagentoCatalogModelResourceModelProductCollection.php)How to override already override class in magento 2

As a supervisor, what feedback would you expect from a PhD who quits?

Does anyone have a method of differentiating informative comments from commented out code?

How do resistors generate different heat if we make the current fixed and changed the voltage and resistance? Notice the flow of charge is constant

What was the nature of the known bugs in the Space Shuttle software?

Intern not wearing safety equipment; how could I have handled this differently?

Why do Martians have to wear space helmets?

How did the IEC decide to create kibibytes?

What do you call a situation where you have choices but no good choice?

Sorting a list according to some pre-specified rules

How to have a filled pattern

What is the highest level of accuracy in motion control a Victorian society could achieve?

How can I review my manager, who is fine?

How to evaluate the performance of open source solver?

What was the significance of Spider-Man: Far From Home being an MCU Phase 3 film instead of a Phase 4 film?

What is the shape of the upper boundary of water hitting a screen?

How do I talk to my wife about unrealistic expectations?

What's the difference between a type and a kind?

What does the multimeter dial do internally?

Was the 45.9°C temperature in France in June 2019 the highest ever recorded in France?

Uniform initialization by tuple

Can one block with a protection from color creature?

Was it ever illegal to name a pig "Napoleon" in France?

Is conquering your neighbors to fight a greater enemy a valid strategy?

Is it ok for parents to kiss and romance with each other while their 2- to 8-year-old child watches?



Magento2 rewrite: product resource collection class does not effect on functions


Rewrite core classes or override?Trying to rewrite Catalog Product CollectionMagento 2 - Custom Product Collection not Getting Filtered by Layered NavigationMagento 2: How to Override Abstract Class for Product Category Indexing Issue?Magento2 plugin does not working on class MagentoOfflineShippingModelCarrierFreeshippingrewrite ` MagentoCatalogModelResourceModelProductCollection` showing error `Select' not found`Magento 2 product model override not working correctlyMagento2 Override Resource Model does not WorkMagento 2 override the product collection(MagentoCatalogModelResourceModelProductCollection.php)How to override already override class in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have rewrite catalog product resource collection MagentoCatalogModelResourceModelProductCollection.



Class override successfully but functions override is not working.



Suppose, i want overrider setOrder()function. But it does not works . Always calling Core function instead of rewrite class function



Class



<?php
namespace AmitBeraCoreRewriteModelRewriteCatalogResourceModelProduct;

class Collection extends MagentoCatalogModelResourceModelProductCollection


protected $appState;
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoCatalogModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkModuleManager $moduleManager,
MagentoCatalogModelIndexerProductFlatState $catalogProductFlatState,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoCatalogModelProductOptionFactory $productOptionFactory,
MagentoCatalogModelResourceModelUrl $catalogUrl,
MagentoFrameworkStdlibDateTimeTimezoneInterface $localeDate,
MagentoCustomerModelSession $customerSession,
MagentoFrameworkStdlibDateTime $dateTime,
MagentoFrameworkAppState $appState,
MagentoCustomerApiGroupManagementInterface $groupManagement,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
)
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$storeManager,
$moduleManager,
$catalogProductFlatState,
$scopeConfig,
$productOptionFactory,
$catalogUrl,
$localeDate,
$customerSession,
$dateTime,
$groupManagement,
$connection
);
$this->_appState = $appState;


public function setOrder($attribute, $dir = MagentoFrameworkDBSelect::SQL_DESC)

echo __METHOD__;
exit;
if ($attribute == 'price')
$this->addAttributeToSort($attribute, $dir);
else
parent::setOrder($attribute, $dir);

return $this;






module.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="AmitBera_CoreRewrite" setup_version="2.0.0">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_CatalogSearch"/>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Vault"/>
<module name="Magento_OfflineShipping"/>
</sequence>
</module>
</config>


di.xml



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelResourceModelProductCollection"
type="AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollection" />
</config>


Whenever use



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
/** @var MagentoCatalogModelResourceModelProductCollection $productCollection */
$productCollection = $objectManager->create('MagentoCatalogModelResourceModelProductCollection');
echo get_class($productCollection );


result:




AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor




Question:



  • i donot understand why i am not able to override function
    setorder()

  • Why echo get_class($productCollection ); give Interceptor class


AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor











share|improve this question






















  • I am facing the same issue when I try to override addPriceData() method

    – Maniprakash Chinnasamy
    Feb 16 '18 at 13:31











  • I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

    – Payal Patel
    Jun 12 '18 at 10:53


















3















I have rewrite catalog product resource collection MagentoCatalogModelResourceModelProductCollection.



Class override successfully but functions override is not working.



Suppose, i want overrider setOrder()function. But it does not works . Always calling Core function instead of rewrite class function



Class



<?php
namespace AmitBeraCoreRewriteModelRewriteCatalogResourceModelProduct;

class Collection extends MagentoCatalogModelResourceModelProductCollection


protected $appState;
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoCatalogModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkModuleManager $moduleManager,
MagentoCatalogModelIndexerProductFlatState $catalogProductFlatState,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoCatalogModelProductOptionFactory $productOptionFactory,
MagentoCatalogModelResourceModelUrl $catalogUrl,
MagentoFrameworkStdlibDateTimeTimezoneInterface $localeDate,
MagentoCustomerModelSession $customerSession,
MagentoFrameworkStdlibDateTime $dateTime,
MagentoFrameworkAppState $appState,
MagentoCustomerApiGroupManagementInterface $groupManagement,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
)
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$storeManager,
$moduleManager,
$catalogProductFlatState,
$scopeConfig,
$productOptionFactory,
$catalogUrl,
$localeDate,
$customerSession,
$dateTime,
$groupManagement,
$connection
);
$this->_appState = $appState;


public function setOrder($attribute, $dir = MagentoFrameworkDBSelect::SQL_DESC)

echo __METHOD__;
exit;
if ($attribute == 'price')
$this->addAttributeToSort($attribute, $dir);
else
parent::setOrder($attribute, $dir);

return $this;






module.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="AmitBera_CoreRewrite" setup_version="2.0.0">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_CatalogSearch"/>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Vault"/>
<module name="Magento_OfflineShipping"/>
</sequence>
</module>
</config>


di.xml



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelResourceModelProductCollection"
type="AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollection" />
</config>


Whenever use



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
/** @var MagentoCatalogModelResourceModelProductCollection $productCollection */
$productCollection = $objectManager->create('MagentoCatalogModelResourceModelProductCollection');
echo get_class($productCollection );


result:




AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor




Question:



  • i donot understand why i am not able to override function
    setorder()

  • Why echo get_class($productCollection ); give Interceptor class


AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor











share|improve this question






















  • I am facing the same issue when I try to override addPriceData() method

    – Maniprakash Chinnasamy
    Feb 16 '18 at 13:31











  • I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

    – Payal Patel
    Jun 12 '18 at 10:53














3












3








3








I have rewrite catalog product resource collection MagentoCatalogModelResourceModelProductCollection.



Class override successfully but functions override is not working.



Suppose, i want overrider setOrder()function. But it does not works . Always calling Core function instead of rewrite class function



Class



<?php
namespace AmitBeraCoreRewriteModelRewriteCatalogResourceModelProduct;

class Collection extends MagentoCatalogModelResourceModelProductCollection


protected $appState;
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoCatalogModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkModuleManager $moduleManager,
MagentoCatalogModelIndexerProductFlatState $catalogProductFlatState,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoCatalogModelProductOptionFactory $productOptionFactory,
MagentoCatalogModelResourceModelUrl $catalogUrl,
MagentoFrameworkStdlibDateTimeTimezoneInterface $localeDate,
MagentoCustomerModelSession $customerSession,
MagentoFrameworkStdlibDateTime $dateTime,
MagentoFrameworkAppState $appState,
MagentoCustomerApiGroupManagementInterface $groupManagement,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
)
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$storeManager,
$moduleManager,
$catalogProductFlatState,
$scopeConfig,
$productOptionFactory,
$catalogUrl,
$localeDate,
$customerSession,
$dateTime,
$groupManagement,
$connection
);
$this->_appState = $appState;


public function setOrder($attribute, $dir = MagentoFrameworkDBSelect::SQL_DESC)

echo __METHOD__;
exit;
if ($attribute == 'price')
$this->addAttributeToSort($attribute, $dir);
else
parent::setOrder($attribute, $dir);

return $this;






module.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="AmitBera_CoreRewrite" setup_version="2.0.0">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_CatalogSearch"/>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Vault"/>
<module name="Magento_OfflineShipping"/>
</sequence>
</module>
</config>


di.xml



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelResourceModelProductCollection"
type="AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollection" />
</config>


Whenever use



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
/** @var MagentoCatalogModelResourceModelProductCollection $productCollection */
$productCollection = $objectManager->create('MagentoCatalogModelResourceModelProductCollection');
echo get_class($productCollection );


result:




AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor




Question:



  • i donot understand why i am not able to override function
    setorder()

  • Why echo get_class($productCollection ); give Interceptor class


AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor











share|improve this question














I have rewrite catalog product resource collection MagentoCatalogModelResourceModelProductCollection.



Class override successfully but functions override is not working.



Suppose, i want overrider setOrder()function. But it does not works . Always calling Core function instead of rewrite class function



Class



<?php
namespace AmitBeraCoreRewriteModelRewriteCatalogResourceModelProduct;

class Collection extends MagentoCatalogModelResourceModelProductCollection


protected $appState;
public function __construct(
MagentoFrameworkDataCollectionEntityFactory $entityFactory,
PsrLogLoggerInterface $logger,
MagentoFrameworkDataCollectionDbFetchStrategyInterface $fetchStrategy,
MagentoFrameworkEventManagerInterface $eventManager,
MagentoEavModelConfig $eavConfig,
MagentoFrameworkAppResourceConnection $resource,
MagentoEavModelEntityFactory $eavEntityFactory,
MagentoCatalogModelResourceModelHelper $resourceHelper,
MagentoFrameworkValidatorUniversalFactory $universalFactory,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkModuleManager $moduleManager,
MagentoCatalogModelIndexerProductFlatState $catalogProductFlatState,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoCatalogModelProductOptionFactory $productOptionFactory,
MagentoCatalogModelResourceModelUrl $catalogUrl,
MagentoFrameworkStdlibDateTimeTimezoneInterface $localeDate,
MagentoCustomerModelSession $customerSession,
MagentoFrameworkStdlibDateTime $dateTime,
MagentoFrameworkAppState $appState,
MagentoCustomerApiGroupManagementInterface $groupManagement,
MagentoFrameworkDBAdapterAdapterInterface $connection = null
)
parent::__construct(
$entityFactory,
$logger,
$fetchStrategy,
$eventManager,
$eavConfig,
$resource,
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$storeManager,
$moduleManager,
$catalogProductFlatState,
$scopeConfig,
$productOptionFactory,
$catalogUrl,
$localeDate,
$customerSession,
$dateTime,
$groupManagement,
$connection
);
$this->_appState = $appState;


public function setOrder($attribute, $dir = MagentoFrameworkDBSelect::SQL_DESC)

echo __METHOD__;
exit;
if ($attribute == 'price')
$this->addAttributeToSort($attribute, $dir);
else
parent::setOrder($attribute, $dir);

return $this;






module.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNameSpaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="AmitBera_CoreRewrite" setup_version="2.0.0">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_CatalogSearch"/>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Vault"/>
<module name="Magento_OfflineShipping"/>
</sequence>
</module>
</config>


di.xml



<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelResourceModelProductCollection"
type="AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollection" />
</config>


Whenever use



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
/** @var MagentoCatalogModelResourceModelProductCollection $productCollection */
$productCollection = $objectManager->create('MagentoCatalogModelResourceModelProductCollection');
echo get_class($productCollection );


result:




AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor




Question:



  • i donot understand why i am not able to override function
    setorder()

  • Why echo get_class($productCollection ); give Interceptor class


AmitBeraCoreRewriteModelRewriteCatalogResourceModelProductCollectionInterceptor








magento2 overrides class magento2.1.5






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 11 '17 at 16:21









Amit BeraAmit Bera

61.7k16 gold badges84 silver badges183 bronze badges




61.7k16 gold badges84 silver badges183 bronze badges












  • I am facing the same issue when I try to override addPriceData() method

    – Maniprakash Chinnasamy
    Feb 16 '18 at 13:31











  • I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

    – Payal Patel
    Jun 12 '18 at 10:53


















  • I am facing the same issue when I try to override addPriceData() method

    – Maniprakash Chinnasamy
    Feb 16 '18 at 13:31











  • I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

    – Payal Patel
    Jun 12 '18 at 10:53

















I am facing the same issue when I try to override addPriceData() method

– Maniprakash Chinnasamy
Feb 16 '18 at 13:31





I am facing the same issue when I try to override addPriceData() method

– Maniprakash Chinnasamy
Feb 16 '18 at 13:31













I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

– Payal Patel
Jun 12 '18 at 10:53






I am facing same issue when i try to override function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) and function _productLimitationPrice($joinLeft = false) method. Please give this solution.

– Payal Patel
Jun 12 '18 at 10:53











1 Answer
1






active

oldest

votes


















0














If you overwriting
MagentoCatalogModelResourceModelProductCollection, just traverse this folder location, you will find the file and folder with same name i.e Collection. So its points to folder location collection.



If you want to do some function with sorting overwrite MagentoCatalogModelResourceModelProductCollectionProductLimitation or using plugin concept to set $productLimitationFilters






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f169695%2fmagento2-rewrite-product-resource-collection-class-does-not-effect-on-functions%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you overwriting
    MagentoCatalogModelResourceModelProductCollection, just traverse this folder location, you will find the file and folder with same name i.e Collection. So its points to folder location collection.



    If you want to do some function with sorting overwrite MagentoCatalogModelResourceModelProductCollectionProductLimitation or using plugin concept to set $productLimitationFilters






    share|improve this answer



























      0














      If you overwriting
      MagentoCatalogModelResourceModelProductCollection, just traverse this folder location, you will find the file and folder with same name i.e Collection. So its points to folder location collection.



      If you want to do some function with sorting overwrite MagentoCatalogModelResourceModelProductCollectionProductLimitation or using plugin concept to set $productLimitationFilters






      share|improve this answer

























        0












        0








        0







        If you overwriting
        MagentoCatalogModelResourceModelProductCollection, just traverse this folder location, you will find the file and folder with same name i.e Collection. So its points to folder location collection.



        If you want to do some function with sorting overwrite MagentoCatalogModelResourceModelProductCollectionProductLimitation or using plugin concept to set $productLimitationFilters






        share|improve this answer













        If you overwriting
        MagentoCatalogModelResourceModelProductCollection, just traverse this folder location, you will find the file and folder with same name i.e Collection. So its points to folder location collection.



        If you want to do some function with sorting overwrite MagentoCatalogModelResourceModelProductCollectionProductLimitation or using plugin concept to set $productLimitationFilters







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 30 '18 at 13:46









        VenkatVenkat

        3352 silver badges12 bronze badges




        3352 silver badges12 bronze badges



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f169695%2fmagento2-rewrite-product-resource-collection-class-does-not-effect-on-functions%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form