Avatar of Robert Granlund
Robert Granlund
Flag for United States of America

asked on 

Wordpress Woocommerce Rentals Plugin

In the Rentals Plugin documentation it says:
For custom development you can use the functions below:
FunctionReturn
wcrp_rental_products_default_rental_options()Array of the default rental options

Here is the function:
function wcrp_rental_products_default_rental_options() {

   $options = array();
   $options['_wcrp_rental_products_rental'] = '';
   $options['_wcrp_rental_products_pricing_type'] = 'period';
   $options['_wcrp_rental_products_pricing_period'] = '1';
   $options['_wcrp_rental_products_pricing_period_multiples'] = 'no';
   $options['_wcrp_rental_products_pricing_tiers'] = 'no';
   $options['_wcrp_rental_products_pricing_tiers_data'] = array(
      'days' => array(
         '0' => '1'
      ),
      'percent' => array(
         '0' => '0'
      ),
   );
   $options['_wcrp_rental_products_minimum_days'] = '1';
   return $options;
}

How do I change these in my functions.php?  I tried to add a filter but the following does not work:

add_filter('wcrp_rental_products_default_rental_options', 'trove_custom_rental_product_settings', 50, 1);
function trove_custom_rental_product_settings($options) {

   $options = array();
   $options['_wcrp_rental_products_rental'] = 'yes_purchase';
   $options['_wcrp_rental_products_pricing_type'] = 'period';
   $options['_wcrp_rental_products_pricing_period'] = '1';
   $options['_wcrp_rental_products_pricing_period_multiples'] = 'no';
   $options['_wcrp_rental_products_pricing_tiers'] = 'no';


   return $options;

}

Web DevelopmentHTMLPHPWordPress

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon