GithubHelp home page GithubHelp logo

ai-controller-frontend's Introduction

Aimeos logo

Aimeos frontend controller

Build Status Coverage Status Scrutinizer Code Quality License

Aimeos frontend controller package for e-commerce projects

Aimeos demo

ai-controller-frontend's People

Contributors

aimeos avatar lgeorget avatar niloofarfs avatar nvindice avatar scrutinizer-auto-fixer avatar zherdev-artem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ai-controller-frontend's Issues

Default sorting of products

According to the documentation, the default sorting for products jsonapi is according to their positioning in the catalog.

This does not work properly without specifying a category with f_catid.

Either the documentation should warn about this, or the default behaviour should be changed to reflect the documentation, ie. by default sorting by the root catalogs positions.

Another issue is that the relevance sorting option cannot be combined with other sorting options.

For example sort=text,-ctime can create a primary and secondary sort criteria, but relevance cannot be used in this way.
For example the combination sort=relevance,-ctime&filter[f_catid]=1 does not work the same way as the previous example since the "relevance sorting" is applied after the ctime sorting.

If PRs are wanted I can probably fix this so that "relevance" is an actual sorting option that can be combined with other options, and is actually applied as deafult.

Relevant code:

// controller/frontend/src/Controller/Frontend/Product/Standard.php
public function sort( string $key = null ) : Iface
	{
		$list = $this->splitKeys( $key );

		foreach( $list as $sortkey )
		{
			$direction = ( $sortkey[0] === '-' ? '-' : '+' );
			$sortkey = ltrim( $sortkey, '+-' );

			switch( $sortkey )
			{
				case 'relevance':      //  <---------------- Not actually a sort option, default sort implemented in category function only if cateogry filter is used
					break;

				case 'code':
					$this->addExpression( $this->filter->sort( $direction, 'product.code' ) );
					break;

				case 'ctime':
					$this->addExpression( $this->filter->sort( $direction, 'product.ctime' ) );
					break;
                               ...
                        }
              }
}
// controller/frontend/src/Controller/Frontend/Product/Standard.php
public function category( $catIds, string $listtype = 'default', int $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) : Iface
{
	if( !empty( $catIds ) && ( $ids = $this->validateIds( (array) $catIds ) ) !== [] )   // <------------------- Is only applied if f_catid is specified, but should according to docs be the default
	{
		if( $level != \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )
		{
			$list = map();
			$cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'catalog' );
				foreach( $ids as $catId ) {
				$list->union( $cntl->root( $catId )->getTree( $level )->toList() );
			}
				$ids = $this->validateIds( $list->keys()->toArray() );
		}
			$func = $this->filter->make( 'index.catalog:position', [$listtype, $ids] );
			$this->addExpression( $this->filter->compare( '==', 'index.catalog.id', $ids ) );
		$this->addExpression( $this->filter->compare( '>=', $func, 0 ) );
			$func = $this->filter->make( 'sort:index.catalog:position', [$listtype, $ids] );
		$this->addExpression( $this->filter->sort( '+', $func ) );
		$this->addExpression( $this->filter->sort( '+', 'product.id' ) ); // prevent flaky order if products have same position
	}
		return $this;
}

New Tag 2022.10.8 missing on packagist

Hey, thanks for providing security updates.
We wanted to fix GHSA-m9gv-6p22-qgmj by updating our installation to 2022.10.8, but this doesn't show up on packagist yet.

I'm confused as the tag and commits are from last month, accordingly to GitHub web ui.

The error seems to exist for other tags and branches as well. Maybe there is something broken in auto updating packagist for this package?

Filter by price products with type selection issue

I have product with type "selection" which has no price itself, but has variant with price $100. When I try to apply filtering by price this product doesn't display in results (I tried in default theme and using jsonapi).

Checkout process didn't have delivery / Payment services

Environment

  1. Version (e.g. de-master)
  2. Operating system (Linux, Mac, Windows)

Checkout didn't have any delivery/payment service, even though applying aimeos:setup clear etc as well with demo data but didn't succeed. all the services are presented in admin as well in database.

Checkout shows error: ‘Service “delivery” already in basket’

After an update of the ai-controller-frontend from 6510433 to 8183c0c (because of CVE-2024-39325) we experience issues in the checkout process.

Once a user picks his/her delivery method, the error message 'Service “delivery” already in basket' appears. The user cannot continue the checkout process.

We reverted the update for now and will investigate whether it is something special with our custom installation. In case other people experience the same issue, please let me know.

We are on aimeos/aimeos-typo3 b0e92f22, so I guess our installation is pretty old.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.