How to disable PrestaShop variations without deleting them
Deactivating products in PrestaShop is something everyone knows how to do. Doing it en masse is also easy with Merlin, see here if you don't know any of the three basic techniques.
But for declinations, how do you deactivate them, when there's nothing for it in PrestaShop? Here's our tip...
Alternative methods with PrestaShop to prevent the purchase of a declination
There is no "Active" checkbox in the PrestaShop back office, in the declination table, allowing them to be temporarily deactivated. The only solutions, which are imperfect, are as follows:
- Delete declinations. Not great at all, you lose the statistics, you have to redo them afterwards, without forgetting the stocks, prices the references and think about forcing their identifiers (not natively feasible with PrestaShop) to keep some consistency in the sales histories.
or
- Buy an add-on module that overclasses PrestaShop's operation and therefore authorizes the deactivation of declinations. This exists but costs the price of Merlin, which can do 1000 times more. So it's a bad expense.
or
- Set their stock to 0. Imperfect, because the customer will still be able to select them only to be told by the site to choose another. Not at all a commercial approach. What we want is to hide unavailable variants.
How to mass-disable declinations with the Merlin Backoffice™ module
The trick is as follows:
Merlin Backoffice is natively thought out and designed to handle complex multi-boutique configurations. As you may know, with Merlin, attribute groups and attribute values can be associated and de-associated with the various stores, at the click of a button. Example with a PrestaShop 1.6 configured with two stores 1 and 2:

In the example above, the "Size" attribute group is disabled in store 2, the "White" color is disabled in store 2 and the "Camel" color is disabled in shop2. To re-enable (or, more accurately, re-associate) them, all you have to do is click on the checkboxes.
So what? you might ask. The result is that all declinations, of all products, defined by a Size or linked to the color White are automatically deactivated in Shop 2, Camel color declinations are automatically deactivated from Shop 1.
What if we're not multi-boutique?
It works the same way, we just have a single column corresponding to store 1, here a PrestaShop 1.7, single store, in which we've disabled the "Black" color attribute:
Let's take the example of a T-shirt available in two colors and various sizes, with all attributes correctly associated with the store:

Here it is offered in store, with a choice of two colors:

If we now uncheck the association between the "Black" attribute and the store, but without deleting the black declinations, like this:

We then have exactly the result we were looking for in the store, with the black color declinations having been deactivated, they are no longer offered:

But there's one big problem with this method, and that's that all the black variations of all the products in the store are also deactivated. Ouch, so we need to improve the technique.
It should be noted, however, that this technique can stand on its own in certain situations. Let's imagine a seller of wood and aluminum gates and that suddenly the manufacturer has technical problems working with aluminum and can temporarily only deliver wood versions, we can imagine wanting to massively deactivate all the site's aluminum variations, simply by temporarily deactivating the aluminum attribute in the store.
How to disable only certain PrestaShop declinations
We'll use the same black and white T-shirt example.
We therefore wish to disable only all black declinations of this particular product (or a selection of products, but not on all products).
To do this, we'll create a new temporary attribute, disable it and associate it with these declinations in place of "Black".
To reactivate these declinations later, identically, we'll simply reassign the "Black" attribute to them using exactly the same method.
- Create a new "Black out of stock" attribute (whatever the name) by clicking on the "+ New" button in the attribute values table.
- Unlink it from the store (we leave the real "Black" color activated though).
- Select the products to be modified, display their declinations, then in the declination table, right-click in one of the cells containing the "Black" attribute (you'll need to have activated the "1 column per attribute" display to see this type of column) to bring up the contextual menu.
- Choose the "Filtered selection on this column..." command, allowing you to search and select rows in the same step.
- Set the filter to "Equal to Black" and validate.
- At this point you should see all black declinations selected, for all selected products.
- Make a simple click in the Decline. column in the checkbox of the "Noir out of stock" temporary attribute row,this has the immediate effect of replacing in all selected declinations, the "Noir" color with "Noir out of stock".
- Eventually, click on the flashing "Refresh" button, to update the display and check that the "Black' declinations have indeed changed color attribute.


For this product, the result is identical, the black declinations are deactivated and therefore no longer offered to buyers on the site:

But this doesn't affect other products, like this other long-sleeved tee, still available in White or Black:
Category's other articles Managing PrestaShop variations and attributes
-
How to set the order of display variations in your product pages?
How to
With PrestaPricing (or now Merlin Backoffice) , the Swiss knife addon for PrestaShop, you can also easily change the display order of variations of attributes in product pages. This tutorial is showing this in images, here's how
-
How to export product variations?
How to
This tutorial explains the best way to export the product variations from PrestaShop, using PrestaPricing or Merlin Backoffice addons from Sitolog
-
How to show and modify the color squares (color selectors)
How to
See in images how you to choose or modify the colors of the small square selectors associated with each color attribute of PrestaShop product, using Merlin Backoffice addon
-
How to quickly create declination attributes in PrestaShop
How to
Step-by-step tutorial for adding attribute groups and attribute values to create product variations. Two methods are explained, with PrestaShop and by batch with the Merlin Backoffice module
-
Merging attributes in Prestashop
How to
A quick and easy way to combine duplicate or similar attributes into a single attribute, without having to redo the declensions