Giter VIP home page Giter VIP logo

Comments (4)

ktruehl avatar ktruehl commented on June 12, 2024 1

I'll try to get to it as soon as possible.

from import-category.

ktruehl avatar ktruehl commented on June 12, 2024

So. I have become a bit more familiar with the M2IF framework, and I have written my own workaround for this. The crucial point is to return the right store view codes for the current category.

I extended the EeBuchProcessor

class EeBunchSubject extends \TechDivision\Import\Category\Ee\Subjects\EeBunchSubject
{
    /**
     * returns the store view codes relevant to the category represented by the current row
     *
     * @return array
     * @throws \Exception
     */
    public function getRootCategoryStoreViewCodes()
    {
        $path = $this->getValue(\TechDivision\Import\Category\Utils\ColumnKeys::PATH);
        $rootCategoryPath = explode('/', $path)[0];
        $rootCategory = $this->getCategoryByPath($rootCategoryPath);

        $storeCodes = [];
        foreach ($this->rootCategories as $storeCode => $category)
        {
            if ($category['entity_id'] == $rootCategory['entity_id'])
                $storeCodes[] = $storeCode;
        }
        return $storeCodes;
    }
}

and then the CategoryUrlRewriteObserver:

class CategoryUrlRewriteObserver extends \TechDivision\Import\Category\Observers\CategoryUrlRewriteObserver
{

    /**
     * @inheritdoc
     *
     * makes sure only the relevant store view codes are returned
     *
     * @return array
     * @throws \Exception
     */
    protected function getStoreViewCodes()
    {
        $subject = $this->getSubject();
        /* @var \Lehner\PimCategoriesImport\Import\Subjects\EeBunchSubject $subject */
        return $subject->getRootCategoryStoreViewCodes();
    }
}

from import-category.

wagnert avatar wagnert commented on June 12, 2024

Hi, it would be really nice if you would create a PR with your workaround/bugfix ... is that possible?

from import-category.

ktruehl avatar ktruehl commented on June 12, 2024

Voilà the pull request. I didn't test it outside the context of our client's setup. Just copied over the code.

from import-category.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.