Giter Club home page Giter Club logo

syliusvendorplugin's Introduction

Sylius Vendor Plugin

Description

This is a Sylius Plugin that adds vendors (brands) to your store. A vendor is an entity that sells products and is fully customizable by the admin.

Features:

  • Vendors by Channel: You can specify what vendors will be enabled for different stores.
  • Vendors with translations: Vendor's information is translatable.
  • Templates: This plugin has shop views for list and show vendors.
  • Multi Emails: Vendors can have a primary and also additionals emails.
  • Ready for Headless: Full Rest API.
  • Sitemap: All shop pages are connected with the Sitemap Plugin.
  • Easy to extend: This plugin follows the best practices to make it fully extensible.

Support Sylius version 1.9+.

Premium features!

Do you want advanced features? Take a look at our Multi Vendor Marketplace Plugin, this converts your Sylius store into a marketplace store like Amazon, Etsy, eBay.

Screenshots

Vendors admin list

Vendors admin product edit

Vendors shop index

Vendors shop show

Demo

You can see this plugin in action in our Sylius Demo application.

Documentation

Credits

This plugin is maintained by Odiseo. Want us to help you with this plugin or any Sylius project? Contact us on [email protected].

syliusvendorplugin's People

Contributors

bigboss86 avatar crespoep avatar dennisdebest avatar mcruzit avatar songecko avatar wittwerch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

syliusvendorplugin's Issues

Can't update database

while updating the database

php bin/console doctrine:schema:update

I get this error

The table with name 'app_dev.sylius_product_channels' already exists.

Error after installing SyliusVendorPlugin

After installing this plugin, I've this error

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘sylius2_dev.odiseo_channel’ doesn’t exist

The table exists.

Do you need more informations ?

Slug And Name Have to be translated

since vendor is related to a locale
its name and slug HAD TO BE translated like description field.
so when the shop user uses another language the vendors page should be switch the names to the new related locale

Bugs related to sylius 1.9 latest version of sylius

Will list some issues i encounter with the bundle on the new version of sylius

Versions

##### Version
PHP 7.4.16
Symfony 4.4.20
Sylius 1.9.0
Bundle 1.3

1 strict option is not existed

Problem

image

Solution

when i tried to edit these two files

  1. src/Resources/config/validation/VendorEmail.yaml
  2. src/Resources/config/validation/Vendor.yaml
    and remove the strict: true it worked fine

2 Template References

Problem

image

Solution

here src/Resources/config/routing/admin/vendor.yaml, i replaced this section templates: SyliusAdminBundle:Crud with templates: '@SyliusAdmin\\Crud'

can't install vendorplugin on sylius1.0.5

Fatal error: Uncaught Error: Cannot call abstract method Symfony\Component\HttpKernel\KernelInterface::registerBundles() in /Users/ben/www/sylius105/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Application/Kernel.php on line 112

Register own listeners on create/update vendor

Hello, I would like to extend you plugin for more images. Everything is ok, but I have a problem to register event listener for upload files. Is there a way how to register own listener on vendor create/update event?
Thank you for help

Seems mappedBy attribute missing : OneToMany mapping on field 'products' requires the 'mappedBy' attribute.

Seems mapping not working.

Stack Trace

`Doctrine\ORM\Mapping\MappingException:
OneToMany mapping on field 'products' requires the 'mappedBy' attribute.

at vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:259
at Doctrine\ORM\Mapping\MappingException::oneToManyRequiresMappedBy('products')
(vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:1669)
at Doctrine\ORM\Mapping\ClassMetadataInfo->_validateAndCompleteOneToManyMapping(array('fieldName' => 'products', 'targetEntity' => 'Sylius\Component\Core\Model\Product', 'type' => 4, 'mappedBy' => null, 'inversedBy' => null, 'isOwningSide' => true, 'sourceEntity' => 'Odiseo\SyliusVendorPlugin\Entity\Vendor', 'fetch' => 2, 'cascade' => array(), 'isCascadeRemove' => false, 'isCascadePersist' => false, 'isCascadeRefresh' => false, 'isCascadeMerge' => false, 'isCascadeDetach' => false))
(vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2566)
at Doctrine\ORM\Mapping\ClassMetadataInfo->mapOneToMany(array('fieldName' => 'products', 'targetEntity' => 'Sylius\Component\Core\Model\Product', 'type' => 4))
(vendor/odiseoteam/sylius-vendor-plugin/src/Mapping/VendorAwareListener.php:172)
at Odiseo\SyliusVendorPlugin\Mapping\VendorAwareListener->mapVendor(object(ClassMetadata))
(vendor/odiseoteam/sylius-vendor-plugin/src/Mapping/VendorAwareListener.php:85)
at Odiseo\SyliusVendorPlugin\Mapping\VendorAwareListener->loadClassMetadata(object(LoadClassMetadataEventArgs))
(vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:58)
at Symfony\Bridge\Doctrine\ContainerAwareEventManager->dispatchEvent('loadClassMetadata', object(LoadClassMetadataEventArgs))
(vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:242)
at Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata(object(ClassMetadata), null, false, array())
(vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:306)
at Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata('Odiseo\SyliusVendorPlugin\Entity\Vendor')
(vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78)
at Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata('Odiseo\SyliusVendorPlugin\Entity\Vendor')
(vendor/doctrine/persistence/lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php:185)
at Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('Odiseo\SyliusVendorPlugin\Entity\Vendor')
(vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:285)
at Doctrine\ORM\EntityManager->getClassMetadata('Odiseo\SyliusVendorPlugin\Entity\Vendor')
(var/cache/dev/Container8JfB0Bv/EntityManager_9a5be93.php:86)
at EntityManager_9a5be93->getClassMetadata('Odiseo\SyliusVendorPlugin\Entity\Vendor')
(var/cache/dev/Container8JfB0Bv/getOdiseoSyliusVendorPlugin_Repository_VendorService.php:14)
at require('/var/www/html/sylius/var/cache/dev/Container8JfB0Bv/getOdiseoSyliusVendorPlugin_Repository_VendorService.php')
(var/cache/dev/Container8JfB0Bv/srcApp_KernelDevDebugContainer.php:2077)
at Container8JfB0Bv\srcApp_KernelDevDebugContainer->load('getOdiseoSyliusVendorPlugin_Repository_VendorService.php')
(var/cache/dev/Container8JfB0Bv/getOdiseoSyliusVendorPlugin_Controller_VendorService.php:25)
at require('/var/www/html/sylius/var/cache/dev/Container8JfB0Bv/getOdiseoSyliusVendorPlugin_Controller_VendorService.php')
(var/cache/dev/Container8JfB0Bv/srcApp_KernelDevDebugContainer.php:2077)
at Container8JfB0Bv\srcApp_KernelDevDebugContainer->load('getOdiseoSyliusVendorPlugin_Controller_VendorService.php')
(vendor/symfony/dependency-injection/Container.php:249)
at Symfony\Component\DependencyInjection\Container->make('odiseo_sylius_vendor_plugin.controller.vendor', 1)
(vendor/symfony/dependency-injection/Container.php:225)
at Symfony\Component\DependencyInjection\Container->get('odiseo_sylius_vendor_plugin.controller.vendor')
(vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:53)
at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController('odiseo_sylius_vendor_plugin.controller.vendor')
(vendor/symfony/framework-bundle/Controller/ControllerResolver.php:70)
at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController('odiseo_sylius_vendor_plugin.controller.vendor')
(vendor/symfony/http-kernel/Controller/ControllerResolver.php:122)
at Symfony\Component\HttpKernel\Controller\ControllerResolver->createController('odiseo_sylius_vendor_plugin.controller.vendor::indexAction')
(vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:42)
at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->createController('odiseo_sylius_vendor_plugin.controller.vendor::indexAction')
(vendor/symfony/framework-bundle/Controller/ControllerResolver.php:62)
at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->createController('odiseo_sylius_vendor_plugin.controller.vendor:indexAction')
(vendor/symfony/http-kernel/Controller/ControllerResolver.php:86)
at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController(object(Request))
(vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38)
at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController(object(Request))
(vendor/symfony/http-kernel/HttpKernel.php:129)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:27)`

Adding features to the plugin

Hi @odiseoteam,

I'm sure a lot of developers using Sylius will be interested with your multi vendor plugin, but I think some important features should be added , here few suggestions:

  • A vendor should only be able to see ( edit, delete ) his own products.

  • In the dashboard tab the vendor should only see his orders and his total sales.

  • The tab configuration and client shouldn't be visible to a vendor, only to the admin of the website.

  • In the tab sales the vendor should only see his orders

  • When the admin user create a new vendor he should be able to create a password for the new vendor.

Aimeric :)

Can't extend VendorTranslation

Hello, it's possible to extend VendorTranslation with additional fields?
I`m a new in Sylius a my standart solution doesn't work.

declare(strict_types=1);
namespace App\Entity\Vendor;

use Doctrine\ORM\Mapping as ORM;
use \Odiseo\SyliusVendorPlugin\Entity\VendorTranslation as BaseVendorTranslation;

class VendorTranslation extends BaseVendorTranslation implements VendorTranslationInterface
{
    /** @ORM\Column(type="text", nullable=true) */
    private $about;

    public function getAbout(): ?string
    {
        return $this->about;
    }

    public function setAbout(string $about = null): void
    {
        $this->abou = $about;
    }
}

and _sylius.yaml

sylius_resource:
    resources:
        odiseo_sylius_vendor_plugin.vendor:
            translation:
                classes:
                    model: App\Entity\Vendor\VendorTranslation

Thank you for help.

Can't extend plugin

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.

Database migration issue

Whenever I try to migrate the database, following issue shows up.

ALTER TABLE sylius_channel_currencies DROP FOREIGN KEY FK_AE491F9372F5A1AA
Migration 20180213033415 failed during Execution. Error An exception occurred while executing 'ALTER TABLE sylius_channel_currencies DROP FOREIGN KEY FK_AE491F9372F5A1AA':

Deprecated issue: Creation of dynamic property VendorUrlProvider::$channel is deprecated

Hello,

With PHP 8.2 I got a deprecated issue:
PHP Deprecated: Creation of dynamic property Odiseo\SyliusVendorPlugin\SitemapProvider\VendorUrlProvider::$channel is deprecated in /var/www/html/vendor/odiseoteam/sylius-vendor-plugin/src/SitemapProvider/VendorUrlProvider.php on line 40

The property $channel is not declared in top of the class but created dynamically in VendorUrlProvider.php:40

Have a nice day :)

Error after install

composer require odiseoteam/sylius-vendor-plugin

it downgrades sylius 1.3 to 1.2 and shows:


  The definition for "imports" has no class. If you intend to inject this service dynamically at runtime, please mark
   it as synthetic=true. If this is an abstract definition solely used by child definitions, please add abstract=true
  , otherwise specify a class to get rid of this error.

Wrong image path

Have trouble with image path

URL
Expected /media/vendor-logo/myvendor.png
Got /media/cache/resolve/odiseo_sylius_vendor_logo/myvendor.png

Sylius: ^1.2
sylius-vendor-plugin: ^1.0

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

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

The table with name 'sylius.odiseo_vendor' already exists.

Hello,

When I try to override the model with the configuration like this:

sylius_resource:
    resources:
        odiseo_sylius_vendor_plugin.vendor:
            classes:
                model: App\Entity\Vendor\Vendor
use Odiseo\SyliusVendorPlugin\Entity\Vendor as BaseVendor;
use Doctrine\ORM\Mapping as ORM;

/**
 * Class Vendor
 *
 * @package App\Entity\Vendor
 * @ORM\Entity
 * @ORM\Table(name="odiseo_vendor")
 */
class Vendor extends BaseVendor
[...]

and when I try to update schema i got this error:
The table with name 'sylius.odiseo_vendor' already exists.

Can you help me ?

thank :)

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.