Several theme loading views problem

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 15:17

It seems it always takes these middle components from this new-theme-sk. So when I change to new-theme-sk it is fine, but when I come back to new-theme, the middle components is taken from new-theme-sk

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 15:47

I use aimeos/aimeos-laravel version 2021.07.6

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 16:32

I analyzed the topic and I can see that Aimeos always takes the last theme it found and if there is an expected file in client/html/templates, it takes it, no matter what theme is selected in the shop. In the case of the sk shop it works fine because new-theme-sk is the last theme and takes files from packages/new-theme-sk/client/html/templates from there. The choice of the theme in the store is doesn't matter in this case.

It only gets the appropriate files from the packages/new-theme/views and packages/new-theme-sk/views directories. In the case of packages/new-theme/client/html/templates and packages/new-theme-sk/client/html/templates no longer get the proper.

Maybe if I add files to /client/html/templates, I should add them to option / value table for site ?

cyberdev
Posts: 14
Joined: 06 May 2022, 09:10

Re: Several theme loading views problem

Post by cyberdev » 12 May 2022, 16:47

Just now i checked aimeos app aimeos: dev-master+ aimeos:04.2022 installed more than 12 different theme extenstion for different side/code which using different layout even there own config.. and all working as to be, without clear cache or optimize something,may use artisan optimize:clear or delete the data cache in laravel app stroge.

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 16:52

@cyberdev you try install aimeos/aimeos-laravel version 2021.07.6 and use several themes

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 17:56

My config/shop.php

Code: Select all

<?php

return [

    'apc_enabled' => false, // enable for maximum performance if APCu is availalbe
    'apc_prefix' => 'laravel:', // prefix for caching config and translation in APCu
    'pcntl_max' => 4, // maximum number of parallel command line processes when starting jobs


    'routes' => [
        'jsonapi' => ['prefix' => '{site}/jsonapi', 'middleware' => ['web', 'api']],
        'account' => ['prefix' => '{site}/profile', 'middleware' => ['web', 'auth']],
        'default' => ['prefix' => '{site}/shop', 'middleware' => ['web']]
    ],


    'page' => [
        // Docs: https://aimeos.org/docs/Laravel/Adapt_pages
        // Hint: catalog/filter is also available as single 'catalog/search', 'catalog/tree', 'catalog/price', 'catalog/supplier' and 'catalog/attribute'
        'account-index' => ['account/profile', 'account/review', 'account/subscription', 'account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'],
        'basket-index' => ['basket/bulk', 'basket/standard', 'basket/related'],
        'catalog-count' => ['catalog/count'],
        'catalog-detail' => ['basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'],
        'catalog-home' => ['basket/mini', 'catalog/search', 'catalog/tree', 'catalog/home'],
        'catalog-list' => ['basket/mini', 'catalog/filter', 'catalog/lists'],
        'catalog-stock' => ['catalog/stock'],
        'catalog-suggest' => ['catalog/suggest'],
        'catalog-tree' => ['basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'],
        'checkout-confirm' => ['checkout/confirm'],
        'checkout-index' => ['checkout/standard'],
        'checkout-update' => ['checkout/update'],
        'supplier-detail' => ['basket/mini', 'supplier/detail', 'catalog/lists'],
    ],
    
    'client' => [
        'html' => [
            'checkout' => [
                'confirm' => [
                    'order' => [
                        'decorators' => [
                            'global' => ['ConfirmOrderDecorator']
                        ],
                    ],
                    'decorators' => [
                        'global' => ['ConfirmDecorator']
                     ],
                ],
                'standard' => [
                    'onepage' => ['summary', 'delivery', 'payment'],
                    'address' => [
                        'billing' => [
                            'name' => 'Billing',
                            'salutations' => [
                                '',
                                'company'
                            ],
                            'disable-new' => false,
                            'mandatory' => [
                                'order.base.address.firstname',
                                'order.base.address.lastname',
                                'order.base.address.address1',
                                'order.base.address.address2',
                                'order.base.address.postal',
                                'order.base.address.city',
                                //'order.base.address.languageid',
                                'order.base.address.telephone',
                                'order.base.address.tel_prefix',
                                'order.base.address.email',
                                'order.base.regulations',
                            ],
                            'optional' => [
                                'order.base.address.salutation',
                                'order.base.address.company',
                                'order.base.address.vatid',
                                'order.base.address.address3',
                                'order.base.address.countryid',
                            ]
                        ],
                        'delivery' => [
                            'name' => 'Delivery',
                            'salutations' => [
                                '',
                                'company'
                            ],
                            'mandatory' => [
                                'order.base.address.firstname',
                                'order.base.address.lastname',
                                'order.base.address.address1',
                                'order.base.address.address2',
                                'order.base.address.postal',
                                'order.base.address.city',
                                //'order.base.address.languageid',
                                'order.base.address.telephone',
                                'order.base.address.tel_prefix',
                            ],
                            'optional' => [
                                'order.base.address.address3',
                                'order.base.address.countryid',
                            ]
                        ],
                        'payment' => [
                            'optional' => [
                                'order.base.address.city',
                                'order.base.address.countryid',
                            ]
                        ],
                        'validate' => [
                            'company' => '^\S$|^\S[\s\S]*\S$',
                            'vatid' => '^PL[0-9]{10}$',
                            'email' => '^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$',
                            'firstname' => '^([A-zÀ-žа-яА-Я\s-]){1,}$',
                            'lastname' => '^([A-zÀ-žа-яА-Я\s-]){1,}$',
                            'address1' => '^\S$|^\S[\s\S]*\S$',
                            'address2' => '^\S$|^\S[\s\S]*\S$',
//                            'address3' => '/^(\s*|\d+)$',
                            'tel_prefix' => '^\S$|^\S[\s\S]*\S$',
                            'telephone' => '^[0-9]{9}$',
                            'postal' => '^[0-9]{2}[-][0-9]{3}$',
                            'city' => '^([A-zÀ-žа-яА-Я\s-]){1,}$',
                        ],
                        'countries' => [
                            'PL',
                        ],
                        'telprefixes' => [
                            '+359',
                            '+420',
                            '+49',
                            '+372',
                            '+385',
                            '+371',
                            '+370',
                            '+36',
                            '+43',
                            '+48',
                            '+40',
                            '+386',
                            '+421',
                            '+30',
                            '+373',
                            '+7',
                            '+381',
                            '+380',
                            '+44',
                        ],
                    ],
                    'delivery' => [
                        'decorators' => [
                            'global' => ['DeliveryOptionsDecorator']
                        ],
                    ],
                    'process' => [
                    ],
                ],
                'subparts' => [
                    'summary', 'delivery', 'payment', 'address', 'process'
                ],

            ],
            'basket' => [
                'cache' => [
                    'enable' => false, // Disable basket content caching for development
                ],
                'standard' => [
                    'decorators' => [
                        'global' => ['BasketDecorator']
                    ],
                ],
            ],
            'common' => [
                'template' => [
                ],
                'address' => [
                    'salutations' => [
                        '',
                        'company'
                    ],
                ],
            ],
        ],
    ],
    'controller' => [
        'jobs' => [
            'frontend' => [

            ]
        ],
        'backend' => [
        ],
        'frontend' => [
            'basket' => [
                'limit-count' => 1,
                'limit-seconds' => 3,
                'name ' => 'Standardff'
            ],
        ],
    ],

    'i18n' => [
        'pl' => [
            'client' => [
                'Billing address part "%1$s" is missing' => ['Pole "%1$s" jest wymagane'],
                'Billing address part "%1$s" is invalid' => ['Niepoprawna wartość w polu "%1$s"'],
                'Delivery address part "%1$s" is missing' => ['Pole "%1$s" jest wymagane'],
                'Delivery address part "%1$s" is invalid' => ['Niepoprawna wartość w polu "%1$s"'],
                'Not a date' => ['Błędna data'],
                'Configuration for "date.value" is missing' => ['Pole "data wysyłki" jest wymagane'],
                'Configuration for "time.hourminute" is missing' => ['Pole "godzina" jest wymagane'],
                'Invalid service attributes' => ['Nieprawidłowe dane'],
                'prefix' => ['prefix'],
                'client_type' => ['rodzaj klienta'],
                'country' => ['kraj'],
                'vatid' => ['NIP'],
                'postal' => ['kod pocztowy'],
                'Delivery service is required' => ['Należy wybrać sposób dostawy'],
                'Delivery service is bad' => ['Nieprawidłowa forma dostawy'],
                'Date value before "%1$s"' => ['Data powinna być nie starsza niż "%1$s"'],
                'The date can be a maximum of %1$s days from today' => ['Data może być maksymalnie do %1$s dni od dziś'],
                'Invalid parcel locker' => ['Nieprawidłowy paczkomat'],
            ],
        ],
    ],

    'mshop' => [
        'locale' => [
            //'site' => 'pl', // used instead of "default"
        ]
    ],


    'command' => [
    ],

    'frontend' => [
    ],

    'backend' => [
    ],

    'madmin' => [
        'cache' => [
            'manager' => [
                'name' => 'None', // Disable caching for development
            ],
        ],
        'log' => [
            'manager' => [
                //'loglevel' => 7, // Enable debug logging into madmin_log table
            ],
        ],
    ],

];

cyberdev
Posts: 14
Joined: 06 May 2022, 09:10

Re: Several theme loading views problem

Post by cyberdev » 12 May 2022, 18:52

Firstly deb where your template load from on applying different theme extenstion 🥺 or change the basic.blade.php to Anonymous Blade Components as well all related view templates in your extenstion . the best to hear from aimeos.

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 20:31

My packages/new-theme/views/base.blade.php

Code: Select all

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="container main-container">
    @yield('aimeos_body')
</div>
</body>
</html>
In @yield('aimeos_body') data is loaded from new-theme-sk/client/html/templates instead of new-theme/client/html/templates but base.blade.php itself loads from a good theme.

My packages/new-theme-sk/views/base.blade.php is the same as packages/new-theme/views/base.blade.php

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 12 May 2022, 21:03

For eaxmple in

Code: Select all

packages\new-theme\views\catalog\detail.blade.php
is

Code: Select all

@section('aimeos_body')
    <div class="container-xl">
        <?= $aibody['catalog/detail'] ?? '' ?>
    </div>
@stop
$aibody['catalog/detail'] contains data from packages\new-theme-sk\client\html\templates\catalog\detail\body-standard.blade.php

krzysiekp
Posts: 85
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 13 May 2022, 07:12

@Aimeos please help what could be wrong ?

Maybe there are some extra settings that I don't set?
My friend has the same error

Post Reply