简体   繁体   中英

Orocommerce bundle theme not found on build or admin webpanel

I have multiple failed intent to create a bundle without successfully result.

First I install orocommerce like information on https://doc.oroinc.com/4.1/backend/setup/dev-environment/ (fork project on https://github.com/juankav89/orocommerce-application , execute composer install --prefer-dist and php bin/console oro:install --env=prod --timeout=2000

Next one I create bundle folders and files and when try to activate a bundle, show me next result (first excecute clear cache command and next excecute php bin/console oro:assets:build bogota ):



Building assets.
'/usr/local/bin/node' './node_modules/webpack/bin/webpack.js' '--hide-modules' '--env.theme=my_theme' '--env.stats=' '--env.symfony=dev' '--colors'
/home/juan/atlantictSoft/orocommerce/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

Error: Theme "my_theme" doesn't exists. Existing themes:admin.demo, admin.oro, blank, embedded_default, default, custom, view-switcher

When I try to install a bundle (with php bin/console oro:assets:install command), not show me errors, but not include bundle on php bin/console debug:container --parameter=kernel.bundles --format=json result.

Next I include structure of my bundle:

orocommerce
...
├── src
│   ├── AppCache.php
│   ├── AppKernel.php
│   ├── Bogota
│   │   └── Bundle
│   │       └── NewBundle
│   │           ├── BogotaNewBundle.php
│   │           └── Resources
│   │               └── config
│   │                   └── oro
│   │                       └── bundles.yml
│   ├── MedellinBundle
│   │   └── Resources
│   │       ├── public
│   │       │   └── images
│   │       │       ├── descarga.png:Zone.Identifier
│   │       │       └── logo.png
│   │       └── views
│   │           └── layouts
│   │               └── first_theme
│   │                   └── theme.yml
│   └── teste
│       └── Bundle
│           └── TesteBundle
│               ├── Resources
│               │   ├── config
│               │   │   └── teste
│               │   │       ├── bundles.yml
│               │   │       └── bundles.yml:Zone.Identifier
│               │   ├── public
│               │   │   └── theme
│               │   │       ├── favicons
│               │   │       │   ├── favicon.ico
│               │   │       │   └── favicon.ico:Zone.Identifier
│               │   │       ├── images
│               │   │       │   ├── logo.svg
│               │   │       │   └── logo.svg:Zone.Identifier
│               │   │       └── scss
│               │   │           ├── components
│               │   │           │   ├── top-bar.scss
│               │   │           │   └── top-bar.scss:Zone.Identifier
│               │   │           ├── settings
│               │   │           │   ├── _colors.scss
│               │   │           │   ├── _colors.scss:Zone.Identifier
│               │   │           ├── styles.scss
│               │   │           ├── styles.scss:Zone.Identifier
│               │   │           └── variables
│               │   │               ├── top-bar-config.scss
│               │   │               └── top-bar-config.scss:Zone.Identifier
│               │   └── views
│               │       └── layouts
│               │           └── theme
│               │               ├── config
│               │               │   ├── assets.yml
│               │               │   └── assets.yml:Zone.Identifier
│               │               ├── theme.yml
│               │               └── theme.

I Verify that namespaces and names of files does correctly definition; ex Bogota Bundle :

src/Bogota/Bundle/NewBundle/Resources/config/oro/bundles.yml

bundles:
    - Bogota\Bundle\NewBundle\BogotaNewBundle

src/Bogota/Bundle/NewBundle/BogotaNewBundle.php

<?php
namespace Bogota\Bundle\NewBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class BogotaNewBundle extends Bundle
{
}

Finally I try to check "http://localhost/app_dev.php/" but return 4040 and **http://localhost/admin/config/system on Configuration->Commerce->Desing->Theme ** but not show custom bundles

Please note that only correct bundle definition in the provided structure is BogotaNewBundle . The definitions done in it are correct and it will register bundle in application succesfully.

MedellinBundle item is not a Symfony bundle and as for Oro's theme it relies on a bundle and must be defined inside of it.


It's recommended to learn next https://doc.oroinc.com/master/frontend/storefront/quick-start article's content a bit precisely and then all other topics in https://doc.oroinc.com/master/frontend/storefront


Here's a link to simple working bundle's archive with proper theme definitions.

!!!Note src/Bogota/Bundle/NewBundle/Resources/views/layouts/first_theme folder. first_theme is the theme's name and it must be used with php bin/console oro:assets:build command if you want to run build only for it. Also this command expects assets to be installed into public folder with php bin/console oro:assets:install command before. Running oro:assets:install includes build routines.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM