Skip to content

Canonical URLs generated wrong on product detail page #269

@simonduerr

Description

@simonduerr

Bug Report

Current Behavior
Each product detail page has a canonical meta tag.
It looks wrong:
<link rel="canonical" href="https://mysite.com/shop/detail/?0[tx_cartproducts_product][controller]=Product&0[tx_cartproducts_product][product]=38">

0[tx_cartproducts_product] should be tx_cartproducts_product.

Expected behavior/output
I want the canonical URL to be
<link rel="canonical" href="https://mysite.com/shop/detail/?tx_cartproducts_product[controller]=Product&tx_cartproducts_product[product]=38">

Environment

  • TYPO3 version(s): [12.4]
  • cart_products version: [e.g. 5.0.5]
  • Is your TYPO3 installation set up with Composer (Composer Mode): [yes]
  • OS: [Xubuntu]

Possible Solution
The error lies in CanonicalTagViewHelper, line 57 following:
There is one array dimension too much.

This would be correct:

$arguments = [
        'tx_cartproducts_product' =>
        [
            'controller' => 'Product',
            'product' => $product->getUid(),
        ],
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions