EzDevInfo.com

Sylius

Modern e-commerce for PHP, based on the Symfony2 framework. Sylius.org - Modern ecommerce for Symfony2 sylius is a modern ecommerce solution for php, easily customizable and based on the symfony2 framework.

symfony 2 sylius bundle lost (TranslationBundle )

I try to install Sylius ResourceBundle on my project but when i run my symfony project, i get this error :

Class 'Sylius\Bundle\TranslationBundle\DependencyInjection\AbstractTranslationExtension' not found

I can't find Sylius TranslationBundle .

How can i fix it ?


Source: (StackOverflow)

"Submitted form is invalid" when adding a product to cart : Sylius Cart Bundle

I apologize if this seems to be a very naive question..but i've just learnt Symfony2 and trying to learn the workings of Sylius.

When I add a product to the cart it seems to always return the error :

Submitted form is invalid

I have searched the solution to this but nothing seems to be documented (or have I missed it ??)

I also commented the validation section but still get the same error. Please help and thanks in advance.


Source: (StackOverflow)

Advertisements

Install Sylius - Symfony2 OpenSource Ecommerce

I am trying to install Sylius from here but i am unable to get it working. On running the command i get process timed out...well...due to the ever slow internet we use here. Could anyone please guide into installing sylius manually?? Like say manually updating vendors using composer.phar


Source: (StackOverflow)

sylius or sonata or custom for subscription based application

We are going to build something like cratejoy.com, but don't want spend lot's of time building which is already builded before for developers.

I was going through sonata and sylius, but not sure if we can build subscription based model with one of them. If yes we can, then which would be best to use? or should we just build complete custom solution, because it involve b2b solution.

What we will be building?

Basically e-commerce software like any os-commerce shopping system, but the only difference is, we will be adding subscription on each product.

So let's say, if you order a product, we will ship it to you every month to your door step.

but we are building this as service, so many people can just create their site and start using our tools to start selling there products.


Source: (StackOverflow)

Update Vendors in Sylius - Imagine Bundle Error (Symfony2)

I am trying to install Sylius - Open Source E-Commerce based on Symfony2 from this link
The composer can successfully pull the project files from github but while updating vendors i get this error

[UnexpectedValueException] 'C:\wamp\www\sylius\vendor/liip/imagine-bundle/Liip/ImagineBundle/3e0aa0b8b 218dab8fc7a752ff6d3a41e.4' is not a zip archive.

I have zip and git installed on my system. Please help with your solutions and suggestions. Thanks in advance.


Source: (StackOverflow)

Proper dev. approach for overriding Twig templates

I recently decided to take a look at Sylius, since I love the idea of a developer-friendly Symfony2 project.

I tried to look through the various documentation articles, but I didn't seem to be able to find the answer for a very fundamental question that I have: what is the recommended way to start development on a new web-store, which will include (at the very least), the ability to implement one's own HTML template designs, and still be able to easily upgrade Sylius to future versions?

The best approach that I was able to come up with is to create a new bundle (in my case, named WebBundle) which is based on the default SyliusWebBundle. Here's the problem. In order to get the bare minimum of allowing Sylius to use the templates in my bundle, rather than the default one, I had to go through many hoops. Here are several things I have done so far:

  • Copied the contents of the original Controller directory from SyliusWebBundle. Changed return values to use WebBundle rather than SyliusWebBundle a part of the string in the argument to $this->render(), as well as the class namespaces.
  • Copied the YAML files in the Resources/config/routing directory from SyliusWebBundle to my bundle. Changed SyliusWebBundle references in the YAML files, similar to the above.
  • Added new sections to app/config/config.yml, specifically this part (intended to override the contents of addCheckoutSection() in Sylius\Bundle\CoreBundle\DependencyInjection\Configuration):

     sylius_core:
        # ...
        checkout:
            steps:
                security:
                    template: 'WebBundle:Frontend/Checkout/Step:security.html.twig'
                addressing:
                    template: 'WebBundle:Frontend/Checkout/Step:addressing.html.twig'
                shipping:
                    template: 'WebBundle:Frontend/Checkout/Step:shipping.html.twig'
                payment:
                    template: 'WebBundle:Frontend/Checkout/Step:payment.html.twig'
                finalize:
                    template: 'WebBundle:Frontend/Checkout/Step:finalize.html.twig'
    

