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;
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
add a comment |
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
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 overridefunction addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
andfunction _productLimitationPrice($joinLeft = false)
method. Please give this solution.
– Payal Patel
Jun 12 '18 at 10:53
add a comment |
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
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
magento2 overrides class magento2.1.5
asked Apr 11 '17 at 16:21
Amit Bera♦Amit 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 overridefunction addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
andfunction _productLimitationPrice($joinLeft = false)
method. Please give this solution.
– Payal Patel
Jun 12 '18 at 10:53
add a comment |
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 overridefunction addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
andfunction _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
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Oct 30 '18 at 13:46
VenkatVenkat
3352 silver badges12 bronze badges
3352 silver badges12 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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)
andfunction _productLimitationPrice($joinLeft = false)
method. Please give this solution.– Payal Patel
Jun 12 '18 at 10:53