All modulesMagento 2 module

Add product to cart with url

One link adds a product to the cart, optionally with a discount code, and sends the customer to the cart or checkout. For e-mails, ads and QR codes.

€160 + VAT · one-off licence, installation optional

Add product to cart with url
About the module

What it does.

"My newsletter announces a promotion, but customers still have to find the product and add it to the cart." Every step between the click and the cart loses a few customers.

What it looks like in practice

A newsletter or a QR code carries a link to a product. The customer clicks and the product is already in the cart, optionally together with your discount code. They land in the cart or on a page you chose, for example straight at checkout.

What changes

  • One click to the cart. The link carries the product SKU and optionally the quantity (qty); the customer lands in the cart or on a page you choose.
  • A discount code in the same link. The coupon parameter applies your coupon code, and the promo parameter generates a new code for the customer from an auto-generating rule.
  • You decide where they go next. The return_url parameter sends the customer to a page of your store, for example straight to checkout.
  • Safeguards. An unknown or missing SKU shows a message, a second click within a minute does not add twice, and the redirect only leads to your own store.

Who it is for

For stores that send newsletters, run ad campaigns, use landing pages, or put QR codes on packaging and printed material.

How you set it up

There are no settings in the admin. You build the link in the form https://your-store.com/quickcart/addtocart/add/?sku=SKU&qty=2&coupon=CODE.

Good to know

  • One link adds one product. It works for simple and virtual products and for bundles (with their default selections); for products with a choice such as size, the link does not pick the option.
  • A link that changes the cart is triggered by a plain request to the address, so a browser or a crawler may fire it in advance. It suits e-mail and ads; if that is a concern, do not publish it on public pages.

Want it in your store?

Install it yourself or choose installation and configuration when you order. Building a new store? Add it to your project in the Konfigurator.

Screens

Take a look at every step.

www.degriz.eu
A link in a newsletter fills the cart with several products in one click
www.degriz.eu
The add-to-cart link, for example in a newsletter, on social media or in an email
www.degriz.eu
After the click the cart opens with a message listing the added products
www.degriz.eu
The cart with the products and quantities from the link and all discounts applied
Installation

How to install it.

We install the module from our repository with Composer. We send you the user name and access key for the repository after purchase. If you prefer, we install it for you.

In the root of the Magento 2 store run the commands (replace UPORABNIK and DOSTOPNI_KLJUC with the user name and access key you received):

composer config repositories.degriz composer https://www.degriz.net/konfigurator/composer/packages/composer config --auth http-basic.www.degriz.net UPORABNIK DOSTOPNI_KLJUCcomposer require degriznet/m2_addtocartbyurlphp bin/magento module:enable Magelan_AddToCartByUrlphp bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy -fphp bin/magento cache:flush

Setup

  1. The module has no settings. After installation build the link as /quickcart/addtocart/add/?sku=SKU and test it in the browser.
  2. Add the quantity with &qty=, a coupon with &coupon=, a one-time code from a rule with &promo= (the rule number) and the destination with &return_url=.

Where do I get the user name and the access key?

After the payment we e-mail you a link to create the access key. Keep the key safe: for security it is shown only once and we do not keep it in readable form. The user name (your project code) and all the commands, ready to copy, are in your account under My account > Module licences.

Lost the key? Create a new one in your account under Module licences; the old one stops working.

Technical details

Compatibility.

Just the facts.

Code
degriz_addurl
Platform
Magento 2
Licence
One-off
Change log

Version 1.1.0 · 11 Nov 2026

  • Link previews in mail and chat apps and crawlers no longer add products to carts or create discount codes.
  • One link can add several products at once, including a chosen size or colour.
  • An invalid coupon code shows a message, and opening a link again reuses the same discount code.

Version 1.0.2 · 5 Oct 2026

  • Safer add-to-cart link: the redirect after adding only leads to a page of your shop.
  • The discount code from the link is only generated for an active rule of your website that creates codes automatically.
  • The quantity must be a positive number, and a link without a product says so instead of failing.
  • Adding to the cart is no longer counted twice in tracking.

Version 1.0.1 · 2 Oct 2026

  • Code aligned with the version used in live shops.

Version 1.0.0 · 31 Jul 2026

  • First release: add one or more products to the cart straight from a link, for example in a campaign or an email.
After purchase

You are not left alone.

We develop and maintain the module ourselves, so you write to the people who know it line by line.

Installation

Installation and configuration are optional: choose them when you order and the price is added to the order (+ VAT). If more time is needed, we bill the rest separately.

Support

A bug that repeats on a clean Magento with the Luma theme we fix free of charge. Settings, customisations and other themes by time spent.

Updates

The licence includes 12 months of free updates for the Magento versions on the supported list.

We agree on a date after reviewing the request. User guides in the guide centre

Add product to cart with url

€160 + VAT

One-off licence for one store, no subscription. Installation and configuration are optional.

After payment you get the licence and access to our private repository: immediately with a card or PayPal, with a bank transfer (UPN) as soon as we receive the payment. 12 months of free updates are included.

Links
Write to us

Install it yourself by following the guide, or choose installation and configuration above. If more time is needed, we bill the rest separately. We agree on a date after reviewing the request.

Anže Voh, Degriz

Questions about this module?

Write to us and we will answer personally.

[email protected] · +386 40 807 231

Add product to cart with url€160 + VATAdd to cart

Online store configurator

Redesigning your store or building a new one?

Put your own quote together in the configurator and see the price straight away. A few minutes, no obligation, no meeting needed.

  • Price straight away
  • No obligation
  • Straight to the developer
Open the configurator

Free and with no obligation

We use cookies for the proper functioning of the site, visit analytics and showing ads tailored to your interests. Read more in our privacy policy. By clicking "Accept all" you agree to the use of all cookies.