FireGento_FastSimpleImport2
FireGento_FastSimpleImport2 copied to clipboard
How to import Tier pricing with simple product import
Hello Team,
I am not able to import tier price with simple product import.
Thanks Amit
Hi,
Tier price cannot be imported with simple product import entity code. You have to use an other entity type code called "advanced_pricing". I didn't tried yet but I'm also currently working on this topic. I will complete the information later here
I confirm, you need to set the entity code to \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing::ENTITY_ADVANCED_PRICING and then provide an array like that:
use \Magento\AdvancedPricingImportExport\Model\Import;
$newItems = [];
foreach ($items as $item) {
if (isset($item['tier_prices']) && count($item['tier_prices'])) {
foreach ($item['tier_prices'] as $tierPrice) {
$newItems[] = [
'sku' => $item['sku'],
AdvancedPricing::COL_TIER_PRICE_QTY => $tierPrice['tier_price_qty'],
AdvancedPricing::COL_TIER_PRICE => $tierPrice['tier_price'],
AdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => $tierPrice['tier_price_customer_group'],
AdvancedPricing::COL_TIER_PRICE_WEBSITE => $tierPrice['tier_price_website'],
AdvancedPricing::COL_TIER_PRICE_TYPE => AdvancedPricing::TIER_PRICE_TYPE_FIXED,
];
}
}
}