• Resolved gurumosh

    (@gurumosh)


    We rent out conference rooms. We have created a calendar and stored a daily price in the calendar. Can this daily price be retrieved using a dynamic tag (e.g. the total price = {Total Amount])?

    We need the dynamic tag to be able to display the unit price from the calendar without optional extras in the automatically generated contract.

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

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

    (@murgroland)

    Hi,

    Yes, you can create a custom tag by adding this code to your theme’s functions.php file:

    add_filter('wpbs_dynamic_tag', function($content, $tag, $data){

    // Check what tag we are replacing
    if ($tag != '{Calendar Price}') {
    return $content;
    }

    $prices = $data['payment']->get('prices');

    return str_replace($tag, $prices['events']['price'], $content);

    }, 10, 3);

    Then use the {Calendar Price} tag in the contract.

    Thread Starter gurumosh

    (@gurumosh)

    Works like a charm, thank you very much!

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