Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 1 - How to get type of a Magento quote item?

Grouped products are grouping simple products, everyone knows. In somewhere of my custom module, I need to know if there's a simple product in my cart (quote) "added by grouped product" or by "itself"?

I know there's a table sales_flat_quote_item_option. Item records doesn't differ in sales_flat_quote_item but in that option table there's some difference. When you add your simple product with "grouped product add action", it creates a row including info_buyRequest in sales_flat_quote_item_option table.

I want to determine that record programatically.

Thanks for any help/directive.

like image 993
muhammedv Avatar asked Feb 16 '23 14:02

muhammedv


1 Answers

I found a solution. Its enough simple to embarrass me;

$_item->getProductType()

returns "grouped" when that simple item came with a grouped product's add action. Altough, there's a logical mistake, because that product's type is actually "simple" not "grouped".

like image 95
muhammedv Avatar answered Feb 26 '23 15:02

muhammedv