Support » Plugin: Product XML Feeds for WooCommerce » Conditional logic

  • Resolved ucsendre

    (@ucsendre)


    Hello! Is there a way to use conditional logic in your shortcodes?
    For example I need to add some extra category names for some of my shop categories like this:
    if the first category is “something” then {
    <category>”extra category1″ > “extra category 2″ > [alg_product_categories_names sep=” > “]</category>
    } else {
    <category>[alg_product_categories_names sep=” > “]</category>
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Algoritmika Ltd

    (@algoritmika)

    Hi @ucsendre,

    Not sure if this will be good enough, but there are find and replace attributes available in all plugin’s shortcodes, so you could try something like this:

    
    <category>[alg_product_categories_names sep=" > " find="Something >" replace="Extra Category 1 > Extra Category 2 > Something >"]</category>
    

    Please let me know if this works for you. If not – I could try to add something to the plugin.

    Best regards,
    Tom

    ucsendre

    (@ucsendre)

    Dear Tom,

    It works like a charm. Thank you very much indeed.

    Best regards,
    Endre

    Plugin Author Algoritmika Ltd

    (@algoritmika)

    Hi @ucsendre,

    Sure, no problem, happy to help.

    [ Signature deleted ]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional logic’ is closed to new replies.