Is there a way to remove pricing from product listings?

I want to experiment with our online business but I have a question about product listings. I have over 300 products on our auto parts store website that I originally had available for purchase online. We wanted to disable purchasing for the time being but retain the product listings. That was no problem. So I have our products listed but is there a way to batch remove pricing from the products as well without having to edit each product?

Thanks for the help as always.

  • Stephanie
    • WPMU DEV Initiate

    A "cheat" way to do this might be to identify the style element in the CSS and add display:none; to the css for that element.

    I've used this method a couple of times when I need to make something disappear without getting too knee-deep in the code.

    I hope this helps.

    Cheers / Stephanie

  • Stephanie
    • WPMU DEV Initiate

    Matt - yes, just remove the CSS.

    Also, I use firefox and then right click and select "Inspect element". It allows you to fiddle with the css in the bottom of the screen so you can see the impact of the css change live locally before you put it on the server. Very cool.

  • Alexander
    • DEV MAN’s Mascot

    Hi @matt,

    There isn't an easy way to mass remove the price, but MarketPress has a filter that you can use to replace the price on the fly. For example:

    add_filter('mp_product_price','filter_all_pricing');
        function filter_all_pricing() {
          return 0;
        }

    You can place this code in functions.php of a theme (or Child Theme), in your own plugin, or using something like Code Snippets.

    You could combine that with the CSS method. This way the price isn't shown, and if someone tried to check, they wouldn't find anything useful.

    Best regards,

  • matt
    • Flash Drive

    Hello Alexander and thanks for the suggestion. I will work on this throughout the day (in between running deliveries and answering the phone :slight_smile:.... I'll let you all know and mark resolved when I get this sorted out.

    Thanks again you all.

    Regards/Matt

  • matt
    • Flash Drive

    Oops>>>> I think I messed up.I tried to add some of this code and got this error on a blank screen on both the wp admin backend and my site:

    public_html/wp-content/themes/swatch/functions.php on line 43

    I can hit the back button in the browser and get back to the editor in the admin backend and delete the code I added but still get the same error.

    Help Please?

  • matt
    • Flash Drive

    Alexander,

    My function.php file content::

    <?php /*-----------------------------------------------------------------------------------*/ /* Start WooThemes Functions - Please refrain from editing this section */ /*-----------------------------------------------------------------------------------*/ // Set path to WooFramework and theme specific functions $functions_path = get_template_directory() . '/functions/'; $includes_path = get_template_directory() . '/includes/'; // WooFramework require_once ($functions_path . 'admin-init.php' ); // Framework Init /*-----------------------------------------------------------------------------------*/ /* Load the theme-specific files, with support for overriding via a child theme. /*-----------------------------------------------------------------------------------*/ $includes = array( 'includes/theme-options.php', // Options panel settings and custom settings 'includes/theme-functions.php', // Custom theme functions 'includes/theme-plugins.php', // Theme specific plugins integrated in a theme 'includes/theme-actions.php', // Theme actions & user defined hooks 'includes/theme-comments.php', // Custom comments/pingback loop 'includes/theme-js.php', // Load JavaScript via wp_enqueue_script 'includes/sidebar-init.php', // Initialize widgetized areas 'includes/theme-widgets.php' // Theme widgets ); // Allow child themes/plugins to add widgets to be loaded. $includes = apply_filters( 'woo_includes', $includes ); foreach ( $includes as $i ) { locate_template( $i, true ); } /*-----------------------------------------------------------------------------------*/ /* You can add custom functions below */ /*-----------------------------------------------------------------------------------*/ /*

    *-----------------------------------------------------------------------------------*/ /* Don't add any code below here or the sky will fall down */ /*-----------------------------------------------------------------------------------*/ ?>

    I tried to add

    add_filter('mp_product_price','filter_all_pricing');
    function filter_all_pricing() {
    return 0;
    }

    as per your suggestion Alexander and I get the following error:

    Parse error: syntax error, unexpected '*' in /home1/capi/public_html/wp-content/themes/swatch/functions.php on line 5

    like I said, on both the backend admin and the site itself....I changed it back but still get the same error.......

    any thoughts?

    Thanks/Matt

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.