Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › How can I hide a product – temporarily hide a product?
Tagged: hidden product, hide product, offline product, temporarily hide product, wp_eStore_category_products_fancy, wp_eStore_list_products
- This topic has 5 replies, 3 voices, and was last updated 11 years, 9 months ago by admin.
-
AuthorPosts
-
January 29, 2013 at 11:56 am #8448wpsadminMember
In my webstore [www.wpspandc.com.au/webstore] I want to sell some event tickets which we do annually (e.g. Mother’s Day stall, Father’s Day breakfast, Christmas Party). I want to be able to set these products up, sell them, then once the event is over hide them until next year. I don’t want to delete and recreate the product each year, as it will get a different product ID each time.
Is there a way to do this?
January 29, 2013 at 8:49 pm #53427StarCircleAcademyMemberI used to do this with my old pre-Wordpress site using JavaScript that checks the date and then chooses to include the HTML needed for purchase. If you feel adventurous, you could write a simple script in PHP that activates and deactivates.
Perhaps a less code-intensive way is to use the “inventory” option and set the current inventory for each product to zero. The item will then be marked “SOLD OUT”
January 30, 2013 at 5:39 am #53428adminKeymasterYou can categorize your products then display products from certain categories. This way you can put the products you want to hide into a different category that you don’t show on your site. You can take the product out of that category and put it into a different one when you want to show it next year.
More details on displaying products from a particular category:
Another helpful post on this topic:
January 30, 2013 at 12:06 pm #53429wpsadminMemberThank you. I have created 2 categories “Hidden” and called “Active”, then used the category shortcode to only display the “Active” category.
February 5, 2013 at 7:52 pm #53430StarCircleAcademyMemberWhile “Active” makes sense, Hidden doesn’t because you can’t use the shortcodes like:
[wp_eStore_all_products_stylish:end] and except for you own use, you’d never show the hidden products.
[wp_eStore_all_products_stylish:end], for example, doesn’t care that the item is not hidden. I have a similar problem in that I have items that are not separately sellable but are included in bundles. I ended up creating a “Show in Catalog” category, but there isn’t a way to combine two categories e.g. “Show in Catalog” + “Downloadable Video”. It would, IMHO, be better if there were a separate property on the product called “don’t show”. However that still doesn’t solve the problem disabling item(s) from displaying EXCEPT by using the category type list:
[wp_eStore_category_products_fancy id=3 style=3]
February 6, 2013 at 2:37 am #53431adminKeymasterYou are not seeing the power of the category shortcode just yet. That category shortcode allows you to do various things and should help you with your requirement.
First of all, forget that the
[wp_eStore_all_products_stylish:end]
shortcode exists. This shortcode is clearly NOT for you. We have many shortcodes and not all of them are going to be useful for every projects out there.You can assign multiple categories to a product. So you can create a category called “All” and assign each product to that category. Lets say the ID of this “All” category is 1. Now you can show all products using the following shortcode:
[wp_eStore_category_products_fancy id=1 style=3]
Now, Going from your example… lets say the category ID of your “Show in Catalog” category is 2. The category ID of your “Downloadable Video” category is 3. Simply use the following shortcodes on a page where you want to show all products from “Show in Catalog” and “Downloadable Video” categories:
[wp_eStore_category_products_fancy id=2 style=3]
[wp_eStore_category_products_fancy id=3 style=3]See how that works?
-
AuthorPosts
- You must be logged in to reply to this topic.