Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jeff Starr

    (@specialk)

    – Number of products by category name: whatever

    [sbs_posts cat="whatever"]

    – Number of products by sub-category name: something

    [sbs_posts cat="something"]

    – Number of products by tag: pancakes

    [sbs_posts tag="pancakes"]

    This (and much more) is all explained on the Installation page, just fyi.

    Thread Starter Phil

    (@magicfilou)

    Hi

    – Number of products by category name: whatever

    [sbs_posts cat=”whatever”]

    It’s not working …

    tried with
    whatever = Name of the cat (e.g: my Categorie)
    whatever = Slug of the cat (e.g: my-categorie)
    whatever = ID of the cat (e.g: 61)

    :-/

    Plugin Author Jeff Starr

    (@specialk)

    I just re-tested and it works fine for category slug. In your case, is the category a “regular” post category, or a category for a custom post type? Also check to make sure you are using straight quotes (not curly/fancy quotes) for the shortcode attribute.

    • This reply was modified 3 years, 5 months ago by Jeff Starr.
    Thread Starter Phil

    (@magicfilou)

    a woocommerce category

    Plugin Author Jeff Starr

    (@specialk)

    So it must be a CPT. Try this:

    [sbs_tax tax="whatever"]

    Should do the trick.

    Thread Starter Phil

    (@magicfilou)

    Nope … Not working

    Giving me a wrong value :-/

    Plugin Author Jeff Starr

    (@specialk)

    Hmmm.. I’m not a “woo” user so don’t know what this is: “woocommerce category”.. If you can find out if that is a regular category or a custom taxonomy, it would help to figure out which shortcode to use.

    Thread Starter Phil

    (@magicfilou)

    This one:

    [sbs_cpt_count cpt=”product” txt=”null”]

    Give me the correct number of ALL Woo products …
    But now I want the same for category and sub category

    URL of Woo categories: ….wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product

    URL of a Category or sub-category is:
    …../wp-admin/term.php?taxonomy=product_cat&tag_ID=61&post_type=product&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dproduct_cat%26post_type%3Dproduct

    Hope this help!

    Plugin Author Jeff Starr

    (@specialk)

    I think it is not possible with the current version of the plugin. The closest I could find is this:

    [sbs_tax_posts tax="taxonomy" terms="term-1, term-2, term-3" type="custom-post-type"]

    As explained in the Installation docs, that works for specific terms but not sure about all terms at once.

    Also looking at your URL, it shows product_cat as the taxonomy slug. You might try using that for the previously suggested shortcodes, for example:

    [sbs_posts cat="product_cat"]
    [sbs_tax tax="product_cat"]
    Thread Starter Phil

    (@magicfilou)

    Tried … without success :-/

    Plugin Author Jeff Starr

    (@specialk)

    Yeah I don’t think it’s possible with the current version of the plugin. Will take a closer look for the next plugin update, see if there is any way to do it.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘New shortcode request for Woocommerce 2’ is closed to new replies.