Simple calculation between two fields

Top WooCommerce & WordPress Plugins Forums Product XML Feeds for WooCommerce Simple calculation between two fields

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #139142
    Pareidolia
    Participant

    Hello,

    Is it possible to make a simple calculation between the values of two shortcodes? I would like to do the following:

    [alg_product_price custom_function=”round”] minus [alg_product_meta name=”_pret_ach”]

    The custom field is the aquisition price. The resulting value would be useful for us in creating smarter Google/Facebook campaigns.

    Thank you!

    #140212
    Kousik
    Moderator
    Plugin Support

    Hello,

    Two shortcodes cannot be used as operands. Please use this shortcode instead: [alg_product_id custom_function="my_custom_function"]

    In the theme’s functions.php file, create a function named “my_custom_function” with the argument “product_id”. There, you can write down the logic and return the result.

    Regards,
    Kousik Mukherjee

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.