Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow formula in rates #29

Open
gedex opened this issue Feb 14, 2016 · 4 comments
Open

Allow formula in rates #29

gedex opened this issue Feb 14, 2016 · 4 comments
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@gedex
Copy link
Member

gedex commented Feb 14, 2016

Originally reported by @solaceten in #12

  1. Also, there does not seem to be an easy way to add a discount or supplement for e.g. a one night stay.

I imagine this could be as simple as adding an additional field in the "Rates" row? Something along the lines of Range of Number of Nights - this will allow users to add a discount or supplement accordingly?

As an temp fix, I came up with the following, and have added it to woocommerce-bookings/includes/class-wc-booking-form.php - however it's not working quite right - can you take a look?

@gedex gedex added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement. labels Feb 14, 2016
@gedex gedex added this to the Future Release milestone Feb 14, 2016
@solaceten
Copy link

OK I got the following to work - hope this helps anyone else that needs something similar.

I know it's a dirty hack that the developers may / will probably strongly disapprove of, but it works for me as a temporary solution - feel free to suggest improvements. Disclaimer: this will be overwritten when you update bookings. Use at your own risk!

added to bottom of file woocommerce-bookings/includes/class-wc-booking-form.php

// Around Line 870 - original code
           // Person multiplier mutliplies all costs
    $this->booking_cost = max( 0, $total_block_cost + $base_cost );

// this added to add on a single night supplement cost of $20        
$booking_length = $data['duration'];
$override_block = apply_filters( 'woocommerce_bookings_process_cost_rules_override_block', ( isset( $fields['override_block'] ) ? $fields['override_block'] : '' ), $fields, $key );
$cost = apply_filters( 'woocommerce_bookings_process_cost_rules_cost', $fields['cost'], $fields, $key );
        $singlesupp  = '20.00';

             if ( $booking_length ==1 ) {

                $this->booking_cost = $total_block_cost + $base_cost + $override_block + $cost + $singlesupp;  

                     } 
``

@mattyza mattyza removed this from the Future Release milestone Aug 24, 2017
@laurendavissmith laurendavissmith added type: technical debt This issue/PR represents/solves the technical debt of the project. and removed priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement. labels Jun 19, 2018
@SiR-DanieL
Copy link
Member

More need for this in 27078799-hc

@jeffpaul jeffpaul added the priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. label May 11, 2022
@nicholasjeberlin
Copy link

6559594-zen

@Sukalo0290
Copy link

Sukalo0290 commented Dec 4, 2023

As per (#171)

Why hasn't the Bookable Range types been utilised for the Accom add-on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

No branches or pull requests

8 participants