I have a lot more work in changing all the default controller references in the YAML files in Resources/config/routing/frontend directory, but before I proceed onward, I need to know if this is the correct approach, or if I'm going down the wrong path.

My goal is to make the store as easy to upgrade as possible with new releases of Sylius, so I'd like to avoid modifying core library files, and instead selectively overriding functionality using my own bundles, as needed.

However, Sylius currently doesn't yet appear to be "geared" towards this approach, unless I missed something.

The fact that I had to override functionality from more than one bundle (CoreBundle as well as WebBundle, per the above YAML section), made me pause with my current approach. I hope someone might be able to steer me in the right direction.


Source: (StackOverflow)

Install Fixtures in Sylius - Symfony2

After having successfully installed and updated all vendors in my project folder for Sylius i tried running this code :

app/console sylius:install --fixtures

I get this error :

PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\vendor\ symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51

Then i tried all possible solutions given here

Installed intl extension in php (working successfully).Then ran this command

php build-data.php 'your ICU version'

On running the above command i get this:

'which' is not recognized as an internal or external command, operable program or batch file. The command "svn" is not installed

I want to know if there is another workaround to this issue. Please help and thanks in advance.

P.S. - No SVN runs on my system. And i'm using icu*46.dll

Anyone came across this??


Source: (StackOverflow)

How to update sylius/standard

I have installed sylius with

composer create-project -s dev sylius/sylius
cd sylius
app/console sylius:install

I have added my own Bundle which extends SyliusWebBundle and some other things. Of course I have change parameters.yml etc.

How can I update parts of Sylius? Vendors are updated via composer update, but what about SyliusBundles in src folder?


Source: (StackOverflow)

replace the authentication layer and user entity in sylius

I have created a symfony2 project and custom Authentication Provider (http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html) is used. my new task is to create an E-commerce application in sylius which should work alongside with my current symfony2 project. i want to make my current user table in symfony2 project as user provider in sylius...is it possible to create such project..... since fosUserBundle and fosOauthServer bundel are installed in sylius how can i override these bundles with my custom authentication mechanism

My symfony2 project configurations are mentioned below

I tried the following in security.yml

 security:
     encoders:
         AppBundle\Entity\Users:
             algorithm: bcrypt

    providers:
        our_db_provider:
            entity:
                class: AppBundle:Users

        api_key_user_provider:
            id: api_key_user_provider


    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt|error)|css|images|js)/
            security: false

        api:
            pattern: ^/api
            stateless: true
            simple_preauth:
                authenticator: apikey_authenticator
            provider: api_key_user_provider    

        web:
            anonymous: ~
            http_basic: ~
            provider: our_db_provider
            form_login:
                login_path: /login
                check_path: /login_check

this is my user class

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;

/**
 * Users
 *
 * @ORM\Table(name="users", uniqueConstraints=  {@ORM\UniqueConstraint(name="users_user_name_unique", columns={"user_name"}),   @ORM\UniqueConstraint(name="users_xmpp_password_unique", columns=  {"xmpp_password"})})
 * @ORM\Entity(repositoryClass="AppBundle\Entity\UsersRepository")
 */


class Users implements UserInterface, \Serializable {

/**
 * @var integer
 *
 * @ORM\Column(name="id", type="integer", nullable=false)
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="IDENTITY")
 */
private $id;

/**
 * @var integer
 *
 * @ORM\Column(name="parent_id", type="integer", nullable=false)
 */
private $parentId;

/**
 * @var string
 *
 * @ORM\Column(name="first_name", type="string", length=100, nullable=false)
 */
private $firstName;

/**
 * @var string
 *
 * @ORM\Column(name="last_name", type="string", length=100, nullable=false)
 */
private $lastName;

/**
 * @var string
 *
 * @ORM\Column(name="user_name", type="string", length=120, nullable=false)
 */
private $userName;

/**
 * @var string
 *
 * @ORM\Column(name="reg_type", type="string", length=20, nullable=false)
 */
private $regType;

/**
 * @var string
 *
 * @ORM\Column(name="oauth_uid", type="string", length=255, nullable=false)
 */
private $oauthUid;

/**
 * @var boolean
 *
 * @ORM\Column(name="active", type="boolean", nullable=false)
 */
private $active;

/**
 * @var string
 *
 * @ORM\Column(name="email", type="string", length=100, nullable=false)
 */
private $email;

/**
 * @var string
 *
 * @ORM\Column(name="password", type="string", length=150, nullable=false)
 */
private $password;

/**
 * @var string
 *
 * @ORM\Column(name="xmpp_password", type="string", length=20, nullable=false)
 */
private $xmppPassword;

/**
 * @var \DateTime
 *
 * @ORM\Column(name="created_at", type="datetime", nullable=false)
 */
private $createdAt = '0000-00-00 00:00:00';

/**
 * @var \DateTime
 *
 * @ORM\Column(name="updated_at", type="datetime", nullable=false)
 */
private $updatedAt = '0000-00-00 00:00:00';

/**
 * @var \DateTime
 *
 * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
 */
private $deletedAt;

/**
 * @var string
 *
 * @ORM\Column(name="activation_code", type="string", length=50, nullable=true)
 */
private $activationCode;

/**
 * @var string
 *
 * @ORM\Column(name="user_profile_pic", type="string", length=200, nullable=false)
 */
private $userProfilePic = 'uploads/defaults/user/profile_pic.jpg';

/**
 * @var string
 *
 * @ORM\Column(name="user_timeline_pic", type="string", length=200, nullable=false)
 */
private $userTimelinePic = 'uploads/defaults/user/timeline_pic.jpg';

/**
 * @var string
 *
 * @ORM\Column(name="country", type="string", length=50, nullable=false)
 */
private $country;

/**
 * @var string
 *
 * @ORM\Column(name="state", type="string", length=50, nullable=false)
 */
private $state;

/**
 * @var string
 *
 * @ORM\Column(name="city", type="string", length=50, nullable=false)
 */
private $city;

/**
 * @var string
 *
 * @ORM\Column(name="hobbies", type="string", length=100, nullable=false)
 */
private $hobbies;

/**
 * @var string
 *
 * @ORM\Column(name="interests", type="string", length=100, nullable=false)
 */
private $interests;

/**
 * @var string
 *
 * @ORM\Column(name="about", type="string", length=500, nullable=false)
 */
private $about;

/**
 * @var boolean
 *
 * @ORM\Column(name="gender", type="boolean", nullable=false)
 */
private $gender;

/**
 * @var \DateTime
 *
 * @ORM\Column(name="dob", type="date", nullable=false)
 */
private $dob;

/**
 * @var integer
 *
 * @ORM\Column(name="quickblox_id", type="integer", nullable=false)
 */
private $quickbloxId;

/**
 * @var boolean
 *
 * @ORM\Column(name="privacy", type="boolean", nullable=false)
 */
private $privacy = '0';

/**
 * @var string
 *
 * @ORM\Column(name="school", type="string", length=255, nullable=false)
 */
private $school;

/**
 * @var string
 *
 * @ORM\Column(name="college", type="string", length=255, nullable=false)
 */
private $college;

/**
 * @var string
 *
 * @ORM\Column(name="work", type="string", length=255, nullable=false)
 */
private $work;

/**
 * @var string
 *
 * @ORM\Column(name="relationship_status", type="string", length=50, nullable=false)
 */
private $relationshipStatus;



public function getSalt() {
    // you *may* need a real salt depending on your encoder
    // see section on salt below
    return null;
}



public function getRoles() {
    return array('ROLE_API');
}

public function eraseCredentials() {

}

/** @see \Serializable::serialize() */
public function serialize() {
    return serialize(array(
        $this->id,
        $this->email,
            // see section on salt below
            // $this->salt,
    ));
}

/** @see \Serializable::unserialize() */
public function unserialize($serialized) {
    list (
            $this->id,
            $this->email,
            // see section on salt below
            // $this->salt
            ) = unserialize($serialized);
}

/**
 * Get id
 *
 * @return integer 
 */
public function getId() {
    return $this->id;
}

/**
 * Set parentId
 *
 * @param integer $parentId
 * @return Users
 */
public function setParentId($parentId) {
    $this->parentId = $parentId;

    return $this;
}

/**
 * Get parentId
 *
 * @return integer 
 */
public function getParentId() {
    return $this->parentId;
}

/**
 * Set firstName
 *
 * @param string $firstName
 * @return Users
 */
public function setFirstName($firstName) {
    $this->firstName = $firstName;

    return $this;
}

/**
 * Get firstName
 *
 * @return string 
 */
public function getFirstName() {
    return $this->firstName;
}

/**
 * Set lastName
 *
 * @param string $lastName
 * @return Users
 */
public function setLastName($lastName) {
    $this->lastName = $lastName;

    return $this;
}

/**
 * Get lastName
 *
 * @return string 
 */
public function getLastName() {
    return $this->lastName;
}

/**
 * Set userName
 *
 * @param string $userName
 * @return Users
 */
public function setUserName($userName) {
    $this->userName = $userName;

    return $this;
}

/**
 * Get userName
 *
 * @return string 
 */
public function getUserName() {
    return $this->email;
}

/**
 * Set regType
 *
 * @param string $regType
 * @return Users
 */
public function setRegType($regType) {
    $this->regType = $regType;

    return $this;
}

/**
 * Get regType
 *
 * @return string 
 */
public function getRegType() {
    return $this->regType;
}

/**
 * Set oauthUid
 *
 * @param string $oauthUid
 * @return Users
 */
public function setOauthUid($oauthUid) {
    $this->oauthUid = $oauthUid;

    return $this;
}

/**
 * Get oauthUid
 *
 * @return string 
 */
public function getOauthUid() {
    return $this->oauthUid;
}

/**
 * Set active
 *
 * @param boolean $active
 * @return Users
 */
public function setActive($active) {
    $this->active = $active;

    return $this;
}

/**
 * Get active
 *
 * @return boolean 
 */
public function getActive() {
    return $this->active;
}

/**
 * Set email
 *
 * @param string $email
 * @return Users
 */
public function setEmail($email) {
    $this->email = $email;

    return $this;
}

/**
 * Get email
 *
 * @return string 
 */
public function getEmail() {
    return $this->email;
}

/**
 * Set password
 *
 * @param string $password
 * @return Users
 */
public function setPassword($password) {
    $this->password = $password;

    return $this;
}

/**
 * Get password
 *
 * @return string 
 */
public function getPassword() {
    return $this->password;
}

/**
 * Set xmppPassword
 *
 * @param string $xmppPassword
 * @return Users
 */
public function setXmppPassword($xmppPassword) {
    $this->xmppPassword = $xmppPassword;

    return $this;
}

/**
 * Get xmppPassword
 *
 * @return string 
 */
public function getXmppPassword() {
    return $this->xmppPassword;
}

/**
 * Set createdAt
 *
 * @param \DateTime $createdAt
 * @return Users
 */
public function setCreatedAt($createdAt) {
    $this->createdAt = $createdAt;

    return $this;
}

/**
 * Get createdAt
 *
 * @return \DateTime 
 */
public function getCreatedAt() {
    return $this->createdAt;
}

/**
 * Set updatedAt
 *
 * @param \DateTime $updatedAt
 * @return Users
 */
public function setUpdatedAt($updatedAt) {
    $this->updatedAt = $updatedAt;

    return $this;
}

/**
 * Get updatedAt
 *
 * @return \DateTime 
 */
public function getUpdatedAt() {
    return $this->updatedAt;
}

/**
 * Set deletedAt
 *
 * @param \DateTime $deletedAt
 * @return Users
 */
public function setDeletedAt($deletedAt) {
    $this->deletedAt = $deletedAt;

    return $this;
}

/**
 * Get deletedAt
 *
 * @return \DateTime 
 */
public function getDeletedAt() {
    return $this->deletedAt;
}

/**
 * Set activationCode
 *
 * @param string $activationCode
 * @return Users
 */
public function setActivationCode($activationCode) {
    $this->activationCode = $activationCode;

    return $this;
}

/**
 * Get activationCode
 *
 * @return string 
 */
public function getActivationCode() {
    return $this->activationCode;
}

/**
 * Set userProfilePic
 *
 * @param string $userProfilePic
 * @return Users
 */
public function setUserProfilePic($userProfilePic) {
    $this->userProfilePic = $userProfilePic;

    return $this;
}

/**
 * Get userProfilePic
 *
 * @return string 
 */
public function getUserProfilePic() {
    return $this->userProfilePic;
}

/**
 * Set userTimelinePic
 *
 * @param string $userTimelinePic
 * @return Users
 */
public function setUserTimelinePic($userTimelinePic) {
    $this->userTimelinePic = $userTimelinePic;

    return $this;
}

/**
 * Get userTimelinePic
 *
 * @return string 
 */
public function getUserTimelinePic() {
    return $this->userTimelinePic;
}

/**
 * Set country
 *
 * @param string $country
 * @return Users
 */
public function setCountry($country) {
    $this->country = $country;

    return $this;
}

/**
 * Get country
 *
 * @return string 
 */
public function getCountry() {
    return $this->country;
}

/**
 * Set state
 *
 * @param string $state
 * @return Users
 */
public function setState($state) {
    $this->state = $state;

    return $this;
}

/**
 * Get state
 *
 * @return string 
 */
public function getState() {
    return $this->state;
}

/**
 * Set city
 *
 * @param string $city
 * @return Users
 */
public function setCity($city) {
    $this->city = $city;

    return $this;
}

/**
 * Get city
 *
 * @return string 
 */
public function getCity() {
    return $this->city;
}

/**
 * Set hobbies
 *
 * @param string $hobbies
 * @return Users
 */
public function setHobbies($hobbies) {
    $this->hobbies = $hobbies;

    return $this;
}

/**
 * Get hobbies
 *
 * @return string 
 */
public function getHobbies() {
    return $this->hobbies;
}

/**
 * Set interests
 *
 * @param string $interests
 * @return Users
 */
public function setInterests($interests) {
    $this->interests = $interests;

    return $this;
}

/**
 * Get interests
 *
 * @return string 
 */
public function getInterests() {
    return $this->interests;
}

/**
 * Set about
 *
 * @param string $about
 * @return Users
 */
public function setAbout($about) {
    $this->about = $about;

    return $this;
}

/**
 * Get about
 *
 * @return string 
 */
public function getAbout() {
    return $this->about;
}

/**
 * Set gender
 *
 * @param boolean $gender
 * @return Users
 */
public function setGender($gender) {
    $this->gender = $gender;

    return $this;
}

/**
 * Get gender
 *
 * @return boolean 
 */
public function getGender() {
    return $this->gender;
}

/**
 * Set dob
 *
 * @param \DateTime $dob
 * @return Users
 */
public function setDob($dob) {
    $this->dob = $dob;

    return $this;
}

/**
 * Get dob
 *
 * @return \DateTime 
 */
public function getDob() {
    return $this->dob;
}

/**
 * Set quickbloxId
 *
 * @param integer $quickbloxId
 * @return Users
 */
public function setQuickbloxId($quickbloxId) {
    $this->quickbloxId = $quickbloxId;

    return $this;
}

/**
 * Get quickbloxId
 *
 * @return integer 
 */
public function getQuickbloxId() {
    return $this->quickbloxId;
}

/**
 * Set privacy
 *
 * @param boolean $privacy
 * @return Users
 */
public function setPrivacy($privacy) {
    $this->privacy = $privacy;

    return $this;
}

/**
 * Get privacy
 *
 * @return boolean 
 */
public function getPrivacy() {
    return $this->privacy;
}

/**
 * Set school
 *
 * @param string $school
 * @return Users
 */
public function setSchool($school) {
    $this->school = $school;

    return $this;
}

/**
 * Get school
 *
 * @return string 
 */
public function getSchool() {
    return $this->school;
}

/**
 * Set college
 *
 * @param string $college
 * @return Users
 */
public function setCollege($college) {
    $this->college = $college;

    return $this;
}

/**
 * Get college
 *
 * @return string 
 */
public function getCollege() {
    return $this->college;
}

/**
 * Set work
 *
 * @param string $work
 * @return Users
 */
public function setWork($work) {
    $this->work = $work;

    return $this;
}

/**
 * Get work
 *
 * @return string 
 */
public function getWork() {
    return $this->work;
}

/**
 * Set relationshipStatus
 *
 * @param string $relationshipStatus
 * @return Users
 */
public function setRelationshipStatus($relationshipStatus) {
    $this->relationshipStatus = $relationshipStatus;

    return $this;
}

/**
 * Get relationshipStatus
 *
 * @return string 
 */
public function getRelationshipStatus() {
    return $this->relationshipStatus;
}

Source: (StackOverflow)

sylius:install: Warning: ini_set(): A session is active

I'm installing sylius-standard.

When i run the cmd: $ app/console sylius:install

Step 3 of 4. Shop configuration return this error:

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: ini_set(): A session is active. You cannot change the session modu
le's ini settings at this time

php.ini -> session.auto_start = 0

How can i fix this?

Thanks.


Source: (StackOverflow)

How do I integrate omnipay Sage Pay Server driver with Sylius? [closed]

I am currently looking to create a Sage Pay Server integration for my Sylius store and I have installed ("omnipay/sagepay": "~2.0") the Omnipay SagePay driver. There is currently a lack of documentation on the Sylius project regarding integrating other payment methods.

I am aware that the Payum bundle supports Omnipay Sage Pay and so Sylius should also, but there is some integration to be done.

My question is can someone outline the steps required for me to write the integration and any resources with similar implementations?

Thanks


Source: (StackOverflow)

How to add paypal pro (omnipay gateway) to sylius

I feel like I've read quite a few threads of people wanting help with adding a gateway, but I haven't seemed to find any solution that's been shared once the asker figured out the answer. I know there have been suggestions to look at the Payum Bundle docs too, but since I can't figure out how exactly Sylius is integrating with the Payum Bundle, I'm not able to receive much help from the payum docs. Would someone be able to help explain what is necessary to get PayPal Pro to work in the sylius app?

I've added this to the config file:

payum:
    contexts:
        paypal_pro:
            omnipay:
                type: PayPal_Pro
                options:
                    username:  %paypal.username%
                    password:  %paypal.password%
                    signature: %paypal.signature%
                    testMode:  %paypal.test_mode%
            storages:
                Sylius\Component\Core\Model\Order:
                    doctrine:
                        driver: orm
                Sylius\Component\Core\Model\Payment:
                    doctrine:
                        driver: orm

and this in my services.yml file:

sylius.payum.paypal.action.capture_payment_using_credit_card:
    class: %sylius.payum.paypal.action.capture_payment_using_credit_card.class%
    tags:
        - { name: payum.action, factory: omnipay }

For the CapturePaymentUsingCreditCardAction class, I just copied over Sylius's Stripe one. I thought this would be enough since Stripe was said to work out of the box as well. When I input the fake credit card information (we're in sandbox mode), I just get an "Unknown payment error" flash message after I'm redirected to the payment method selection page. From what I understand from reading this thread, the states are automatically managed by the state machine. I had added a PaymentStatusAction briefly (copied over from the Dummy class and var_dumping what the details held), but that didn't do anything to help.

Also, would someone be able to explain the need for ExecuteSameRequestWithDetailsAction? It looks almost the same as something like CapturePaymentUsingCreditCardAction.


Source: (StackOverflow)

Sylius Product Bundle configuration

I'm trying to integrate Sylius Product Bundle into my existing Symfony project. It already has doctrine configured.

This is the error I am getting:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]  
  The child node "driver" at path "sylius_attribute" must be configured. 

Any idea what's causing this? I followed the instruction right off the bat without doing any other installations of sylius.

http://docs.sylius.org/en/latest/bundles/SyliusProductBundle/installation.html

I had to change the doctrine-bundle version in my composer.json file to allow the

composer require "sylius/product-bundle"

to run successfully without errors. I changed the version from 1.2.* to

"doctrine/doctrine-bundle": "1.3.*"

Also after composer installed these guys, i added the following to my config.yml file

sylius_product:
    driver: doctrine/orm
    classes:
        product:
            model: Sylius\Bundle\CoreBundle\Model\Product
            controller: Sylius\Bundle\CoreBundle\Controller\ProductController
            repository: Sylius\Bundle\CoreBundle\Repository\ProductRepository

stof_doctrine_extensions:
    default_locale: es_us
    translation_fallback: true
    orm:
        default:
            tree: true

Initially I was getting the following error:

[Exception]                                                                                         
  Missing parameter sylius.translation.default.mapping. Default translation mapping must be defined! 

After a little searching around I added the piece below to the config.yml file

sylius_translation:
    default_mapping:
        translatable:
            field: translations
            currentLocale: currentLocale
            fallbackLocale: fallbackLocale
        translation:
            field: translatable
            locale: locale

Already existing earlier in my config.yml file was:

doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8       
    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true

I didn't change anything in these settings.

What am i doing wrong here or missing? ANy help will be greatly appreciated.

Thanks!


EDIT


I tried adding all the below items:

sylius_attribute:
    driver: doctrine/orm
sylius_variation:
    driver: doctrine/orm
sylius_archetype:
    driver: doctrine/orm

Now I get the following error:

[InvalidArgumentException]                                      
  The class sylius.model.product_archetype.class does not exist. 

I added the corresponding file to the AppKernel with still no luck!

new Sylius\Bundle\AttributeBundle\SyliusArchetypeBundle(),

and then changed it to:

new Sylius\Bundle\ArchetypeBundle\SyliusArchetypeBundle(),

Setting up Sylius has been quiet stressful so far :(


Source: (StackOverflow)

Error SyliusProductBundle

Excuse my English, but it is very, very, very bad.

I am installing Sylius as indicated here

http://docs.sylius.org/en/latest/bundles/SyliusProductBundle/installation.html

Install Sylius so

"sylius/product-bundle": "dev-master"

When trying to update database, shows me this error

FatalErrorException: Error: Class 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass'
not found in C:\wamp\www\Sylius\symfony\vendor\sylius\product-bundle\Sylius\Bundle\ProductBundle\SyliusProductBundle.php line 61

my AppKernel

$bundles = array(
            new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
            new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AN\WebBundle\ANWebBundle(),
        );

Run composer to update everything. After that I went back to try to update the database and the error was the same

I'm working with a new installation of Symfony 2.3.4

Help :(

EDIT:

Thank you very much for responding.

Indeed with what you indicate and I have not that error! if not I have another .... : (

InvalidArgumentException: There is no extension able to load the configuration for "stof_doctrine_extensions" (in C:\wamp\www\Sylius\symfony\app/config\config.yml). Looked for namespace "stof_doctrine_extensions", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "sylius_product", "sylius_resource", "doctrine", "sensio_framework_extra", "an_web", "raul_fraile_ladybug", "web_profiler", "sensio_distribution"

Search over this and told me that was to install the Bundle

https://github.com/stof/StofDoctrineExtensionsBundle/blob/master/Resources/doc/index.rst

installed ... and my config.yml so (this is the only thing that changes)

sylius_product:
    driver: doctrine/orm # Configure the doctrine orm driver used in the documentation.
#CHANGE
stof_doctrine_extensions:
    default_locale: es_us
    translation_fallback: true
    orm:
        default:
            tree: true

And now I have this other error: (

InvalidConfigurationException: The child node "classes" at path "sylius_product" must be configured.

thank you very much

Solution:

Replace and place in the config.yml

sylius_product:
    driver: doctrine/orm
    classes:
        product:
            model: Sylius\Bundle\CoreBundle\Model\Product
            controller: Sylius\Bundle\CoreBundle\Controller\ProductController
            repository: Sylius\Bundle\CoreBundle\Repository\ProductRepository
            form: Sylius\Bundle\CoreBundle\Form\Type\ProductType

Thank you very much @stloyd !!


Source: (StackOverflow)

Fixtures installation error in sylius?

I want to install fixtures in sylius i used below command to install it that are as below

php app/console sylius:install --fixtures

when i ran above command i get error as

>PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\sylius\vendor\symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51

PHP Stack trace:

PHP   1. {main}() C:\wamp\www\sylius\sylius\app\console:0
PHP   2. Symfony\Component\Console\Application->run() C:\wamp\www\sylius\sylius\app\console:28
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www\sylius\sylius\vendor\symfon
y\symfony\src\Symfony\Component\Console\Application.php:106
PHP   4. Symfony\Component\Console\Application->doRun() C:\wamp\www\sylius\sylius\vendor\symfony\symfony\src
\Symfony\Bundle\FrameworkBundle\Console\Application.php:78
PHP   5. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\sylius\vendor\symfony\symfony\s
rc\Symfony\Component\Console\Application.php:193
PHP   6. Sylius\Bundle\CoreBundle\Command\InstallCommand->execute() C:\wamp\www\sylius\sylius\vendor\symfony
\symfony\src\Symfony\Component\Console\Command\Command.php:242
PHP   7. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\sylius\src\Sylius\Bundle\CoreBu
ndle\Command\InstallCommand.php:80
PHP   8. Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() C:\wamp\www\syliu
s\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:242
PHP   9. Doctrine\Common\DataFixtures\Executor\ORMExecutor->execute() C:\wamp\www\sylius\sylius\vendor\doctr
ine\doctrine-fixtures-bundle\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php:106
PHP  10. Doctrine\ORM\EntityManager->transactional() C:\wamp\www\sylius\sylius\vendor\doctrine\data-fixtures
\lib\Doctrine\Common\DataFixtures\Executor\ORMExecutor.php:85
PHP  11. call_user_func() C:\wamp\www\sylius\sylius\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php:2
23
PHP  12. Doctrine\Common\DataFixtures\Executor\ORMExecutor->Doctrine\Common\DataFixtures\Executor\{closure}(
) C:\wamp\www\sylius\sylius\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php:223
PHP  13. Doctrine\Common\DataFixtures\Executor\AbstractExecutor->load() C:\wamp\www\sylius\sylius\vendor\doc
trine\data-fixtures\lib\Doctrine\Common\DataFixtures\Executor\ORMExecutor.php:83
PHP  14. Sylius\Bundle\CoreBundle\DataFixtures\ORM\LoadCountriesData->load() C:\wamp\www\sylius\sylius\vendo
r\doctrine\data-fixtures\lib\Doctrine\Common\DataFixtures\Executor\AbstractExecutor.php:120
PHP  15. Symfony\Component\Locale\Locale::getDisplayCountries() C:\wamp\www\sylius\sylius\src\Sylius\Bundle\
CoreBundle\DataFixtures\ORM\LoadCountriesData.php:31

I try to install resource bundle when i got the above error but it also failed to install.

Is there any other way is avilable to install fixtures in sylius?

Please share some knowledge..Thanks in advance.


Source: (StackOverflow)