using selected lang and currency for custom 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!
User avatar
bilginkilic
Posts: 34
Joined: 05 Jul 2020, 07:08

using selected lang and currency for custom page

Post by bilginkilic » 18 Aug 2020, 13:54

how can we use aimeos framework capability of language support ( lang dictionary) on custom pages
@bilginkilic_ (twitter)

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

Re: using selected lang and currency for custom page

Post by aimeos » 19 Aug 2020, 07:37

Do you mean using translations? If yes, there's an aitranslate() view helper:
https://aimeos.org/docs/Laravel/Use_Bla ... figuration
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
bilginkilic
Posts: 34
Joined: 05 Jul 2020, 07:08

Re: using selected lang and currency for custom page

Post by bilginkilic » 26 Aug 2020, 07:50

https://prnt.sc/u61aud

We have designed something like this custom page. Product method can get language and currency parameters? or how can we use globalization features of aimeos? You may see our custom home page here: https://paltoru2.tulparstudyo.net/ You may see when we change language it does not affect our custom page but listing page.

Code: Select all

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use \Aimeos\Shop\Facades\Product;
use \Aimeos\Shop\Facades\Catalog;

use Aimeos\Shop\Facades\Shop;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Response;

class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        // $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */

    public function index()
    {
    

        $items = Product::uses(['text', 'media', 'price','name'])
                //filter
                // ->compare('==', 'product.code', 'demo-selection-article-1')
                ->compare('==', 'product.siteid', '1.')
                //category
                ->category([7])
                //sorting
                ->sort('name')
                //limitation
                ->slice(0, 8)->search();
                // p($items);
         $items2 = Product::uses(['text', 'media', 'price','name'])
                //filter
                // ->compare('==', 'product.code', 'demo-selection-article-1')
                ->compare('==', 'product.siteid', '1.')
                //category
                ->category([8])
                //sorting
                ->sort('name')
                //limitation
                ->slice(0, 8)->search();
                


        $response['featured_products'] = parseProductData($items);
        $response['recommended_products'] = parseProductData($items2);
        // p($response);
        foreach( app( 'config' )->get( 'shop.page.mypage' ) as $name )
          {
            $params['aiheader'][$name] = Shop::get( $name )->getHeader();
            $params['aibody'][$name] = Shop::get( $name )->getBody();
          }
          // p($params);
        // return view('home')->with($params);
          return Response::view( 'home', array_merge($response,$params))->header( 'Cache-Control', 'no-store' );
        // $params = array();
        // foreach( app( 'config' )->get( 'shop.page.home' ) as $name )
        // {
        //    // $params['aiheader'][$name] = Shop::get( $name )->getHeader();
        //    // $params['aibody'][$name] = Shop::get( $name )->getBody();
        // }

        // return Response::view( 'home', $params )->header( 'Cache-Control', 'no-store' );
    }


    public function customAction()
    {


          foreach( app( 'config' )->get( 'shop.page.mypage' ) as $name )
          {
            $params['aiheader'][$name] = Shop::get( $name )->getHeader();
            $params['aibody'][$name] = Shop::get( $name )->getBody();
          }

         p($params);
    }




}
@bilginkilic_ (twitter)

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

Re: using selected lang and currency for custom page

Post by aimeos » 27 Aug 2020, 09:27

The language/currency paramters passed in the URL are used. If there are none, the first locale combination in the Local panel is used.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply