WP eCommerce
Excluding categories from a menu (7 posts)

  1. aldodager
    Posted 2 years ago #


    as you guys can see here: http://zyanclothing.com some categories are called and added to a menu on the header... I updated the plugin and suddenly the code that was before stopped working and now I can see all the categories

    This is the actual code that doesn't works anymore:

    <?php wpsc_start_category_query(array('parent_category_id'=> 0, 'show_thumbnails'=> false, 'show_name' => true, 'exclude' => array('53','57','58'))); ?>

    Any idea on how to fix this?

    Thank you!



  2. whitelamp
    Posted 2 years ago #


    I can see two horizontal menu bars.
    One begins with
    Best sellers 2012 Best sellers 2013 BEST SELLERS 2014
    the other with
    The top one has all the submenus already dropped down in Firefox and Chrome. So it looks mostly like a layout issue to me. I am not sure which categories you do not want to see! but maybe this part:
    'exclude' => array('53','57','58')));

    needs updating?

  3. aldodager
    Posted 2 years ago #

    Hi whitelamp, thank you for replying.

    Actually yes, that part needs updating but maybe it's a syntax issue.

    As I said before, that line of code worked great before and categories 53,57 and 58 are the ones I want to exclude from that array.

  4. whitelamp
    Posted 2 years ago #

    Bona nit,

    Which menu bar is it that is wrong?

  5. Manthy
    Posted 2 years ago #

    aldodager Did you find the solution to this?? The "exclude" part stopped working for me too...

  6. aldodager
    Posted 2 years ago #


    Nope. I just removed some categories to patch things up. Stopped working when I updated WordPress and WP E-Commerce.


  7. Manthy
    Posted 2 years ago #

    That was my problem too.
    I thought of another way to achieve "not displaying specific product categories" in my product categories list.

    In case someone finds it usefull..

    I changed this (in wpsc-products_page.php, in my child theme):

    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item  <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name(); ?>">
    						<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>

    into this:

    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item  c<?php wpsc_print_category_id(); ?>" title="<?php wpsc_print_category_name(); ?>">
    						<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>

    Basically this makes it possible to give each "category" its own class.

    So then, in my css file, I created a class .c11 and .c12 (11 and 12 is the IDs of the product categories I needed to axclude) and I put in that classes display:none;.

    Not the right way maybe... but it gets the job done!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic