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
59 stars 21 forks source link

You have requested a non-existent parameter "odiseo_sylius_vendor.model.vendor.class". #1

Closed aimeric closed 6 years ago

aimeric commented 6 years ago

Hi,

I just tried to add your bundle to sylius but I'm getting this error:

You have requested a non-existent parameter "odiseo_sylius_vendor.model.vendor.class".

AppKernel.php

new Odiseo\SyliusVendorPlugin\OdiseoSyliusVendorPlugin(),

routing.yml

odiseo_sylius_admin_vendor:
   resource: "@OdiseoSyliusVendorPlugin/Resources/config/routing/admin_vendor.yml"

odiseo_sylius_shop_vendor:
    resource: "@OdiseoSyliusVendorPlugin/Resources/config/routing/shop_vendor.yml"
    prefix: /vendors

config.yml

    - { resource: "@OdiseoSyliusVendorPlugin/Resources/config/app/config.yml" }
    - { resource: "@OdiseoSyliusVendorPlugin/Resources/config/grids/vendor.yml" }

composer.json "odiseoteam/sylius-vendor-plugin": "dev-master"

Do you have any idea how to fix this issue ? Thank you

odiseoteam commented 6 years ago

Hi @aimeric, first of all, thanks for use our plugin. To solve the issue, you need add the Bundle/Plugin on the Kernel before of the SyliusResourceBundle. To do that you need to replace the registerBundles method like this:

public function registerBundles(): array
{
    $preResourceBundles = [
        new \Odiseo\SyliusVendorPlugin\OdiseoSyliusVendorPlugin(),
    ];

    $bundles = [
        ...
    ];

    return array_merge($preResourceBundles, parent::registerBundles(), $bundles);
}

Sorry for not explain this on the Readme, i will do now. Also, I recommend you to use the last stable version of the plugin and not the dev-master version.

Let me know if you can fix this issue.

Regards.

aimeric commented 6 years ago

Hi @odiseoteam, Thanks for developing a multi vendor bundle for Sylius. I have been able to fix the error , by editing my Appkernel.php as you explained. After accessing to the vendors page , when I'm trying to create a new vendor I'm getting this error:

Expected argument of type "Odiseo\SyliusVendorPlugin\Model\ChannelInterface", "Sylius\Component\Core\Model\Channel" given

I have also downgrade to stable version.

odiseoteam commented 6 years ago

Hi @aimeric, i tried to reproduce your error but i couldn't. Please, try again following the Readme step by step after install a new sylius project. We updated the Readme today and also we published a new version of the plugin.

Please, let me know if you could solve the issue and thanks for the feedback.

aimeric commented 6 years ago

Hi @odiseoteam , It work nicely with a new sylius project. I can add a new vendor without any error. But with my current sylius project it doesn't work.

If I tried to create a vendor I keep having this error:

Expected argument of type "Odiseo\SyliusVendorPlugin\Model\ChannelInterface", "Sylius\Component\Core\Model\Channel" given

If I tried to create a new product I have this error:

Neither the property "vendor" nor one of the methods "getVendor()", "vendor()", "isVendor()", "hasVendor()", "__get()" exist and have public access in class "Sylius\Component\Core\Model\Product".

It would be nice if I can use your plugin in my current website.

I have few suggestions for you:

What do you think about my suggestions?

Thanks

odiseoteam commented 6 years ago

Hi @aimeric. I think your error is because the "@OdiseoSyliusVendorPlugin/Resources/config/app/config.yml" file was not loaded. The Sylius model classes for Channel and Product need to be overrride by the plugin. Can you share me the project that you are working?

About your suggestions i think are great features. Can you add them like to another github task?

Thanks!

aimeric commented 6 years ago

Hi @odiseoteam ,

I have added a github task lists with features to be added to the plugin.

Yes of course I can share with you the project. Do you have a bitbucket account ? If yes can I have your email or username so I can share the project with you.

Thanks

odiseoteam commented 6 years ago

Hi @aimeric, yes i have a bitbucket account. My account id is: songecko.

Regards.

aimeric commented 6 years ago

Hi @odiseoteam , I have share my repository with your account. I have deleted some personal details in the parameters.yml

we can also talk about it via skype, username -> aimericmoser.hotmail.fr

Thanks!

odiseoteam commented 6 years ago

Hi @aimeric, i see that you need place the following lines after all imports on config.yml:

- { resource: "@OdiseoSyliusVendorPlugin/Resources/config/app/config.yml" }
- { resource: "@OdiseoSyliusVendorPlugin/Resources/config/grids/vendor.yml" }

Doing that i could make it work. Also i added you to skype.

Thanks.

aimeric commented 6 years ago

Hi @odiseoteam ,

I have place the following lines after all imports and it works well.

- { resource: "@OdiseoSyliusVendorPlugin/Resources/config/app/config.yml" }
- { resource: "@OdiseoSyliusVendorPlugin/Resources/config/grids/vendor.yml" }

I have received your invitation on skype.

Thank you so much for your help, you're the best :)