Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Fields | |
const | TYPE_CODE = 'bundle' |
![]() | |
const | CALCULATE_CHILD = 0 |
const | CALCULATE_PARENT = 1 |
const | SHIPMENT_SEPARATELY = 1 |
const | SHIPMENT_TOGETHER = 0 |
const | PROCESS_MODE_FULL = 'full' |
const | PROCESS_MODE_LITE = 'lite' |
const | OPTION_PREFIX = 'option_' |
Protected Member Functions | |
_prepareProduct (\Magento\Framework\DataObject $buyRequest, $product, $processMode) | |
getQty ($selection, $qtys, $selectionOptionId) | |
getBeforeQty ($product, $selection) | |
checkIsAllRequiredOptions ($product, $isStrictProcessMode, $optionsCollection, $options) | |
checkSelectionsIsSale ($selections, $skipSaleableCheck, $optionsCollection, $options) | |
checkIsResult ($_result) | |
mergeSelectionsWithOptions ($options, $selections) | |
![]() | |
_isStrictProcessMode ($processMode) | |
_prepareOptions (\Magento\Framework\DataObject $buyRequest, $product, $processMode) | |
_removeNotApplicableAttributes ($product) | |
Bundle Type Model @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @api
__construct | ( | \Magento\Catalog\Model\Product\Option | $catalogProductOption, |
\Magento\Eav\Model\Config | $eavConfig, | ||
\Magento\Catalog\Model\Product\Type | $catalogProductType, | ||
\Magento\Framework\Event\ManagerInterface | $eventManager, | ||
\Magento\MediaStorage\Helper\File\Storage\Database | $fileStorageDb, | ||
\Magento\Framework\Filesystem | $filesystem, | ||
\Magento\Framework\Registry | $coreRegistry, | ||
\Psr\Log\LoggerInterface | $logger, | ||
ProductRepositoryInterface | $productRepository, | ||
\Magento\Catalog\Helper\Product | $catalogProduct, | ||
\Magento\Catalog\Helper\Data | $catalogData, | ||
\Magento\Bundle\Model\SelectionFactory | $bundleModelSelection, | ||
\Magento\Bundle\Model\ResourceModel\BundleFactory | $bundleFactory, | ||
\Magento\Bundle\Model\ResourceModel\Selection\CollectionFactory | $bundleCollection, | ||
\Magento\Catalog\Model\Config | $config, | ||
\Magento\Bundle\Model\ResourceModel\Selection | $bundleSelection, | ||
\Magento\Bundle\Model\OptionFactory | $bundleOption, | ||
\Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
PriceCurrencyInterface | $priceCurrency, | ||
\Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry, | ||
\Magento\CatalogInventory\Api\StockStateInterface | $stockState, | ||
Json | $serializer = null , |
||
MetadataPool | $metadataPool = null , |
||
SelectionCollectionFilterApplier | $selectionCollectionFilterApplier = null |
||
) |
\Magento\Catalog\Model\Product\Option | $catalogProductOption | |
\Magento\Eav\Model\Config | $eavConfig | |
\Magento\Catalog\Model\Product\Type | $catalogProductType | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
\Magento\MediaStorage\Helper\File\Storage\Database | $fileStorageDb | |
\Magento\Framework\Filesystem | $filesystem | |
\Magento\Framework\Registry | $coreRegistry | |
\Psr\Log\LoggerInterface | $logger | |
ProductRepositoryInterface | $productRepository | |
\Magento\Catalog\Helper\Product | $catalogProduct | |
\Magento\Catalog\Helper\Data | $catalogData | |
\Magento\Bundle\Model\SelectionFactory | $bundleModelSelection | |
\Magento\Bundle\Model\ResourceModel\BundleFactory | $bundleFactory | |
\Magento\Bundle\Model\ResourceModel\Selection\CollectionFactory | $bundleCollection | |
\Magento\Catalog\Model\Config | $config | |
\Magento\Bundle\Model\ResourceModel\Selection | $bundleSelection | |
\Magento\Bundle\Model\OptionFactory | $bundleOption | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
PriceCurrencyInterface | $priceCurrency | |
\Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry | |
\Magento\CatalogInventory\Api\StockStateInterface | $stockState | |
\Magento\Framework\Serialize\Serializer\Json | $serializer | |
MetadataPool | null | $metadataPool | |
SelectionCollectionFilterApplier | null | $selectionCollectionFilterApplier | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 191 of file Type.php.
|
protected |
Prepare product and its configuration to be added to some products list. Perform standard preparation process and then prepare of bundle selections options.
\Magento\Framework\DataObject | $buyRequest | |
\Magento\Catalog\Model\Product | $product | |
string | $processMode |
Definition at line 638 of file Type.php.
beforeSave | ( | $product | ) |
Before save type related data
\Magento\Catalog\Model\Product | $product |
unset product custom options for dynamic price
Definition at line 384 of file Type.php.
canConfigure | ( | $product | ) |
|
protected |
|
protected |
checkProductBuyState | ( | $product | ) |
Check if product can be bought
\Magento\Catalog\Model\Product | $product |
Definition at line 1081 of file Type.php.
|
protected |
deleteTypeSpecificData | ( | \Magento\Catalog\Model\Product | $product | ) |
|
protected |
getChildrenIds | ( | $parentId, | |
$required = true |
|||
) |
getForceChildItemQtyChanges | ( | $product | ) |
getOptions | ( | $product | ) |
getOptionsByIds | ( | $optionIds, | |
$product | |||
) |
getOptionsIds | ( | $product | ) |
getOrderOptions | ( | $product | ) |
Prepare additional options/information for order item which will be created from this product
\Magento\Catalog\Model\Product | $product |
Product Prices calculations save
Definition at line 929 of file Type.php.
getParentIdsByChild | ( | $childId | ) |
getProductsToPurchaseByReqGroups | ( | $product | ) |
|
protected |
getRelationInfo | ( | ) |
getSearchableData | ( | $product | ) |
getSku | ( | $product | ) |
getSpecifyOptionMessage | ( | ) |
getWeight | ( | $product | ) |
hasOptions | ( | $product | ) |
Return true if product has options
\Magento\Catalog\Model\Product | $product |
Definition at line 1024 of file Type.php.
isSalable | ( | $product | ) |
isVirtual | ( | $product | ) |
|
protected |
prepareQuoteItemQty | ( | $qty, | |
$product | |||
) |
processBuyRequest | ( | $product, | |
$buyRequest | |||
) |
Prepare selected options for bundle product
\Magento\Catalog\Model\Product | $product | |
\Magento\Framework\DataObject | $buyRequest |
Definition at line 1157 of file Type.php.
shakeSelections | ( | $firstItem, | |
$secondItem | |||
) |
updateQtyOption | ( | $options, | |
\Magento\Framework\DataObject | $option, | ||
$value, | |||
$product | |||
) |
Method is needed for specific actions to change given quote options values according current product type logic Example: the catalog inventory validation of decimal qty can change qty to int, so need to change quote item qty option value too.
array | $options | |
\Magento\Framework\DataObject | $option | |
mixed | $value | |
\Magento\Catalog\Model\Product | $product |
Definition at line 527 of file Type.php.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |