Support » Plugin: YITH WooCommerce Dynamic Pricing and Discounts » Selecting categories that have only “Unpublished” items

  • Resolved walpap

    (@walpap)


    Hello

    As you can see on the url https://ibb.co/VtyYKCx I would like to know if it’s possible to create price rules for categories without checking if they have published items.
    Because I want to set the rules only once, and dont touch them anymore. So in the future i could start creating new products and without creating rules again. I also realized this was not possible because I wanted to test the plugin in an online website. So I created private/draft/pending products and categories just for testing the plugin, and I realized it wasn’t possible to select those categories if the products were not completely published.

    Is there a workaround? Is it possible to select them in the premium version?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    you can do this
    edit this file yith-woocommerce-dynamic-pricing-and-discounts/includes/class-yith-wc-dynamic-pricing-admin.php

    change the line 699 from

    ‘hide_empty’ => true,

    to

    ‘hide_empty’ => apply_filters(‘ywdpd_category_search_hide_empty’, true),

    then add this code to your theme functions.php

    add_filter(‘ywdpd_category_search_hide_empty’, ‘__return_false’);

    the above filter will be also added on next plugin update 🙂

    It worked! Thank you very much!!

    Just be careful with the apostrophes, the wordpress editor changes it.

    It should be ' not 🙂

    For those who copy and paste the code, consider changing the character.

    Or copy it from here (I replicate your message with the correct code):

    edit this file yith-woocommerce-dynamic-pricing-and-discounts/includes/class-yith-wc-dynamic-pricing-admin.php

    change the line 699 from

    'hide_empty' => true,

    to

    'hide_empty' => apply_filters('ywdpd_category_search_hide_empty', true),

    then add this code to your theme functions.php

    add_filter('ywdpd_category_search_hide_empty', '__return_false');

    Cheers.

    • This reply was modified 4 months, 1 week ago by walpap. Reason: bad coded
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.