Skip to content

Need modification for Bulk Import since Magento 2.4.1 #9

@0-Sony

Description

@0-Sony

Magento version : 2.4.1

Edition (EE, CE, OS, etc): CE, EE

Expected behavior: bulk import works

Actual behavior: can't bulk import accessory product link type

Steps to reproduce:

Just import a csv file using the out of the box bulk import feature

Preconditions

Magento 2.4.1
php 7.4

Hi Magepal,

Currently working on Magento 2.4.1, you would need to update your module in order to make it working with this new Magento version.
The current patch needed for the import that you provide don't work anymore since the codebase has changed in Magento Core.

I suggest that you need to make a plugin to this method \Magento\CatalogImportExport\Model\Import\Product\LinkProcessor::addNameToIds in order to add your accessory product type

if you take a look on this class : \Magento\CatalogImportExport\Model\Import\Product

you will see this from line 225 :

    /**
     * Links attribute name-to-link type ID.
     *
     * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types
     *
     * @var array
     */
    protected $_linkNameToId = [
        '_related_' => \Magento\Catalog\Model\Product\Link::LINK_TYPE_RELATED,
        '_crosssell_' => \Magento\Catalog\Model\Product\Link::LINK_TYPE_CROSSSELL,
        '_upsell_' => \Magento\Catalog\Model\Product\Link::LINK_TYPE_UPSELL,
    ];

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions