Forums

wp-ecommerce hide add to cart for non-registered users (3 posts)

  1. sock2me
    Member
    Posted 1 year ago #

    Hi!
    I've also posted this question over at getshopped and googled the heck out of it - but what I'm wondering is if wp-ecommerce allows for the 'buy now' button or the 'add to cart' button to only show for approved users. I want to use it as a catalog for non registered users but only sell to approved/registered users (because we only want to sell wholesale).

    Thanks for any help you can provide!

  2. SherrisOffice
    Member
    Posted 1 year ago #

    Did you find a way to do this? This is exactly what I have been trying to do.

  3. SherrisOffice
    Member
    Posted 1 year ago #

    I figured it out!

    In both wp-content>plugins>wp-e-commerce>wpsc-theme>wpsc-products_page.php and wp-content>plugins>wp-e-commerce>wpsc-theme>wpsc-single_product.php, change this line:

    <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>

    to this:

    <?php if((get_option('hide_addtocart_button') == 0) && (is_user_logged_in()) && (get_option('addtocart_or_buynow') !='1')) : ?>

    Basically, saying if the user is logged in, show the 'add to cart' button, otherwise, don't.

Topic Closed

This topic has been closed to new replies.

About this Topic