2

I have a view of published products. I want to also create a view of unpublished products, so users can see previous products that were available, but there shouldn't be an Add to cart on these products.

I've unpublished the products and created a view of these. Admin can see the results in the view and when they click on one of them there is still an add to cart to button. Anon users can't see the view results at all.

How can I disable products so they are unpurchase-able and also display in a view?

1
  • 1
    I wouldn't use "unpublishing" for this. Generally, in Drupal, "unpublished" nodes should not be shown unless the user is an admin. Depending on the type of product, you can add a new boolean field such as "available" and then set that to false for the products you are no longer selling, and then configure your view based on that field. Dec 17 '21 at 4:49
2

What you do is somewhat dependent on your product architecture, specifically which fields you have at the Product level and which at the ProductVariation level. If all the fields you use in your product displays are at the Product level, you can simply disable the ProductVariation and leave the Product published. There will no longer be an Add to Cart form on the display, and everything else will remain the same.

Use a little trial and error to see what works for you. You may need some additional site building or theming in the case that your displays are dependent on fields injected from the ProductVariation into the Product display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.