Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
453 views

does not extend \Magento\Framework\DataObject custom Model

Here's my code when I try to make the collection with my custom model I have this error In Collection.php line 612: Easysoft\Logistic\Model\Tracking does not extend \Magento\Framework\DataObject app/...
cedric's user avatar
  • 11
0 votes
2 answers
266 views

Magento 2: Redirect custom attribute option to cms page url in obsever

How to redirect if custom attribute option value != 5431 to cms page else redirect to module Controller (prescription/index). Till now both conditions redirecting to module Controller <?php ...
Arun Sharma's user avatar
  • 1,347
4 votes
1 answer
689 views

loop through 2 collections with in one phtml

I am working on a custom module that is pulling in 2 different collections. When I try to use a for-each to loop through either of the collections the page displays the collection correctly. However,...
Brian's user avatar
  • 51
0 votes
2 answers
816 views

Out of memory on collectionFactory->create()

I'm getting a strange error on code which previously worked and now dont. <?php namespace Itstod\LinkedProducts\Model; use Itstod\LinkedProducts\Api\LinkInterface; use Itstod\...
Robert Siik's user avatar
0 votes
0 answers
127 views

Magento 2: How to add Join query in a custom module

want to add join query in getPost function in a single view public function getPost() { if ($this->_post === null) { /** @var Post $post */ $post = $this->...
Nitesh Kumar  Singh's user avatar
2 votes
3 answers
4k views

Magento:2 How to Image upload in custom module

Image upload working fine in tmp folder, then store in DB. I want to after saving data image stored in the base folder pub/media/events var_dump($data); " ["events_url"]=> array(1) { [0]=> ...
Nitesh Kumar  Singh's user avatar
1 vote
2 answers
9k views

how to get block data on phtml template in magento 2

what is missing in my code block data not shown in phtml template block page namespace xxxx\Trails\Block; use \Magento\Framework\View\Element\Template; use \Magento\Framework\View\Element\...
Nitesh Kumar  Singh's user avatar
2 votes
4 answers
4k views

Magento 2, preference for Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection does not work

When filters + Ancor is enabled for category, sorting by product name doesn't work. I know the fix as I tested in Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection. So now I'm trying to ...
Zinat's user avatar
  • 2,079
1 vote
1 answer
2k views

Magento 2: How many options do I have to use with addFieldToFilter? [closed]

What out-of-the-box logical conditions can I use with the addFieldToFilter method? $this->addFieldToFilter(); Thanks
Rafael Corrêa Gomes's user avatar
0 votes
1 answer
2k views

Magento 2 get custom module data in theme phtml

I have created the custom module and inserted all the required fields detail in the database. Now, I want to list all rows in below file path: I have tried with the $objectManager, but direct call $...
mageDev0688's user avatar
0 votes
2 answers
8k views

Call to undefined method on custom collection Resource Model

I have been trying to figure this out for 2 days. I created a custom collection for my module structured as follows app/code/Morello/Customproducts/Model/CustomProducts.php namespace Morello\...
Tony Morello's user avatar
2 votes
2 answers
5k views

How to create empty collection in magento 2

Cannot find it anywhere. Basically, I try to pass empty collection to my view if query parameters are not sufficient without actually querying database. I mean for example if my custom search ...
Maciej Paprocki's user avatar
12 votes
3 answers
25k views

Magento2: Load Model Data By Another Field

I have below table named "messages". id | posts_id | message_description | created_at ----------------------------------------------------------------------------- 1 1 test1 ...
Jackson's user avatar
  • 9,969
0 votes
2 answers
1k views

Magento 2 Custom Module Delete Issue [SOLVED]

I'm using Magento 2 Version 2.1.0 {folder path}\magento2\app\code\Custom\Module\view\adminhtml\ui_component\custom_module_index.xml <massaction name="listing_massaction"> <argument name=...
Jackson's user avatar
  • 9,969
2 votes
2 answers
2k views

Parent/child relationship in custom module [duplicate]

I am adding a custom "category" model with children items in my module. To add children I need to fetch collection from this "mycategories" module. How do I get a collection of categories when adding ...
HungryDB's user avatar
  • 906
1 vote
4 answers
8k views

Magento 2: How to set visibility and status to product using collection?

I'm creating a cron to pass through all the products and set them visible and active. This is my execute of the cron who runs well: public function execute(){ /** * @var $item \Magento\...
ntzz's user avatar
  • 534
1 vote
2 answers
3k views

How can I get custom module collection on form page magento 2

I want to set categories in dropdown field of form of subcategory module in magento2 . How can I get category collection on subcategory form page and set values in dropdown field. I am trying to do ...
Arun Pal's user avatar
  • 523
2 votes
2 answers
2k views

How to implement custom collection properly in Magento2?

I am trying to inject a CollectionFactory object into a Plugin like this: /** * PopulateCustomerCards constructor. * @param CardCollectionFactory $cardCollectionFactory */ public function ...
awavi's user avatar
  • 989