Closed azamalvi closed 9 years ago
What Sylius version do you use?
I just run below two lines one by one
$ composer require sylius/promotion:* $ composer require "sylius/promotion-bundle"
then in my composer.json they were included as
"sylius/promotion": "*", "sylius/promotion-bundle": "^0.15.0"
Try simply composer require "sylius/promotion-bundle"
and remember to add required bundles http://docs.sylius.org/en/latest/bundles/SyliusPromotionBundle/installation.html
I have done same as you described but same problem :(
Try to remove this line https://github.com/Sylius/Sylius/pull/3266/files in vendors.
Same error. Here is my configuration setting
sylius_promotion: driver: doctrine/orm classes: promotion_subject: model: My\OrdersBundle\Entity\Orders
stof_doctrine_extensions: orm: default: timestampable: true
Do you have vendor/sylius/promotion/Model/PromotionInterface.php
class in your project directory?
@michalmarcinkowski yes I have this class in above mentioned directory.
@azamalvi This is really weird, could you try reinstalling Sylius? It is impossible that this class does not exist. Have you modified Composer autoload or something? Could you also give us full exception?
Also, according to the docs:
"Please register the bundle before DoctrineBundle. This is important as we use listeners which have to be processed first."
I am guessing that's the cause of your problem, but not sure, as you have pasted only part of the exception.
@pjedrzejewski bellow are the complete steps that I performed one by one.
Update Composer composer require "sylius/promotion-bundle"
Register Bundle new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), new Sylius\Bundle\PromotionBundle\SyliusPromotionBundle(), new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
remaining bundles were already registered.
config.yml sylius_promotion: driver: doctrine/orm classes: promotion_subject: model: Acme\OrdersBundle\Entity\Orders
stof_doctrine_extensions: orm: default: timestampable: true
routing.yml sylius_promotion: resource: "@SyliusPromotionBundle/Resources/config/routing.yml"
Schema Update Now at this point when I update schema then I received the following error.
[Doctrine\Common\Persistence\Mapping\MappingException] Class 'Sylius\Component\Promotion\Model\PromotionInterface' does not exist
@azamalvi "Please register the bundle before DoctrineBundle. This is important as we use listeners which have to be processed first." - did you register these bundles before DoctrineBundle
?
@michalmarcinkowski yes I have already registered this bundle in Appkernal.php and here is the settings in config.yml that I have use it
doctrine: orm: auto_generate_proxy_classes: "%kernel.debug%" entity_managers: default: auto_mapping: true metadata_cache_driver: '%cache_driver%' query_cache_driver: '%cache_driver%' result_cache_driver: '%cache_driver%' mappings: SonataMediaBundle: ~ ApplicationSonataMediaBundle: ~ ApplicationSonataClassificationBundle: ~
It is fixed I just update the doctrine/doctrine-bundle to latest one and now it works fine. I don't know what the hack was.
When I try to update schema then I got this error. When I look inside my vendors Sylius folder I did not find any component folder there. It seem that composer did not download this because I searched about this and found that "This package is abandoned and no longer maintained. No replacement package was suggested" So how can I use Promotion bundle?