FireGento_FastSimpleImport2 icon indicating copy to clipboard operation
FireGento_FastSimpleImport2 copied to clipboard

How to import Tier pricing with simple product import

Open amitphpdeveloper opened this issue 8 years ago • 2 comments

Hello Team,

I am not able to import tier price with simple product import.

Thanks Amit

amitphpdeveloper avatar Jul 28 '17 09:07 amitphpdeveloper

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

sylvainraye avatar Sep 19 '17 09:09 sylvainraye

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,
                    ];
                }
            }
        }

sylvainraye avatar Nov 22 '17 13:11 sylvainraye