Aimeos 2020.07 release

Aimeos 2020.07 release

The new Aimeos feature release contains some long-awaited new stuff for developers and customers alike. What you get by using the 2020.07 release among various minor improvements and bugfixes is:

  • PDF invoice in order confirmation e-mail
  • Supplier CSV import
  • Improved admin backend for mobile phones
  • Better full text search and URL segments
  • Official TYPO3 10 support
  • Simplified manager and criteria filter methods

PDF invoice in confirmation e-mail

PDF invoice example

One of the most often requested features is now part of the Aimeos core: A nice looking template which can be easily adapted to the clients requirements and corporate design. The full source code for the invoice PDFs was contributed by the Aimeos GmbH.

The PDF document is generated from a HTML template and automatically attached to the e-mails sent to customers when the order has been paid. You can change the content and the layout of the PDF by adapting the template only, including header and footer sections repeated on each page.

Internally, the TCPDF library is used for creating the PDF from the HTML template, which also supports splitting long content to several pages automatically. In composer based setups, TCPDF is automatically added and installed as dependency. For TYPO3 integrators who still download packages from TER, there’s a new dependency the pdfviewhelpers extension due to the size of the TCPDF libary.

Supplier CSV import

Up to version 2020.07, you have been able to import several entities via configurable CSV files:

  • attributes
  • categories
  • coupon codes
  • products
  • stock levels

Now, you can also import supplier data including addresses, images, texts and references to other domains like products. Also, you can add supplier references in the product CSV import too.

This part of the new release was a big contribution by Alexey, an Aimeos developer and freelancer who offers his expertise for custom projects.

Improved admin backend for mobile phones

Thanks to Robert, who did an amazing job improving the backend styles, the Aimeos admin interface is much better usable by mobile phone users regardless of their display size. Even with an old iPhones which only have 320px width, managing the items is fully possible now.

Header texts which are too long fade out, the size of the buttons has been adapted to the smallest supported viewport size and all tables gets a scollbar if their columns are bigger than the screen.

Additionally, the left navigation menu got some love and displays the names of the navigation items when clicking on the bottom arrow button. Thus, mobile phone users can see what their meaning is if they can’t remember.

Better full text search and URL segments

The results of the full text search offered by MySQL, PostgreSQL and SQL Server has been refined to return more relevant results. Especially for phrases with several words, stop words and special characters, it yields much better results now.

Optimized URL segments can be added as text to products and categories, but generating URL segments from labels led to a loss of characters if special characters not covered by the ASCII character set was used. Thanks to the “voku/portable-ascii” library, these characters are now transliterated to the best matching ASCII character or to several characters like for “รค -> ae”.

Official TYPO3 10 support

Three month after TYPO3 10 LTS has been released, the Aimeos TYPO3 extension officially supports the new TYPO3 major release. It took some time until the static_info_tables extension was available for TYPO3 10, which Aimeos depends on.

The Aimeos 20.7.x extension supports TYPO3 v9 and v10 only because it removes all methods deprecated by v9 and dropped in v10 to clean up the code base. Furthermore, it uses the new APIs if applicable and offers it’s own panel for all Aimeos plugin elements with icons and descriptions to support new users.

Simplified manager and criteria filter methods

Working with Aimeos should be fun and even you can do the most complex things in e-commerce using Aimeos, the code you have to write should be as small as possible. Therefore, the manager methods have been shorted to:

Existing methodsNew method
deleteItem(), deleteItems()delete()
saveItem(), saveItems()save()

Also, building filter criteria for the search() method is now much easier. Instead of:

$search = $manager->createSearch( true )->slice( 0, 100 );
$search->setConditions( $search->combine( '&&', [
    $search->compare( '==', 'product.type', 'default' ),
    $search->compare( '==', 'product.dataset', 'shirt' ),
    $search->compare( '>', 'product.datestart', '2020-01-01' ),
] ) );
$search->setSortations( [
    $search->sort( '-', 'product.label' ),
    $search->sort( '+', '' )
] );

You can now write using the new 2020.07 release:

$f = $manager->filter( true )->slice( 0, 100 )
    ->add( ['product.type' => 'default', 'product.dataset' => 'shirt'] )
    ->add( 'product.datestart', '>', '2020-01-01' )
    ->sort( ['-product.label', ''] );

This will cover 95% of all use cases. A more complex example including mixed AND and OR operators:

$f->add( $f->and( [
    $f->or( [
        $f->is( 'product.datestart', '<', '2000-01-01' ),
        $f->is( 'product.datestart', '==', null ), ]
    $f->or( [
        $f->is( 'product.dateend', '>', '2000-01-01' ),
        $f->is( 'product.dateend', '==', null )
    ] ),
] );

You can use the NOT operator for negating all conditions:

$f->add( $f->not( $f->and( [
    $f->is( 'product.type', '==', 'default' ),
    $f->is( 'product.status', '==', 0 ),
] ) ) );

Creating search functions to pass parameters as part of the search key are also much easier to use now:

$f->add( $f->make( 'product:has', ['attribute', 'default', 123] ), '!=', null );

Finally, you can parse a complete condition block like before:

$f->parse( ['||' => [
        '<' => ['product.datestart' => '2000-01-01'],
        '==' => ['product.datestart' => null]
    ], [
        '>' => ['product.dateend' => '2000-01-01'],
        '==' => ['product.dateend' => null]
] ] );

The old manager and criteria API is still available so all extensions developed from 2020.x will continue to work without problems, but the old APIs are deprecated and will be removed in the future.

More about Aimeos

Leave a Reply

Your email address will not be published. Required fields are marked *