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

Can't extend VendorTranslation #13

Closed zvitek closed 4 years ago

zvitek commented 4 years ago

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.

odiseoteam commented 4 years ago

Hi @zvitek . Yes, you add your own fields in VendorTranslation. To do that you can to follow the official Sylius docs that explains how to override a translation model: https://docs.sylius.com/en/latest/customization/model.html#how-to-customize-translatable-fields-of-a-translatable-model. Check the 2nd point.

zvitek commented 4 years ago

@odiseoteam Thank you for fast help! That is the solution what I looked for. Next time, I'll be more read :)

odiseoteam commented 4 years ago

You're welcome. For advanced multi vendor marketplace solution you can check our another plugin: https://odiseo.io/plugins-and-bundles/premium/sylius-mvm-plugin