Get individual products from bundled product on a orderHow to Get Magento Bundle Product Qty From OrderAdding selection to Bundle Quote Item programmaticallyMagento individual discount for inner product of bundle productMake custom option price to be added to bundle product price in cartGet customer group from orderMagento 1 print order from backendGet Product ID from Customer OrderGet no order from product name or product descriptionBundled Items disappear from bundled productsGet product attributes from Order
"The cow" OR "a cow" OR "cows" in this context
As an international instructor, should I openly talk about my accent?
Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Which big number is bigger?
Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?
What does a straight horizontal line above a few notes, after a changed tempo mean?
A Paper Record is What I Hamper
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
Find the identical rows in a matrix
How exactly does Hawking radiation decrease the mass of black holes?
What is the best way to deal with NPC-NPC combat?
Negative Resistance
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
What is this word supposed to be?
Co-worker works way more than he should
Restricting the options of a lookup field, based on the value of another lookup field?
Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?
A Note on N!
Where was the County of Thurn und Taxis located?
How to not starve gigantic beasts
Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?
How to be good at coming up with counter example in Topology
Mistake in years of experience in resume?
Get individual products from bundled product on a order
How to Get Magento Bundle Product Qty From OrderAdding selection to Bundle Quote Item programmaticallyMagento individual discount for inner product of bundle productMake custom option price to be added to bundle product price in cartGet customer group from orderMagento 1 print order from backendGet Product ID from Customer OrderGet no order from product name or product descriptionBundled Items disappear from bundled productsGet product attributes from Order
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a bundle product and it has been ordered, so in the admin backend, the order looks like this:
How can I get to the individual skus & qtys on this bundle products?
For example, from this order, I would like to retrieve:
ACULSML x 1
ACPS x 1
ACFP x 1
So, I tried the following based on this answer:
$order_items = $order->getItemsCollection();
foreach ($order_items as $order_item)
$qtyOrdered = intval($order_item->getQtyOrdered());
$rowTotal = floatval($order_item->getRowTotal());
if ($order_item->getProductType() === 'bundle')
$store_id = $order->getStoreId();
$product = Mage::getModel('catalog/product')->setStoreId($store_id)->load($order_item->product_id);
$options = Mage::getModel('bundle/option')->getResourceCollection()
->setProductIdFilter($order_item->product_id)
->setPositionOrder();
$options->joinValues($store_id);
$selections = $product->getTypeInstance(true)
->getSelectionsCollection($product->getTypeInstance(true)
->getOptionsIds($product), $product);
foreach ($options->getItems() as $option)
$option_id = $option->getId();
foreach ($selections as $selection)
if ($option_id === $selection->getOptionId())
echo $selection->getSku() . " x ". $selection->getSelectionQty() ."rn";
else
// snipped
The above code doesn't seem to be working, because it is generating the following output:
ACULSML x 1.0000
ACFGSML x 1.0000
ACGLSML x 1.0000
ACLBSML x 1.0000
ACLSML x 1.0000
ACMGSML x 1.0000
ACDBSML x 1.0000
ACTGSML x 1.0000
ACCSML x 1.0000
ACDCSML x 1.0000
ACFP x 1.0000
ACPSL x 1.0000
Any idea what might be wrong? How do you get to the individual item on a bundle off an order line?
magento-1.9 orders backend bundle-product
add a comment |
I have a bundle product and it has been ordered, so in the admin backend, the order looks like this:
How can I get to the individual skus & qtys on this bundle products?
For example, from this order, I would like to retrieve:
ACULSML x 1
ACPS x 1
ACFP x 1
So, I tried the following based on this answer:
$order_items = $order->getItemsCollection();
foreach ($order_items as $order_item)
$qtyOrdered = intval($order_item->getQtyOrdered());
$rowTotal = floatval($order_item->getRowTotal());
if ($order_item->getProductType() === 'bundle')
$store_id = $order->getStoreId();
$product = Mage::getModel('catalog/product')->setStoreId($store_id)->load($order_item->product_id);
$options = Mage::getModel('bundle/option')->getResourceCollection()
->setProductIdFilter($order_item->product_id)
->setPositionOrder();
$options->joinValues($store_id);
$selections = $product->getTypeInstance(true)
->getSelectionsCollection($product->getTypeInstance(true)
->getOptionsIds($product), $product);
foreach ($options->getItems() as $option)
$option_id = $option->getId();
foreach ($selections as $selection)
if ($option_id === $selection->getOptionId())
echo $selection->getSku() . " x ". $selection->getSelectionQty() ."rn";
else
// snipped
The above code doesn't seem to be working, because it is generating the following output:
ACULSML x 1.0000
ACFGSML x 1.0000
ACGLSML x 1.0000
ACLBSML x 1.0000
ACLSML x 1.0000
ACMGSML x 1.0000
ACDBSML x 1.0000
ACTGSML x 1.0000
ACCSML x 1.0000
ACDCSML x 1.0000
ACFP x 1.0000
ACPSL x 1.0000
Any idea what might be wrong? How do you get to the individual item on a bundle off an order line?
magento-1.9 orders backend bundle-product
add a comment |
I have a bundle product and it has been ordered, so in the admin backend, the order looks like this:
How can I get to the individual skus & qtys on this bundle products?
For example, from this order, I would like to retrieve:
ACULSML x 1
ACPS x 1
ACFP x 1
So, I tried the following based on this answer:
$order_items = $order->getItemsCollection();
foreach ($order_items as $order_item)
$qtyOrdered = intval($order_item->getQtyOrdered());
$rowTotal = floatval($order_item->getRowTotal());
if ($order_item->getProductType() === 'bundle')
$store_id = $order->getStoreId();
$product = Mage::getModel('catalog/product')->setStoreId($store_id)->load($order_item->product_id);
$options = Mage::getModel('bundle/option')->getResourceCollection()
->setProductIdFilter($order_item->product_id)
->setPositionOrder();
$options->joinValues($store_id);
$selections = $product->getTypeInstance(true)
->getSelectionsCollection($product->getTypeInstance(true)
->getOptionsIds($product), $product);
foreach ($options->getItems() as $option)
$option_id = $option->getId();
foreach ($selections as $selection)
if ($option_id === $selection->getOptionId())
echo $selection->getSku() . " x ". $selection->getSelectionQty() ."rn";
else
// snipped
The above code doesn't seem to be working, because it is generating the following output:
ACULSML x 1.0000
ACFGSML x 1.0000
ACGLSML x 1.0000
ACLBSML x 1.0000
ACLSML x 1.0000
ACMGSML x 1.0000
ACDBSML x 1.0000
ACTGSML x 1.0000
ACCSML x 1.0000
ACDCSML x 1.0000
ACFP x 1.0000
ACPSL x 1.0000
Any idea what might be wrong? How do you get to the individual item on a bundle off an order line?
magento-1.9 orders backend bundle-product
I have a bundle product and it has been ordered, so in the admin backend, the order looks like this:
How can I get to the individual skus & qtys on this bundle products?
For example, from this order, I would like to retrieve:
ACULSML x 1
ACPS x 1
ACFP x 1
So, I tried the following based on this answer:
$order_items = $order->getItemsCollection();
foreach ($order_items as $order_item)
$qtyOrdered = intval($order_item->getQtyOrdered());
$rowTotal = floatval($order_item->getRowTotal());
if ($order_item->getProductType() === 'bundle')
$store_id = $order->getStoreId();
$product = Mage::getModel('catalog/product')->setStoreId($store_id)->load($order_item->product_id);
$options = Mage::getModel('bundle/option')->getResourceCollection()
->setProductIdFilter($order_item->product_id)
->setPositionOrder();
$options->joinValues($store_id);
$selections = $product->getTypeInstance(true)
->getSelectionsCollection($product->getTypeInstance(true)
->getOptionsIds($product), $product);
foreach ($options->getItems() as $option)
$option_id = $option->getId();
foreach ($selections as $selection)
if ($option_id === $selection->getOptionId())
echo $selection->getSku() . " x ". $selection->getSelectionQty() ."rn";
else
// snipped
The above code doesn't seem to be working, because it is generating the following output:
ACULSML x 1.0000
ACFGSML x 1.0000
ACGLSML x 1.0000
ACLBSML x 1.0000
ACLSML x 1.0000
ACMGSML x 1.0000
ACDBSML x 1.0000
ACTGSML x 1.0000
ACCSML x 1.0000
ACDCSML x 1.0000
ACFP x 1.0000
ACPSL x 1.0000
Any idea what might be wrong? How do you get to the individual item on a bundle off an order line?
magento-1.9 orders backend bundle-product
magento-1.9 orders backend bundle-product
edited Apr 7 '18 at 20:20
Sourav
1,133514
1,133514
asked Apr 14 '15 at 16:06
LatheesanLatheesan
6881932
6881932
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You already have the qty. To add the sku you want to change the code for the child items to echo the sku together with the name and qty.
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%2f63589%2fget-individual-products-from-bundled-product-on-a-order%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 already have the qty. To add the sku you want to change the code for the child items to echo the sku together with the name and qty.
add a comment |
You already have the qty. To add the sku you want to change the code for the child items to echo the sku together with the name and qty.
add a comment |
You already have the qty. To add the sku you want to change the code for the child items to echo the sku together with the name and qty.
You already have the qty. To add the sku you want to change the code for the child items to echo the sku together with the name and qty.
answered Jul 26 '15 at 16:21
Fabian BlechschmidtFabian Blechschmidt
33.5k764174
33.5k764174
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%2f63589%2fget-individual-products-from-bundled-product-on-a-order%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