Magento - product that are not for sale

Magento - product that are not for sale

August 13, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - product that are not for sale

Disabling the “Add to Cart” Function for Non-Sale Products in Magento

As a seasoned e-commerce developer, I understand the need to showcase products on your Magento store without allowing customers to purchase them via the cart function. This is particularly useful when you want to display items that are out of stock or only available for custom order.

In Magento 2, you can easily achieve this by setting the product status and visibility accordingly. Here’s a step-by-step guide:

Step 1: Set the Product Status

Navigate to your Admin Panel > Catalog > Products. Select the product(s) you want to make unavailable for purchase.

Under the General tab, find the Status dropdown and change it from Enabled to Disabled. This will remove the “Add to Cart” button from the product page, but the item itself remains visible in the storefront.

Step 2: Adjust Visibility

While you’re still on the General tab, look for the Visibility field. Change this setting to Catalog, Search, or both, depending on where you want the product to appear. Setting it to Not Visible Individually will ensure the item doesn’t have its own page but can be included in category listings.

Remember that changing these settings won’t affect any existing links or SEO for this product—it simply removes the shopping cart functionality.

If you prefer a programmatic approach, you can use Magento’s API to update these attributes. Here’s an example of updating the status via REST:

$ch = curl_init('http://127.0.0.1/magento/index.php/rest/V1/products/{product_id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"status": 2}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);

This script sends a PUT request to update the status attribute of a specific product. You’ll need to replace {product_id} with the actual ID and ensure you have proper authentication for the API.

For more advanced customizations, consider hiring an expert developer from Laravel Company who can provide tailored solutions and optimize your Magento setup for optimal performance and security.

In conclusion, disabling the “Add to Cart” function for non-sale products in Magento is a straightforward process that requires only a few clicks or lines of code. By adjusting the product status and visibility settings, you can effectively manage which items are available for purchase on your storefront, improving user experience without sacrificing the item’s online presence.

If you found this solution helpful, feel free to share it with other Magento users and explore our Magento services for comprehensive e-commerce solutions.

Magento 2 Checkout Catalog API

Our network