PHPackages                             dominicwatts/addtocart - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dominicwatts/addtocart

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

dominicwatts/addtocart
======================

Magento 2 Add to cart helper - just drop in and go - avoid template block inheritance issues

1.0.0(4y ago)20GPL-3.0PHPPHP &gt;=7.1.0

Since Sep 10Pushed 4y ago2 watchersCompare

[ Source](https://github.com/DominicWatts/AddToCart)[ Packagist](https://packagist.org/packages/dominicwatts/addtocart)[ RSS](/packages/dominicwatts-addtocart/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Xigen Add To Cart Helper
========================

[](#xigen-add-to-cart-helper)

Shortcurt to build add to cart parameters without having worry about template block inheritence

[![phpcs](https://github.com/DominicWatts/AddToCart/workflows/phpcs/badge.svg)](https://github.com/DominicWatts/AddToCart/workflows/phpcs/badge.svg)

[![PHPCompatibility](https://github.com/DominicWatts/AddToCart/workflows/PHPCompatibility/badge.svg)](https://github.com/DominicWatts/AddToCart/workflows/PHPCompatibility/badge.svg)

[![PHPStan](https://github.com/DominicWatts/AddToCart/workflows/PHPStan/badge.svg)](https://github.com/DominicWatts/AddToCart/workflows/PHPStan/badge.svg)

[![php-cs-fixer](https://github.com/DominicWatts/AddToCart/workflows/php-cs-fixer/badge.svg)](https://github.com/DominicWatts/AddToCart/workflows/php-cs-fixer/badge.svg)

Install instructions
--------------------

[](#install-instructions)

```
composer require dominicwatts/addtocart

php bin/magento setup:upgrade

php bin/magento setup:di:compile

```

Usage instructions
------------------

[](#usage-instructions)

```
$xigenHelper = $this->helper(Xigen\AddToCart\Helper\AddToCart::class);

```

```
$postParams = $xigenHelper->getAddToCartPostParams($_item);

```

Then pthml as normal e.g.

```
