11
votes
Accepted
Adding bundle items to cart creates recursive dependency error
Modify app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php as stated below – only difference is , true being added to in_array() – and see if the exception disappears:
public function ...
9
votes
Magento2 add new field in bundle item (in option selection)
Here is my solution:
app/code/MyVendor/MyModule/etc/adminhtml/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
7
votes
Why attributes of bundle items of a bundle product are also saved to the bundle product itself? (database-wise)
Update: how to stop the indexer from including child products
Extend and modify
Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract.
Look for the function _prepareRelationIndex().
Modify the SQL ...
6
votes
Accepted
Magento 2 Bundle product options images
Try this code:
First you need to override below file.
After that you can get bundle option images from below code.
app/design/frontend/Vendor/Theme_Name/Magento_Bundle/templates/catalog/product/...
5
votes
Accepted
Magento 2.4.3 Bundle Product getting issue on frontend Magento\Catalog\Model\ResourceModel\Product\Flat::getLinkField()
Vendor\Module\etc\di.xml
<preference for="Magento\Bundle\Model\Product\SingleChoiceProvider" type="Vendor\Module\Model\Product\SingleChoiceProvider" />
Vendor\Module\Model\...
4
votes
Accepted
Set different price for each additional quantity
To do this you can add tier prices for the product.
Go to the product page in the Magento admin area and navigate to the 'Price' tab. There you will have an attribute called 'Tier Price' where you ...
4
votes
Accepted
Magento cart - get the bundle parent and children product
answering self for future seekers:
$item->getParentItemId()
source: http://davehiren.blogspot.co.il/2014/02/magento-get-cart-items-how-to-get.html
4
votes
How to add bundle product to cart programmatically with custom price and quantity (of all products) in Magento 2?
Create a Controller
<?php
namespace Company\Module\Controller\Index;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ProductFactory;
use Magento\Framework\App\Action\Action;
use ...
4
votes
Bundle Product Price Not Updating On Product Page When Selecting Options
I think you are using a custom Magento theme or Custom Bundle product module, right?
If yes, you should debug on your browser to detect what the issue is. Steps to debug (Chrome):
Inspect element (...
3
votes
How to add bundle product to cart programmatically with custom price and quantity (of all products) in Magento 2?
This worked for me (Magento 2.2.6):
$product = $this->_productRepository->getById($id, false, null, true);
$this->_cart->addProduct($product, $data);
where $data is an array as shown ...
2
votes
Accepted
Magento 2 Log Bundle Product Data in List Page?
You can try something like as well you can use this to pass data in to log.
<?php
echo "<pre>";
print_r(json_encode($_product->getData()));
exit;
?&...
2
votes
Accepted
Magento2 - issue when importing bundle products
Effectively, it was a bug. It seems last working version was 2.1.12, and it should be fixed back in 2.3.*
The workaround posted here https://github.com/magento/magento2/issues/12330#issuecomment-...
1
vote
Magento 2.4.3 Bundle Product getting issue on frontend Magento\Catalog\Model\ResourceModel\Product\Flat::getLinkField()
Since 2.3 Magento recommends to disable Flat catalog, this would fix that problem
https://docs.magento.com/user-guide/catalog/catalog-flat.html
Use of a flat catalog is no longer recommended as a ...
1
vote
Getting Sku of bundle-product options in carts/mine/items
Alright, so first things first. We need to find where things are happening. I searched the vendor/magento folder for carts/mine/items and that came up with module-quote/etc/webapi.xml. Which shows ...
1
vote
How to extend Bundle product type in Magento 2
I hope you were both able to Figure out your issue, If not I believe the Following should be the fix.
<vendor>/<module>/etc/product_types.xml:
<config xmlns:xsi="http://www.w3.org/...
1
vote
How to add bundle product to cart programmatically with custom price and quantity (of all products) in Magento 2?
I'm a bit late to the party, but I was struggling with the same issue myself. There were a few bundle products with required attributes. In order to tackle this in my case, a seperate product ...
1
vote
Accepted
How to create an order programmatically with bundle items in Magento 2?
Eventually, I figured it out. I left the script, maybe it will help someone. This works for Magento 2.4.1:
public function myMethod()
{
.......
$product = $this->product->get('...
1
vote
Enable Dynamic price in bundle product
Sometimes the documentation could be more specific. Only when creating a new product can you determine if it is dynamic pricing or not. Once the product is created, it cannot be modified.
1
vote
How to get list of all selected items of bundle product on detail page magento 2
<ul>
<?php
$productId = 17; //any bundle product id
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Catalog\Model\Product')-&...
1
vote
How to get list of all selected items of bundle product on detail page magento 2
Pleas try below code.
$product_id = 'your bundle product id';
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$store_id = 1;
$options = $_objectManager->...
1
vote
Accepted
Magento2 adding bundle product to existing quote not working
You need to do code like this one.
$qty = 1;
$quote = $this->quoteFactory->create()->load($quote->getId());
$product = $this->productRepository->getById($product->getId());
$...
1
vote
How can I filter all bundle child products in magento 2?
You can't get child products and parent products i have tried all and finally use this custom query to get all products parent, child.
$connection= $this->_resources->getConnection();
...
1
vote
Accepted
How to get product_options for sales_order_item by API Rest?
You can check the quote_item_option table :
option_id, code, item_id, product_id, value
1
vote
Accepted
New product type based on bundle - price type not saving
Solved by set the price_type in the type model in "afterSave" Method
1
vote
Accepted
Bundle Product - Add to Cart is not working
Your add to cart button should look like this:
<button type="button" title="Add to Cart" class="button btn-cart" onclick="productAddToCartForm.submit(this)"> <span> <span><div ...
1
vote
Check if all bundle items are available
You can use the following code to check whether the required child items of a bundle product are salable.
$isSalable = true;
$bundleProductId = 447;
$bundleProduct = Mage::getModel('catalog/product')...
1
vote
Accepted
change quantity input to dropdown for user definable quantities in bundle items
The way to achieve this is to edit the following files:
/app/design/frontend/[YOUR_THEME]/[YOUR_CHILD]/template/bundle/catalog/product/view/type/bundle/option/radio.phtml
/app/design/frontend/[...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
bundle-product × 84magento2 × 34
magento-1.9 × 18
bundle × 18
bundled-product × 11
cart × 7
price × 5
addtocart × 5
custom-options × 4
magento2.4 × 4
magento2.3 × 3
magento-1.7 × 3
database × 3
orders × 3
rest-api × 3
quote × 3
quantity × 3
magento-2.1 × 2
product × 2
admin × 2
magento2.2 × 2
configurable-product × 2
api × 2
product-images × 2
ce-1.9.0.1 × 2