---
title: "Breaking: #135 - Add JS files with AssetViewHelper"
manual: "Cart Products"
version: "main"
permalink: "https://docs.typo3.org/permalink/extcode/cart-products:breaking-135-add-js-files-with-assetviewhelper@main"
source: "Changelog/5.0/Breaking-135-AddJsFilesWithAssetViewHelper.rst"
rendered: "2026-11-24T20:21:03+00:00"
---

# Breaking: #135 - Add JS files with AssetViewHelper {#breaking-135-add-js-files-with-assetviewhelper}

See [Issue 135](https://github.com/extcode/cart_products/issues/135)

## Description {#description}

EXT:cart v9 uses modularized JavaScript without jQuery (see
`[TASK] Switch from jQuery to vanilla JavaScript #438 <https://github.com/extcode/cart/pull/438>`).

This allows to add the JavaScript only on pages where it's really needed which
is good for performance. The JavaScript is for detail pages is now loaded with
the TYPO3 `Asset.script ViewHelper <https://docs.typo3.org/other/typo3/view-helper-reference/12.4/en-us/typo3/fluid/latest/Asset/Script.html>`.

## Affected Installations {#affected-installations}

All installations which overwrite
`Resources/Private/Partials/Product/CartForm.html` are affected.
When using the `CartForm.html` which comes with this extension it will work
without any changes.

## Migration {#migration}

The JavaScript in EXT:cart is no longer added via TypoScript. All JavaScript
files are now added via ViewHelper.

-   **Two ViewHelpers needs to be added in `Resources/Private/Partials/Product/CartForm.html`:**

    -   `<f:asset.script identifier="add-to-cart" src="EXT:cart/Resources/Public/JavaScript/add_to_cart.js" />`
    -   `<f:asset.script identifier="change-be-variant" src="EXT:cart/Resources/Public/JavaScript/change_be_variant.js" />` (only when working with BE Variants).
