Get Configurable Parent from simple product in quote when simple product has multiple parents Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Setting additional options for configurable product in Quote Item [Solved]How to show only one record in order grid for the same Order ID for parent configurable product and child simple product?Need to get Simple Products with Configurable Option from Configurable Productconfigurable product name changes to simple product name when attributes (color/size) are selectedChanges configurable product main image to associated simple product image when option selectedMagento configurable product from multiple productsMagento 2 - Configurable product - Get parent product ID from child product IDmagento-configurable-auto-pricing at backendGet product parent name from child productHow to get child simple Product Obj from configurable Sales Order Items
Can a Wizard take the Magic Initiate feat and select spells from the Wizard list?
How to mute a string and play another at the same time
Proving inequality for positive definite matrix
Lights are flickering on and off after accidentally bumping into light switch
Can I ask an author to send me his ebook?
Etymology of 見舞い
Who's this lady in the war room?
How to produce a PS1 prompt in bash or ksh93 similar to tcsh
How to create a command for the "strange m" symbol in latex?
Suing a Police Officer Instead of the Police Department
Can I take recommendation from someone I met at a conference?
Why do C and C++ allow the expression (int) + 4*5?
What were wait-states, and why was it only an issue for PCs?
Pointing to problems without suggesting solutions
What is the definining line between a helicopter and a drone a person can ride in?
Providing direct feedback to a product salesperson
Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?
Like totally amazing interchangeable sister outfit accessory swapping or whatever
When speaking, how do you change your mind mid-sentence?
Why does BitLocker not use RSA?
Knights and Knaves question
Assertions In A Mock Callout Test
What could prevent concentrated local exploration?
What is the evidence that custom checks in Northern Ireland are going to result in violence?
Get Configurable Parent from simple product in quote when simple product has multiple parents
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Setting additional options for configurable product in Quote Item [Solved]How to show only one record in order grid for the same Order ID for parent configurable product and child simple product?Need to get Simple Products with Configurable Option from Configurable Productconfigurable product name changes to simple product name when attributes (color/size) are selectedChanges configurable product main image to associated simple product image when option selectedMagento configurable product from multiple productsMagento 2 - Configurable product - Get parent product ID from child product IDmagento-configurable-auto-pricing at backendGet product parent name from child productHow to get child simple Product Obj from configurable Sales Order Items
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I have a client that has about 14 Configurable products that are basically the same thing (logo item). Then they have created a simple product for each base color(Blue, Pink, Black)[3 total simple products]. They have then taken the 3 simple products and assigned each of them to the 14 configurable products so that the logo from the configurable products gets the base color simple product selected.
In their setup the configurable products house the images for these products. However, since you can only purchase the simple product the image that is being select is ALWAYS coming over as the image from product 1 of 20 (lowest product_id), no matter which selection is chosen.
The code im going to be trying to update is in a custom block that is being used on the checkout_onepage_index reference.
My question is:
From the sales/quote_item Model, how can I determine exactly which parent the
child item was selected from?
or
From the checkout/cart Model, can something be achieved?
Things I have already seen but are not really helpful.
Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId())
result
Array
(
[0] => 45207
[1] => 45209
[2] => 45210
[3] => 45211
[4] => 45212
[5] => 45213
[6] => 45214
[7] => 45215
[8] => 45216
[9] => 45217
[10] => 45218
[11] => 45219
[12] => 45220
[13] => 45222
)
- This just returns an array of all parentIds for the child item. Which is great, but there is no indication of which Parent Product this simple product was selected from.
magento-1.9 configurable-product cart blocks quoteitem
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
So I have a client that has about 14 Configurable products that are basically the same thing (logo item). Then they have created a simple product for each base color(Blue, Pink, Black)[3 total simple products]. They have then taken the 3 simple products and assigned each of them to the 14 configurable products so that the logo from the configurable products gets the base color simple product selected.
In their setup the configurable products house the images for these products. However, since you can only purchase the simple product the image that is being select is ALWAYS coming over as the image from product 1 of 20 (lowest product_id), no matter which selection is chosen.
The code im going to be trying to update is in a custom block that is being used on the checkout_onepage_index reference.
My question is:
From the sales/quote_item Model, how can I determine exactly which parent the
child item was selected from?
or
From the checkout/cart Model, can something be achieved?
Things I have already seen but are not really helpful.
Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId())
result
Array
(
[0] => 45207
[1] => 45209
[2] => 45210
[3] => 45211
[4] => 45212
[5] => 45213
[6] => 45214
[7] => 45215
[8] => 45216
[9] => 45217
[10] => 45218
[11] => 45219
[12] => 45220
[13] => 45222
)
- This just returns an array of all parentIds for the child item. Which is great, but there is no indication of which Parent Product this simple product was selected from.
magento-1.9 configurable-product cart blocks quoteitem
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
So I have a client that has about 14 Configurable products that are basically the same thing (logo item). Then they have created a simple product for each base color(Blue, Pink, Black)[3 total simple products]. They have then taken the 3 simple products and assigned each of them to the 14 configurable products so that the logo from the configurable products gets the base color simple product selected.
In their setup the configurable products house the images for these products. However, since you can only purchase the simple product the image that is being select is ALWAYS coming over as the image from product 1 of 20 (lowest product_id), no matter which selection is chosen.
The code im going to be trying to update is in a custom block that is being used on the checkout_onepage_index reference.
My question is:
From the sales/quote_item Model, how can I determine exactly which parent the
child item was selected from?
or
From the checkout/cart Model, can something be achieved?
Things I have already seen but are not really helpful.
Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId())
result
Array
(
[0] => 45207
[1] => 45209
[2] => 45210
[3] => 45211
[4] => 45212
[5] => 45213
[6] => 45214
[7] => 45215
[8] => 45216
[9] => 45217
[10] => 45218
[11] => 45219
[12] => 45220
[13] => 45222
)
- This just returns an array of all parentIds for the child item. Which is great, but there is no indication of which Parent Product this simple product was selected from.
magento-1.9 configurable-product cart blocks quoteitem
So I have a client that has about 14 Configurable products that are basically the same thing (logo item). Then they have created a simple product for each base color(Blue, Pink, Black)[3 total simple products]. They have then taken the 3 simple products and assigned each of them to the 14 configurable products so that the logo from the configurable products gets the base color simple product selected.
In their setup the configurable products house the images for these products. However, since you can only purchase the simple product the image that is being select is ALWAYS coming over as the image from product 1 of 20 (lowest product_id), no matter which selection is chosen.
The code im going to be trying to update is in a custom block that is being used on the checkout_onepage_index reference.
My question is:
From the sales/quote_item Model, how can I determine exactly which parent the
child item was selected from?
or
From the checkout/cart Model, can something be achieved?
Things I have already seen but are not really helpful.
Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId())
result
Array
(
[0] => 45207
[1] => 45209
[2] => 45210
[3] => 45211
[4] => 45212
[5] => 45213
[6] => 45214
[7] => 45215
[8] => 45216
[9] => 45217
[10] => 45218
[11] => 45219
[12] => 45220
[13] => 45222
)
- This just returns an array of all parentIds for the child item. Which is great, but there is no indication of which Parent Product this simple product was selected from.
magento-1.9 configurable-product cart blocks quoteitem
magento-1.9 configurable-product cart blocks quoteitem
asked Jan 20 '17 at 17:29
OuchyOuchy
13
13
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You Can set parent id in info buy request when you add an item to cart. Which is saved in sales_flat_quote_item_options. Below is the code which you use to add additional info to your item:
$params = array(
'parent_id'=> (int)$parent_id
);
$request = new Varien_Object();
$request->setData($params);
$result = $quote->addProduct($product, $request);
To retrieve this information you can use the below code:
$options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
print_r($options['info_buyRequest']['parent_id']);
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%2f155760%2fget-configurable-parent-from-simple-product-in-quote-when-simple-product-has-mul%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
You Can set parent id in info buy request when you add an item to cart. Which is saved in sales_flat_quote_item_options. Below is the code which you use to add additional info to your item:
$params = array(
'parent_id'=> (int)$parent_id
);
$request = new Varien_Object();
$request->setData($params);
$result = $quote->addProduct($product, $request);
To retrieve this information you can use the below code:
$options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
print_r($options['info_buyRequest']['parent_id']);
add a comment |
You Can set parent id in info buy request when you add an item to cart. Which is saved in sales_flat_quote_item_options. Below is the code which you use to add additional info to your item:
$params = array(
'parent_id'=> (int)$parent_id
);
$request = new Varien_Object();
$request->setData($params);
$result = $quote->addProduct($product, $request);
To retrieve this information you can use the below code:
$options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
print_r($options['info_buyRequest']['parent_id']);
add a comment |
You Can set parent id in info buy request when you add an item to cart. Which is saved in sales_flat_quote_item_options. Below is the code which you use to add additional info to your item:
$params = array(
'parent_id'=> (int)$parent_id
);
$request = new Varien_Object();
$request->setData($params);
$result = $quote->addProduct($product, $request);
To retrieve this information you can use the below code:
$options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
print_r($options['info_buyRequest']['parent_id']);
You Can set parent id in info buy request when you add an item to cart. Which is saved in sales_flat_quote_item_options. Below is the code which you use to add additional info to your item:
$params = array(
'parent_id'=> (int)$parent_id
);
$request = new Varien_Object();
$request->setData($params);
$result = $quote->addProduct($product, $request);
To retrieve this information you can use the below code:
$options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct());
print_r($options['info_buyRequest']['parent_id']);
answered Apr 20 '18 at 21:01
EllisonEllison
11
11
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%2f155760%2fget-configurable-parent-from-simple-product-in-quote-when-simple-product-has-mul%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