pixelant / pxa_product_manager

Product Manager. Allow to create and list products on a site. Create dynamical attributes for products. Filter by categories and attributes
11 stars 12 forks source link

Route Enhancer not working with v11 [BUG] #384

Closed bh-teufels closed 2 years ago

bh-teufels commented 2 years ago

The Route Enhancer does not working anymore on Typo3 11.5.13 pxa_product_manager 11.0.6

i used the code provided by pxa_product_manager/Configuration/RoutingExample/RouteEnhancers.yaml

does anybody have a working example of the route enhancer on Typo3 11?

bh-teufels commented 2 years ago

i see that the PluginName has changed from Pi1 (for list, show) to different Plugins for each action. how should the route enhancers look when i want to achieve the following:

Detail:

URL looks like: http://my-domain.com/product/?tx_pxaproductmanager_productshow%5Baction%5D=show&tx_pxaproductmanager_productshow%5Bcontroller%5D=ProductShow&tx_pxaproductmanager_productshow%5BextensionName%5D=PxaProductManager&tx_pxaproductmanager_productshow%5BpluginName%5D=ProductShow&tx_pxaproductmanager_productshow%5Bproduct%5D=1&cHash=a97070f5e9e09d7e944b615d2344b679

URL should look like: http://my-domain.com/subfolder/

Listing: i use 1 Filter (Radio, Category, OR) and 1 Filter (Checkbox, Attribute Mutliselect, AND) and want to have also speaking URLs for the Filter

URL looks like:

bh-teufels commented 2 years ago

with the following code for route enhancer i get the product name in the url but still having /?tx_pxaproductmanager_productshow%5BextensionName%5D=PxaProductManager&tx_pxaproductmanager_productshow%5BpluginName%5D=ProductShow&cHash=853401fd9a159e75dc3afb7399c3dd62 in the url

ProductShow:
    type: Extbase
    limitToPages: [8]
    extension: PxaProductManager
    plugin: ProductShow
    routes:
      -
        routePath: '/{product_title}'
        _controller: 'ProductShow::show'
        _arguments:
          product_title: product
    defaultController: 'ProductShow::show'
    aspects:
      product_title:
        type: PersistedAliasMapper
        tableName: tx_pxaproductmanager_domain_model_product
        routeFieldName: slug
MattiasNilsson commented 2 years ago

@bh-teufels We recommend that you use the plugin called ProductRender instead. This is due to the fact that it now uses pages instead of sys_categories and also have full support for proper routes out of the box.

bh-teufels commented 2 years ago

Thank you with the ProductRenderer Plugin an the following route enhancer it is working

ProductRender:
    type: Extbase
    limitToPages: [9]
    extension: PxaProductManager
    plugin: ProductRender
    routes:
      -
        routePath: '/{product_title}'
        _controller: 'ProductRender::init'
        _arguments:
          product_title: product
    defaultController: 'ProductRender::init'
    aspects:
      product_title:
        type: PersistedAliasMapper
        tableName: tx_pxaproductmanager_domain_model_product
        routeFieldName: slug
MattiasNilsson commented 2 years ago

@bh-teufels Good to hear that is works!

bh-teufels commented 2 years ago

the topic "Speaking URL for Listing" is still present. is it possible to have route enhancer for the List filter?

MattiasNilsson commented 2 years ago

@bh-teufels Not at the moment, but it may come in some future update. As said before any PR is welcome!