Support » Plugin: WooCommerce » Woocommerce category slug

  • Resolved Izidor Segunda

    (@saintmi1)


    Hello 🙂 !

    My question is :

    if($main_category->slug == "vedofoliak" || $main_category->slug == "vedotokok"):

    Is it possible to change this part of the code checking for category slugs to check for category IDs.
    Now if we change the category name the slug will be changed too so these comparison may not be the best way.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    If you only show this piece of code I would say. Use
    print_r or var_dump on $main_category to see if it contains an id. You can continue to work from there.

    Plugin Support Austin M – A11n

    (@apmwebdev)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread if you have any further questions!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce category slug’ is closed to new replies.