Hide all products in 'list' page

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!
tkristis
Posts: 12
Joined: 19 Oct 2017, 12:18

Hide all products in 'list' page

Post by tkristis » 30 Oct 2017, 14:24

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Hide all products in 'list' page

Post by aimeos » 30 Oct 2017, 14:38

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tkristis
Posts: 12
Joined: 19 Oct 2017, 12:18

Re: Hide all products in 'list' page

Post by tkristis » 30 Oct 2017, 14:54

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Hide all products in 'list' page

Post by aimeos » 30 Oct 2017, 14:57

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tkristis
Posts: 12
Joined: 19 Oct 2017, 12:18

Re: Hide all products in 'list' page

Post by tkristis » 02 Nov 2017, 12:18

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Hide all products in 'list' page

Post by aimeos » 02 Nov 2017, 22:38

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tkristis
Posts: 12
Joined: 19 Oct 2017, 12:18

Re: Hide all products in 'list' page

Post by tkristis » 03 Nov 2017, 13:29

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 ?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Hide all products in 'list' page

Post by aimeos » 05 Nov 2017, 11:42

That might be the case. Please have a look into the Laravel documentation how it exactly works.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply