Giter Site home page Giter Site logo

loevgaard / syliusbrandplugin Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 28.0 1.46 MB

A Sylius plugin to enable the association of brands to your products

License: MIT License

PHP 90.41% JavaScript 2.40% Twig 7.19%
php php7 symfony sylius sylius-plugin

syliusbrandplugin's Introduction

Sylius Brand Plugin

Latest Version on Packagist Software License Build Status Quality Score

If you want to add a brand to your products this is the plugin to use. Use cases:

  • Add brand logo to your product pages
  • Filter by brand in the frontend or backend, i.e. product lists

Screenshots

CLICK TO SEE

Menu:

Screenshot showing admin menu

Brand admin pages:

Screenshot showing brand admin index page

Screenshot showing brand admin update page

Screenshot showing brand admin media tab at update page

Products admin pages:

Screenshot showing product admin index page with brand filter

Screenshot showing product admin index page with brand column

Screenshot showing brand tab at product admin update page

Installation

Step 1: Download the plugin

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require loevgaard/sylius-brand-plugin

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the plugin

Then, enable the plugin by adding it to the list of registered plugins/bundles in config/bundles.php file of your project before (!) SyliusGridBundle:

<?php

# config/bundles.php

return [
    // ...
    Loevgaard\SyliusBrandPlugin\LoevgaardSyliusBrandPlugin::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    // ...
];

Step 3: Configure the plugin

# config/packages/loevgaard_sylius_brand.yaml

imports:
    # ...
    - { resource: "@LoevgaardSyliusBrandPlugin/Resources/config/app/config.yaml" }

    # If you want to see Brand column at admin products list - uncomment next line
    # - { resource: "@LoevgaardSyliusBrandPlugin/Resources/config/grids/sylius_admin_product.yaml" }
# config/routes/loevgaard_sylius_brand.yaml

loevgaard_sylius_brand:
    resource: "@LoevgaardSyliusBrandPlugin/Resources/config/routing.yaml"

Step 4: Extend services and entities

Extend Product

  • If you use annotations mapping:

    <?php
    
    declare(strict_types=1);
    
    namespace App\Entity;
    
    use Doctrine\ORM\Mapping as ORM;
    use Loevgaard\SyliusBrandPlugin\Model\ProductInterface as LoevgaardSyliusBrandPluginProductInterface;
    use Loevgaard\SyliusBrandPlugin\Model\ProductTrait as LoevgaardSyliusBrandPluginProductTrait;
    use Sylius\Component\Core\Model\Product as BaseProduct;
    
    /**
     * @ORM\Entity
     * @ORM\Table(name="sylius_product")
     */
    class Product extends BaseProduct implements LoevgaardSyliusBrandPluginProductInterface
    {
        use LoevgaardSyliusBrandPluginProductTrait;
    }
  • If you use xml mapping:

    <?php
    // src/Model/Product.php
    
    declare(strict_types=1);
    
    namespace App\Model;
    
    use Loevgaard\SyliusBrandPlugin\Model\ProductInterface as LoevgaardSyliusBrandPluginProductInterface;
    use Loevgaard\SyliusBrandPlugin\Model\ProductTrait as LoevgaardSyliusBrandPluginProductTrait;
    use Sylius\Component\Core\Model\Product as BaseProduct;
    
    class Product extends BaseProduct implements LoevgaardSyliusBrandPluginProductInterface
    {
        use LoevgaardSyliusBrandPluginProductTrait;
        
        // ...
    }
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- config/doctrine/model/Product.orm.xml -->
    
    <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                                          http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    
        <mapped-superclass name="App\Model\Product" table="sylius_product">
            <many-to-one field="brand" target-entity="Loevgaard\SyliusBrandPlugin\Model\BrandInterface" inversed-by="products">
                <join-column name="brand_id" on-delete="SET NULL" />
            </many-to-one>
        </mapped-superclass>
    
    </doctrine-mapping>

Extend ProductRepository

<?php
# src/Doctrine/ORM/ProductRepository.php

declare(strict_types=1);

namespace App\Doctrine\ORM;

use Loevgaard\SyliusBrandPlugin\Doctrine\ORM\ProductRepositoryInterface as LoevgaardSyliusBrandPluginProductRepositoryInterface;
use Loevgaard\SyliusBrandPlugin\Doctrine\ORM\ProductRepositoryTrait as LoevgaardSyliusBrandPluginProductRepositoryTrait;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;

class ProductRepository extends BaseProductRepository implements LoevgaardSyliusBrandPluginProductRepositoryInterface
{
    use LoevgaardSyliusBrandPluginProductRepositoryTrait;

    // ...
}

Configure

config/services.yaml

sylius_product:
    resources:
        product:
            classes:
                model: App\Model\Product # Or App\Entity\Product
                repository: App\Doctrine\ORM\ProductRepository

Step 5: Update your database schema

$ php bin/console doctrine:migrations:diff
$ php bin/console doctrine:migrations:migrate

Fixtures

  • Include prefedined brand fixtures to play with on your dev environment:

    # config/packages/loevgaard_sylius_brand.yaml
    
    imports:
        - { resource: "@LoevgaardSyliusBrandPlugin/Resources/config/app/fixtures.yaml" }
  • Or write your own:

    • Add a new yaml file to the folder config/packages and name it as you wish, e.g. my_own_fixtures.yaml.

    • Fill this yaml with your own brand fixtures and don't forget to declare the definition of your product(s) before this brand definition or use existing product(s) code.

      # config/packages/my_own_fixtures.yaml
      
      sylius_fixtures:
         suites:
             my_own_brand_fixtures:
                  fixtures:
                      loevgaard_sylius_brand_plugin_brand:
                          options:
                              custom:
                                  my_brand:
                                      name: 'My brand'
                                      code: 'my-brand'
                                      images:
                                          local_image:
                                              type: logo
                                              path: images/my-brand/logo.jpg
                                          3rd_party_plugin_image:
                                              type: black-and-white
                                              path: '@SomePlugin/Resources/images/my-brand/black-and-white.jpg'
                                      products:
                                        - product_code_1
                                        - product_code_2
                                        - product_code_3
      

      See example at src/Resources/config/app/fixtures.yaml.

  1. Load your fixtures

    php bin/console sylius:fixture:load my_own_brand_fixtures

Installation and usage for plugin development

To run test application to play with just type composer try.

Sonata blocks available

  • loevgaard_sylius_brand.admin.brand.create.tab_details
  • loevgaard_sylius_brand.admin.brand.update.tab_details
  • loevgaard_sylius_brand.admin.brand.create.tab_media
  • loevgaard_sylius_brand.admin.brand.update.tab_media

Events available

  • loevgaard_sylius_brand.menu.admin.brand.form to customize Brand admin form like you usually do with Product form via sylius.menu.admin.product.form event.

Testing

Play with API

  • Install https://stedolan.github.io/jq/ (type brew install jq at OSX terminal)

  • Get admin API access token:

    SYLIUS_ADMIN_API_ACCESS_TOKEN=$(curl http://localhost:8000/api/oauth/v2/token \
        --silent --show-error \
        -d "client_id"=demo_client \
        -d "client_secret"=secret_demo_client \
        -d "grant_type"=password \
        -d "username"[email protected] \
        -d "password"=sylius-api | jq '.access_token' --raw-output)
  • Make requests:

    (GET requests indexing/showing resources shown here as an example, see tests/Controller/*ApiTest.php to discover more details about creating/updating/removing brand-related resources, creating new products with brand attached to it, uploading image files for BrandImages via API)

    To Brands admin API:

    curl http://localhost:8000/api/v1/brands/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"
    curl http://localhost:8000/api/v1/brands/setono/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"

    Brand images API:

    curl http://localhost:8000/api/v1/brands/setono/images/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"

    Brand images by type API:

    curl http://localhost:8000/api/v1/brands/setono/images/logo/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"
    curl http://localhost:8000/api/v1/brands/setono/images/<ID>/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"

    Brand products API:

    curl http://localhost:8000/api/v1/brands/setono/products/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"

    Product details API:

    curl http://localhost:8000/api/v1/products/setono-mug/ \
        -H "Authorization: Bearer $SYLIUS_ADMIN_API_ACCESS_TOKEN"

    For XML output, add -H "Accept: application/xml" to request

Contribute

Please, run composer all to run all checks and tests before committing.

Contribute by translating

We use the same service as Sylius for translating, namely Crowdin. You can help out by translating this project into your mother tongue ;)

Thanks!

syliusbrandplugin's People

Contributors

cyrosy avatar hipachka avatar igormukhingmailcom avatar jaisdk avatar loevgaard avatar mneuville avatar nicoplh avatar oallain avatar pierre-h avatar prometee avatar rimas-kudelis avatar roshyo avatar setonobot avatar sophiebb avatar techbech 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

Watchers

 avatar  avatar  avatar  avatar  avatar

syliusbrandplugin's Issues

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Sylius official plugin

Hi Joachim!

I'm Mateusz, I work in Sylius company and one of my roles is Plugin Curator - I'm responsible for checking out Sylius Plugins that appear in our ecosystem. We would really love to display this one on our officially accepted plugins list (https://sylius.com/plugins/), as I strongly believe it could be useful for other people in the community :)

The only problem is, we have some strict requirements for the plugin that is meant to be displayed on our website. One of the most important are the properly developed tests. Sadly, your plugin has neither no acceptance (Behat) tests (good there are some unit tests ๐Ÿ‘). Do you think you would be able to provide them?

I have also some other comments that could improve the code base of your plugin and make it closer to our ideal Sylius Plugin vision :)

If you have any question, please, feel free to ask me.
Nevertheless, thank you for your great job! ๐ŸŽ‰

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Getting <<Variable "remote_url" does not exist>> in a completely different file

Hi, it's me again, I'm soo close to getting this working now.

remote_url_does_not_exist

I would have assumed that this was my fault somehow if it wasn't for the fact that this error is mentioned in your documentation. Albeit in a completely different file. Now I'm getting this error in one of the stock (vendor) templates, not in something I modified myself.

Now, I have barely started to learn the inner workings of Sylius so I may be completely off target here, but the documentation mentions that you inject something globally. Could your "remote_url" be conflicting with some other "remote_url"?

These are the relevant packages in my composer.json:

"require": {
"php": "^7.2",
"loevgaard/sylius-brand-plugin": "^2.0",
"sylius/shop-api-plugin": "^1.0@RC",
"sylius/sylius": "~1.5.0",

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Brand description

Hey, started using the plugin and thought it would be nice to have brand description field, so it would be easily accessible on product page to display.

How I could extend the Brand entity to add description field ?
Or is it worth considering to add to plugin itself ?

Fix copy pasted services

Search for 'barcode' in the project. This will reveal some behat tests (maybe more) that should be renamed to 'brand'

[Bug] Brand image previews doesn't work

Brand image previews are not rendered unless I load following command in a javascript file:
$(document).previewUploadedImage('#loevgaard_sylius_brand_brand_images');

This can be done in the browser console to test.

I assume that this is a new bug since this bug has been solved before.
If you can confirm this bug I can provide a PR to solve it.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

[FEATURE] Channel based restrictions for brands

Use-case: the ability to limit a whole brand from being sold on a specific channel instead of disabling individual products by hand. This may take a form of a batch update that turns off channel on individual products not to complicate database/elastic queries.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Installation incomplete on sylius 1.4.2

Hi !
I ve just installed the plugin on Sylius 1.4.2 and there are missing directory on loevgaard/sylius-brand-plugin like Doctrine.
i need help to complete the setup.
Best regards
Mathieu

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Documentation outdated or just me?

Hello!

I'm seeing some discrepancies between the documentation and my code implementation. My composer file has:

"require": {
"php": "^7.2",
"loevgaard/sylius-brand-plugin": "^1.3",
"sylius/sylius": "~1.5.0"

The documentation says:

use Loevgaard\SyliusBrandPlugin\Model\ProductInterface as LoevgaardSyliusBrandPluginProductInterface;
use Loevgaard\SyliusBrandPlugin\Model\ProductTrait as LoevgaardSyliusBrandPluginProductTrait;

But that doesn't work. This does work, however:

use Loevgaard\SyliusBrandPlugin\Entity\BrandAwareInterface;
use Loevgaard\SyliusBrandPlugin\Entity\ProductTrait;

There is a similar problem with the ProductRepository, where the suggested use statements don't fit the actual code.

Is this due to to me using bad versions of Sylius and/or the plugin, or is the documentation out of date?

Thanks.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Add admin product brand field to a separate tab menu

Using template overrides is sometime hard, especially if you already had your own alteration.

For my project I already have to much things on the first admin product tab. To configure this plugin I add a new tab called "Brand" where I put a new template filled with the new tab and the brand form field.

What do you think about that ? I will propose a PR to propose this.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Display brand related information wherever a product name is displayed

Sometimes, a product name by itself it does not say much. For example: X. solely from this string, how do you know if I'm talking about iPhone X?

maybe the plugin should provide a function that allows developers who display the product name to display the concatenation between product name and product brand.

For example: $product->getFullTitle() should retrieve sprintf('%s %s', $product->getTitle(), $product->getBrand()->getTitle());

Make Brand implements ProductsAwareInterface

The relation between Product and Brand is not bidirectional, I suggest to add to the Brand entity the implementation of ProductsAwareInterface to add the possibility to get all products from a brand.

Unable to link Brand to Product

Sylius brand plugin version : 1.3.2
Sylius version : 1.4.0
PHP version : 7.2.15

I'm probably dumb but since I've installed the SyliusBrandPlugin, I'm unable to make it work...
I've followed all the steps on the README. But when I try to link a Brand to a Product via the admin dashboard. The modification is done but not effective (the brand remains not linked).
I've checked in the database and the brand table is successfully created because I can create a brand.

However, there isn't any brandId or brand property in the product table. That's probably why it does not work fo me. And when I run a schema update, Doctrine says that the database is up to date.

I tried to figure out what's going on and I found this error in the Symfony logs :

The association Loevgaard\SyliusBrandPlugin\Entity\Brand#products refers to the owning side field App\Entity\Product\Product#brand which does not exist.

Please help me <3

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Add frontend use case

Add a frontend use case where the brand is used i.e. on the product and create associated behat tests.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Missing default template for Shop/show.html.twig

Navigating to /brand/{code} as defined in src/Resources/config/routing/shop.yaml yields an error Unable to find template "/show.html.twig"

This means it's looking for the template in the root of the templates folder instead of the brand bundle tempalte folder. To fix this you have to add the entire route definition in your own project instead of just being able to overwrite the template file.

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Add image to grid

On the grid displaying the brands, the brand image should be displayed

Add override example

Add an example where for example the model is overriden:

loevgaard_sylius_brand:
    resources:
        brand:
            classes:
                model: App\Entity\Brand

Variable "remote_url" does not exists after upgrade to 2.0-beta

In version 2, we injecting form_row(form.brand, ...) automatically to
Product form view (it placed at src/Resources/views/Admin/Product/_brand.html.twig)
via events into separate tab.

So you should remove that from your template or even remove whole template.
Otherwise you will receive Variable "remote_url" does not exists. error.

Choose your option:

  • Remove whole template if you doesn't have any other customizations in this template
    except ones that was required in 1.3.X version of plugin:

    $ rm templates/bundles/SyliusAdminBundle/views/Product/Tab/_details.html.twig
  • Or remove next line from your templates/bundles/SyliusAdminBundle/views/Product/Tab/_details.html.twig
    if you still need that template (e.g. you have some other customizations in it):

    {{ form_row(form.brand) }} {# This is the only change made to this file #}

PS: Issue was reported by @Peteck in private chat. Adding it here in case someone search for same error.

Add doctrine annotations in ProductTrait

If you want to use this plugin with sf4, you will need to modify the default doctrine config for the src directory, because by default you need annotations and not yaml configuration.

Like here the trait is annotate to take care of this default behaviour.

An another way could be to create a config/doctrine/ProductTrait.orm.yml, but I don't know if it will actually works. I know it works for interfaces but I don't know if it works for traits.

I will send a PR to handle the annotation proposition.

sylius.products table already exits

Trying to install the plug-in, when running

php bin/console doctrine:migrations:diff

getting this error

In SchemaException.php line 108:
                                                                
  The table with name 'shop.sylius_product' already exists.  

What am I doing wrong?

[Composer] not compatible with sylius 1.4

While trying to upgrade my project I was stopped by this error :

  Problem 1
    - loevgaard/sylius-brand-plugin dev-master requires sylius/sylius ~1.3.0@dev -> satisfiable by sylius/sylius[1.3.x-dev, v1.3.0, v1.3.0-BETA, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7, v1.3.8] but these conflict with your requirements or minimum-stability.
    - loevgaard/sylius-brand-plugin dev-master requires sylius/sylius ~1.3.0@dev -> satisfiable by sylius/sylius[1.3.x-dev, v1.3.0, v1.3.0-BETA, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7, v1.3.8] but these conflict with your requirements or minimum-stability.
    - Installation request for loevgaard/sylius-brand-plugin dev-master -> satisfiable by loevgaard/sylius-brand-plugin[dev-master].

Add brand fixture

I think this is an important feature to add, if you want to deploy a shop and don't want to export your dev database to your prod one, you will need fixtures to quickly add required data to your shop.

If I have enough time I will make a PR with necessary tests like I do it on SyliusInvoicingPlugin

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - localheinz/composer-normalize[1.2.0, ..., 1.3.1] require composer-plugin-api ^1.1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - Root composer.json requires localheinz/composer-normalize ^1.2 -> satisfiable by localheinz/composer-normalize[1.2.0, 1.3.0, 1.3.1].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

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.