New answers tagged

0

I have exactly the same issue on Magento 2.3, It works in developer mode, not in production. I deleted the generated/code/Vendor/Module directory Doesnt change much


0

In My Case StoreManagerInterface is not Injecting in Custom\Module\Model\ResourceModel\Module\Collection Class and i was passing to StoreManagerInterface to Constructor of Grid COllection which is causing problem when I removed it started working Fine


1

Magento strictly follows and recommends design patterns Collection Repository This implementation use to manipulate entity objects but not able to create new one. $repo = $this->myRepository(); $object = $repo->getById($myId); $object->setData('something', 'somethingDifferent'); $repo->save($object); Collection Factory This implementation use ...


0

Works for me $searchCriteria = $this->searchCriteriaBuilder ->addFilter('is_reward_process', $isrewardprocess) ->addSortOrder($this->sortBuilder->setField('entity_id') ->setAscendingDirection()->create()) ->setPageSize(50)->setCurrentPage(1)->create(); $ordersList = $...


1

here's a shorter version to build the time filter: // get current time - 1 hour $time = date( "Y-m-d H:i:s", (time() - 3600) ); // then use it as a filter (...) ->addFieldToFilter( 'created_at', [ 'gteq' => $time ] ); as for the status filtering, it should be something like this: ->addFieldToFilter( 'status', ...


0

For one thing, to be sure you are passing the right args into the function in your file, dont directly enter classnames as strings. Do this, as it is best practice. Also, the visibility on _construct should be protected. You have public. <?php namespace Vendor\Module\Model\ResourceModel\AddressGroups; class Collection extends \Magento\Framework\Model\...


0

You need to do an inner join instead of a left join on catelog_category_product table. Picking Method #3 just because, but you should be able to adapt this to whichever one you want. $_productCollection->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')->addAttributeToFilter('category_id', array('in' =&...


Top 50 recent answers are included