Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
67 views

Magento 2 SimiCart - Magento 2 Mobile App Builder

We are using Magento 2.4.2-p2 version with SimiCart - Magento 2 Mobile App Builder We are struggling from where category_id is coming File name - app/code/Simi/Simiconnector/Model/ResourceModel/...
sumeet bajaj's user avatar
  • 1,326
0 votes
3 answers
721 views

How can I remove a condition from a collection

I tried to use two methods to reset or clear the collection but it didn't work. I am working with the category collection on which I want to remove this part of the condition : (e.created_in <= '...
Alok Tiwari's user avatar
0 votes
2 answers
511 views

Convert SQL Select Query to Magento Collection

I have a complex sql select query which actually returns sales report against specified categories. I want to load data as a collection to display but I'm not able to convert the query into Magento's ...
jack's user avatar
  • 1
0 votes
1 answer
291 views

SQL Syntax error when getting collection on listing

I've created my own module for managing leaflets in home page and i wanted to have a listing with existing leaflets. I've created UI_Component for listing (by Magicento) but when I go to listing page ...
LeTeeL's user avatar
  • 42
0 votes
2 answers
596 views

Magento2 addFieldToFilter, Need 'and' and 'Or' in sql

I need magento sql collection. Query need like that. select * from custom_table where customer_id=xx or (customer_group=1 and custom_field=1) I can add or operator like below select * from ...
Nadim's user avatar
  • 91
1 vote
0 answers
880 views

Magento 2 - How to use mysql find_in_set?

In Magento 2, I try to use find_in_set mysql function but without success. I try this : $result->getSelect()->order("find_in_set(e.entity_id,'".implode(',',$sort_order)."')"); But it give me ...
Fbr's user avatar
  • 187
0 votes
2 answers
3k views

How to write inner join query in collection method (magento2)?

How to write this query in magento2 collection method? SELECT o.increment_id , h.status, h.created_at FROM sales_order AS o INNER JOIN sales_order_status_history AS h ON h.parent_id = o.entity_id ...
Hamza Mustafa's user avatar
3 votes
2 answers
2k views

how to get status of last order id in magento2 sql query?

i want to get last order id along with order status in magneto2, i use this query to extract it but the status is not extracting correct: SELECT max(entity_id) , STATUS FROM sales_order max ...
Hamza Mustafa's user avatar
3 votes
0 answers
120 views

Magento 2 : How to get top 10 repeated values in a column using CRUD instead of sql?

I want to get top 10 most repeated values in a column of my table, I can do so using sql but I need to do it using CRUD i.e using collections or model as magento coding standard doesn't allow naked ...
Vivek Kumar's user avatar
  • 5,740
1 vote
3 answers
4k views

Magento 2 - Add Custom Attribute to Product Collection without Flat Catalog EAV?

I have the below collection: $this->_collection->getSelect() ->order(new \Zend_Db_Expr('price_index.min_price / IF(e.unit_of_sale = NULL, 1, e.unit_of_sale) DESC')); This ...
harri's user avatar
  • 5,535
2 votes
1 answer
4k views

Need help with collection joinField() - Magento 2

Can anyone describe how to use joinField() method of collection (Magento\Eav\Model\Entity\Collection\AbstractCollection). I actually don't know what means each argument: public function joinField($...
Kyrylo Romantsov's user avatar
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
9 votes
2 answers
11k views

magento2 search_tmp join leads to empty results in category listing

I just imported products into fresh magento2 instance and encountered issue that category product listing block are empty, although the products successfully appear in database . I have debugged list....
Ilja's user avatar
  • 1,268