sonata-project / ecommerce

[Abandoned] E-Commerce solution provided by Sonata
https://sonata-project.org
MIT License
164 stars 139 forks source link

Installation Problem in files #12

Closed KunwarSiddharthSingh closed 10 years ago

KunwarSiddharthSingh commented 10 years ago

First ! Many thanks for your great work...!

When I run the easy-extends:generate commands as show in doc http://sonata-project.org/bundles/ecommerce/master/doc/reference/installation.html

show me error in file SonataDeliveryExtension.php line 49

ContextErrorException: Notice: Undefined index: services in /var/www/xyz.com/vendor/sonata-project/ecommerce/src/Sonata/DeliveryBundle/DependencyInjection/SonataDeliveryExtension.php line 49

And when I comment SonataDeliveryBundle in AppKernal.php file then this error show me in file SonataPaymentExtension.php.

ContextErrorException: Notice: Undefined index: services in /var/www/xyz.com/vendor/sonata-project/ecommerce/src/Sonata/PaymentBundle/DependencyInjection/SonataPaymentExtension.php line 52

And again I comment SonataPaymentBundle in AppKernal.php file then this error show me:

ServiceNotFoundException: The service "sonata.customer.admin.customer" has a dependency on a non-existent service "sonata.price.currency.detector".

Again commented SonataCustomerBundle then:

ParameterNotFoundException: The service "sonata.basket.form.type.address" has a dependency on a non-existent parameter "sonata.customer.address.class". Did you mean this: "sonata.customer.selector.class"?

Again commented SonataBasketBundle then:

The service "sonata.product.block.recent_products" has a dependency on a non-existent service "sonata.price.currency.detector".

then commented SonataProductBundle:

 ServiceNotFoundException: The service "sonata.order.block.recent_orders" has a dependency on a non-existent service "sonata.customer.manager"

then commented SonataOrderBundle:

ServiceNotFoundException: The service "sonata.invoice.admin.invoice" has a dependency on a non-existent service "sonata.price.currency.detector"

And last commented SonataInvoiceBundle.

And No error ;)

Bladrak commented 10 years ago

Just to be sure, are you using the sonata demo or are you adding the ecommerce bundles?

In the first case, please follow this tutorial: http://sonata-project.org/bundles/ecommerce/master/doc/reference/tutorials/install.html.

I think the Manual Install part of the documentation is outdated. We're in the process of updating it.

Bladrak commented 10 years ago

Regarding the Manual Install, you'll need to add new Sonata\PriceBundle\SonataPriceBundle() to your AppKernel (it's missing in the documentation, I'm adding it).

KunwarSiddharthSingh commented 10 years ago

I am using Manual Installation. So how I can follow this http://sonata-project.org/bundles/ecommerce/master/doc/reference/tutorials/install.html. ?

I want this system to add my project.

Bladrak commented 10 years ago

I think you should be fine by adding simply the line I gave you in https://github.com/sonata-project/ecommerce/issues/12#issuecomment-30312063 ; you can then keep on with the manual installation part as you were doing before.

The tutorial is designed to be followed while creating a new project ; might be good to discover the solution, but not to add it to an existing project.

KunwarSiddharthSingh commented 10 years ago

I am creating new project itself not able to install it properly ?

I was add this line to AppKernel new Sonata\PriceBundle\SonataPriceBundle() file but same error:

ContextErrorException: Notice: Undefined index: services in /var/www/xyz.com/vendor/sonata-project/ecommerce/src/Sonata/DeliveryBundle/DependencyInjection/SonataDeliveryExtension.php line 49
Bladrak commented 10 years ago

Ok, so there's another issue in the documentation: you actually need to edit the configuration prior to using the easy:extends commands. I'll fix the doc as well.

KunwarSiddharthSingh commented 10 years ago

I can do this in config.yml:

sonata_delivery:
services:
     sonata.delivery.method.free_address_required:
        name: Free
        enabled: true
        priority: 1

selector: sonata.delivery.method.free_address_required

but show me error:

InvalidConfigurationException: Unrecognized options "sonata.delivery.method.free_address_required" under "sonata_delivery.services"
KunwarSiddharthSingh commented 10 years ago

May be in doc config.yml file is wrong ?

        sonata_user:
        #... Your conf
        profile:
            menu:
                - { route: 'sonata_user_profile_edit', label: 'link_edit_profile', domain: 'SonataUserBundle'}
                - { route: 'sonata_user_profile_edit_authentication', label: 'link_edit_authentication', domain: 'SonataUserBundle'}
                - { route: 'sonata_order_index', label: 'order_list', domain: 'SonataOrderBundle'}

    sonata_delivery:
        services:
            sonata.delivery.method.free_address_required:
                name: Free
                enabled: true
                priority: 1

        selector: sonata.delivery.method.free_address_required

    sonata_payment:
        services:
            sonata.payment.method.paypal:
                name:     Paypal
                id:       paypal
                enabled:  true

                transformers:
                    basket: sonata.payment.transformer.basket
                    order:  sonata.payment.transformer.order

                options:
                    web_connector_name: curl

                    account:            your_paypal_account@fake.com
                    cert_id:            fake
                    paypal_cert_file:   %kernel.root_dir%/paypal_cert_pem_sandbox.txt
                    url_action:         https://www.sandbox.paypal.com/cgi-bin/webscr

                    debug: true
                    class_order:        Application\Sonata\OrderBundle\Entity\Order
                    url_callback:       sonata_payment_callback
                    url_return_ko:      sonata_payment_error
                    url_return_ok:      sonata_payment_confirmation

                    method:             encryptViaBuffer # encryptViaFile || encryptViaBuffer

                    key_file:           %kernel.root_dir%/my-prvkey.pem
                    cert_file:          %kernel.root_dir%/my-pubcert.pem

                    openssl:            /opt/local/bin/openssl

        selector: sonata.payment.selector.simple

        generator: sonata.payment.generator.mysql

        transformers:
            order:  sonata.payment.transformer.order
            basket: sonata.payment.transformer.basket

So how can I fix this ?

Bladrak commented 10 years ago

Try this for the config:

sonata_delivery:
    services:
        free_address_required:
            name: Free
            enabled: true
            priority: 1
            code: free

    selector: sonata.delivery.selector.default
KunwarSiddharthSingh commented 10 years ago

Many thanks . Full configuration is completed... :)

KunwarSiddharthSingh commented 10 years ago

Installation Completed. But When I run my project in url "admin/" show me this:

An exception has been thrown during the rendering of a template ("[ERROR 522] Validation failed: no DTD found ! (in n/a - line 2, column 21) [ERROR 1877] Element '{urn:oasis:names:tc:xliff:document:1.2}trans-unit': Duplicate key-sequence ['sonata.invoice.references.date'] in key identity-constraint '{urn:oasis:names:tc:xliff:document:1.2}K_unit_id'. (in /var/www/xyz.com/web/ - line 172, column 0)") in SonataUserBundle:Admin:Security/login.html.twig at line 14.

Do you know this problem ?

KunwarSiddharthSingh commented 10 years ago

Fixed. :)