Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import Tier pricing with simple product import #53

Open
amitphpdeveloper opened this issue Jul 28, 2017 · 2 comments
Open

How to import Tier pricing with simple product import #53

amitphpdeveloper opened this issue Jul 28, 2017 · 2 comments

Comments

@amitphpdeveloper
Copy link

Hello Team,

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

Thanks
Amit

@sylvainraye
Copy link
Member

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
Copy link
Member

sylvainraye commented Nov 22, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants