Page 1 of 1

Hide all products in 'list' page

Posted: 30 Oct 2017, 14:24
by tkristis
Environment - Linux,
PHP - 7.0.22,
Aimeos - 2017.07,
Laravel - 5.5.19.

I want to hide all products which are in 'list' page and leave just search bar with categories.
Like I understand I need to work with config/shop.php file, but I can't find information how to achieve that what i want.
Any help?

Re: Hide all products in 'list' page

Posted: 30 Oct 2017, 14:38
by aimeos
Simply remove the "catalog/lists" part from the page you want this to happen:
https://github.com/aimeos/aimeos-larave ... op.php#L21

Most probably you want to create a new page. Then, please have a look into these articles:
https://aimeos.org/docs/Laravel#Pages

Re: Hide all products in 'list' page

Posted: 30 Oct 2017, 14:54
by tkristis
But if I delete 'catalog/lists' then all products be hidden, even if I open any category.
I want to hide all products just from landing list page, but keep it in categories.
So if I want to do this I need to create a new page or there is another way?

Re: Hide all products in 'list' page

Posted: 30 Oct 2017, 14:57
by aimeos
Best is to create a new page for this.
An alternative would be to configure a default category ID of a category that has no products:
https://aimeos.org/docs/Configuration/C ... id-default

Re: Hide all products in 'list' page

Posted: 02 Nov 2017, 12:18
by tkristis
I created controller ProductsController.php

Code: Select all

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProductsController extends Controller
{
    public function index()
    {
    	$params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'index' );
        // do some more stuff
        return \View::make('index', $params);
    }
}
config/shop.php

Code: Select all

'index' => [ 'catalog/filter' ]
index.blade.view

Code: Select all

@extends('app')

@section('content')
    <?= $aibody['catalog/filter'] ?>
@endsection
Route

Code: Select all

Route::get('products', 'ProductsController@index');
So far everything works fine, but page don't have Aimeos css styling and js.
Also categories not showing how many products in it.
Could you help me with that?

Re: Hide all products in 'list' page

Posted: 02 Nov 2017, 22:38
by aimeos
Change your Blade template to this:

Code: Select all

@extends('base')

@section('aimeos_header')
    <?= $aiheader['catalog/filter'] ?>
@stop

@section('aimeos_nav')
    <?= $aibody['catalog/filter'] ?>
@endsection
The aimeos_header will contain the tags for retrieving the product counts and extending from "base" template will add you Aimeos CSS and JS: https://github.com/aimeos/aimeos-larave ... .blade.php

Re: Hide all products in 'list' page

Posted: 03 Nov 2017, 13:29
by tkristis
Thank you, now it shows how many products in each category.
But problem is that base template can't be found.

Maybe it's because I created index.blade.php template in app/resources/views?
But it must be in app/ vendor/aimeos/aimeos-laravel/src/views ?

Re: Hide all products in 'list' page

Posted: 05 Nov 2017, 11:42
by aimeos
That might be the case. Please have a look into the Laravel documentation how it exactly works.