odiseoteam / SyliusVendorPlugin

This is a Sylius Plugin that add vendors (brands) to your store. The vendors is an entity that sells products and are fully customizable by the admin.
https://odiseo.io
MIT License
58 stars 21 forks source link

Can't extend plugin #12

Closed alekseyp closed 4 years ago

alekseyp commented 4 years ago

After upgrading to v1.2.4 plugin version and Sylius 1.6.4 I can't extend the plugin.

# config/packages/sylius/resource.yml
sylius_resource:
    resources:
        odiseo_sylius_vendor_plugin.vendor:
            classes:
                model: App\Entity\Vendor
                repository: App\Repository\VendorRepository

but debugger shows that it not overwritten

/srv/sylius # php bin/console debug:container --parameter=odiseo_sylius_vendor_plugin.model.vendor.class
 ------------------------------------------------ -----------------------------------------
  Parameter                                        Value
 ------------------------------------------------ -----------------------------------------
  odiseo_sylius_vendor_plugin.model.vendor.class   Odiseo\SyliusVendorPlugin\Entity\Vendor
 ------------------------------------------------ -----------------------------------------

/srv/sylius # php bin/console debug:container --parameter=odiseo_sylius_vendor_plugin.repository.vendor.class
 ----------------------------------------------------- -------------------------------------------------------
  Parameter                                             Value
 ----------------------------------------------------- -------------------------------------------------------
  odiseo_sylius_vendor_plugin.repository.vendor.class   Odiseo\SyliusVendorPlugin\Repository\VendorRepository
# App\Entity\Vendor

<?php

declare(strict_types=1);

namespace App\Entity;

use Odiseo\SyliusVendorPlugin\Entity\Vendor as BaseVendor;
use Odiseo\SyliusVendorPlugin\Entity\VendorInterface;
use Odiseo\SyliusVendorPlugin\Entity\VendorTranslation;
use Odiseo\SyliusVendorPlugin\Entity\VendorTranslationInterface;

class Vendor extends BaseVendor implements VendorInterface
{
}

Let me know if any other info will help.

songecko commented 4 years ago

Hi @alekseyp, the problem was the order that the configurations is imported. To make it work you need to import our plugin configuration on config/packages/_sylius.yaml instead on config/services.yaml. We'll update the README soon. Sorry about that.