Home › Forums › General Help › Temporarily Hide "Add to Cart" and Price on single items
- This topic has 6 replies, 2 voices, and was last updated 12 years, 7 months ago by wham.
-
AuthorPosts
-
April 25, 2012 at 5:05 pm #5795EvansGuest
Hello,
I need to be able to temporarily hide the Price and “Add to Cart” button on some single items. How can I do this?
Thank You,
EvansApril 26, 2012 at 3:33 pm #5824WambereKeymasterYou can do this via CSS by using display:none; on the classes which control the price and add to cart.
However your theme needs to be able to allow you to target each post/page/product individually for this to succeed as you want it.
April 27, 2012 at 4:34 pm #5862EvansGuestHello,
Thank you for your reply. I’m using, essentially, the default WP theme which has been modified in appearance. I’m reasonably new to WP and very new to DukaPress, so forgive me if this is a stupid question. I’m not sure how to target a specific post or set of posts in the CSS. I also will need my client to, ultimately, enable or disable the cart button on different products he will add. This is not going to be for a single product, once.
Please advise?
Thank You.
April 30, 2012 at 11:15 am #5921whamGuestYou would need to look at the way the theme organises its CSS. Unfortunately not all themes are this well-written so it will not work easily with all themes.
With twentyeleven it is easy enough. For example, all of twentyeleven CSS for a particular post is enclosed in
< article-id = "post-95" class = "post-95…
The "95" here would correspond to the post ID of a particular post or page or product.
This makes it possible to include in your CSS something like:
.post-95.somecssclass{somecss:somevalue;}
This would mean that the CSS above will only apply on the product/page/post with a post ID that is "95"
I hope this helps.
April 30, 2012 at 6:05 pm #5925EvansGuestWell, sort of. I understand now what you’re saying about identifying the post thru CSS and then disabling the Add to Cart (what would actually be the code to hide the Add to Cart?) but, what I’m trying to get at is, I can’t have to in to the CSS every time I want to hide the Add to Cart on a new post and add a line of code identifying that particular post, can I? That seems like it would generate a lot of extraneous code that’s being sifted thru when EVERY page is loaded, verses just when the particular page is loaded?
Thank you for your help,
EvansMay 1, 2012 at 4:17 am #5934EvansGuestWell, by switching to using the built in WP gallery with added Lightbox functionality, I can now simply remove the [dpsc_display_product] which eliminates the Add to Cart button. I just turned off the Display Price for the entire site using the DukaPress Styles. So long as I leave 0.00 in the price and quantity of 1 in the “Available” field, the item still displays on the main product page.
I think in future version of DukaPress it would be really great if you add a simpler Show/Hide function for “Add to Cart”. For people who have one of a kind items, it’s sometimes necessary to temporarily remove the “Add to Cart” function, if, for example, you’ve placed an item On Hold, pending a sale.
Thanks,
EvansMay 1, 2012 at 11:29 am #5946whamGuestI hear you. Sorry for having to make you go a round about way.
We’re looing forward to making it easier in future versions. 🙂
-
AuthorPosts
- The topic ‘Temporarily Hide "Add to Cart" and Price on single items’ is closed to new replies.