Temporarily Hide "Add to Cart" and Price on single items

Home Forums General Help Temporarily Hide "Add to Cart" and Price on single items

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5795
    Evans
    Guest

    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,
    Evans

    #5824
    Wambere
    Keymaster

    You 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.

    #5862
    Evans
    Guest

    Hello,

    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.

    #5921
    wham
    Guest

    You 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.

    #5925
    Evans
    Guest

    Well, 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,
    Evans

    #5934
    Evans
    Guest

    Well, 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,
    Evans

    #5946
    wham
    Guest

    I hear you. Sorry for having to make you go a round about way.

    We’re looing forward to making it easier in future versions. 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Temporarily Hide "Add to Cart" and Price on single items’ is closed to new replies.
© 2024 DukaPress. All rights reserved.
Design By Madoido.