public function onChooseDisplayServicePrice(object $service) : bool

Fires while checking whether the service price should be displayed.


Description 

This hook can be used to apply additional conditions to the visibility restrictions of the price of a service.

When this hook is triggered, the system already validated all the standard conditions.

This hook won't trigger when the price should be hidden by default, which means that at least one of these criteria is satisfied:

  • the service has not cost;
  • the customer owns an active subscription.

Parameters

$service

(object)  The service to check. 

Return Value

Boolean. False to hide the price.


Example

/**
 * This event can be used to apply additional conditions to the 
 * visibility restrictions. When this event is triggered, the
 * system already validated all the standard conditions.
 *
 * @param   object   $service  The service to check.
 *
 * @return  boolean  False to hide the service.
 */
public function onChooseDisplayServicePrice($service)
{
    /**
     * @todo apply some custom validations
     */

    return true;
}

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-08 15:42
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information