{"id":574,"date":"2024-03-01T08:45:40","date_gmt":"2024-03-01T07:45:40","guid":{"rendered":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/?post_type=lsvr_kba&#038;p=574"},"modified":"2024-03-01T11:36:29","modified_gmt":"2024-03-01T10:36:29","slug":"average-rate-per-distance-for-different-distance-intervals","status":"publish","type":"lsvr_kba","link":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/knowledge-base\/average-rate-per-distance-for-different-distance-intervals\/","title":{"rendered":"Average Rate per Distance for Different Distance Intervals"},"content":{"rendered":"<p>The average rate per distance can be one of the methods for calculating the final price for a ride. The guide below demonstrates how to calculate the average rate per kilometer (or mile) from given distance ranges and the prices assigned to them.<\/p>\n<div class=\"example\">\n<p><strong>Example<\/strong><\/p>\n<p>Distance in Km \u2013 Price Per Km<br \/>\n\t0-10 km &#8211; $4.00<br \/>\n\t10-20 km &#8211; $1.75<br \/>\n\t20-999 km &#8211; $1.50\n<\/div>\n<div class=\"important\">\n<p><strong>Important!<\/strong><\/p>\n<p>If you have already created any price rules, deactivate them (move to the trash) because they may overwrite the final effect.<\/p>\n<\/div>\n<p><strong>Case:<\/strong> A customer requests a ride that covers a distance of 48 kilometers. To calculate the average rate per kilometer for this distance given the provided rates, we need to determine the total cost for the entire ride and then divide it by the total distance traveled.<\/p>\n<p><strong>Given the rates:<\/strong><br \/>\n$4.00 per kilometer for the first 10 km<br \/>\n$1.75 per kilometer for the next 10 km<br \/>\n$1.50 per kilometer for any distance beyond 20 km<\/p>\n<p><strong>We can break down the calculation as follows:<\/strong><br \/>\nFor the first 10 km: $4.00\/km * 10 km = $40<br \/>\nFor the next 10 km (totaling 20 km): $1.75\/km * 10 km = $17.50<br \/>\nFor the remaining 28 km (48 km &#8211; 20 km): $1.50\/km * 28 km = $42.00<\/p>\n<p><strong>Total cost:<\/strong><br \/>\n$40 (for the first 10 km) + $17.50 (for the next 10 km) + $42.00 (for the remaining 28 km) = $99.50<\/p>\n<p><strong>Average rate per kilometer:<\/strong><br \/>\nTotal cost \/ Total distance = $99.50 \/ 48 km = $2.07\/km<\/p>\n<div class=\"tip\">\n<p><strong>Good to Know<\/strong><\/p>\n<p>If the result of the Total cost \/ Total distance operation has more than 2 decimal places, it is rounded to the nearest hundredth. Thus, in the case of the above operation, the result of 2.07291(6) is rounded to 2.07.<\/p>\n<\/div>\n<p>Therefore, the price for a ride over a distance of 48 km is 48 * 2.07\/km = $99.36<\/p>\n<p>We need only 1 rule to achieve the intended result.<\/p>\n<p>I will apply the rule to the <strong>BMW<\/strong> vehicle, as shown in the screenshots below.<\/p>\n<h2>Adding &#8216;Rule #1&#8217;<\/h2>\n<p><strong>Step 1.<\/strong> Go to the <mark>&#8216;Pricing Rules&#8217;<\/mark> menu and add a new pricing rule (Add New), I call it &#8216;Rule #1&#8217;.<\/p>\n<p><strong>Step 2.<\/strong> Go to the <mark>&#8216;Conditions&#8217;<\/mark> -> <mark>&#8216;Vehicles&#8217;<\/mark> tab and select the vehicle from the list (in my case &#8220;BMW 5 Series Long&#8221;).<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/pricing_rules_faq\/chauffeur_pricing_rule_04_01.png\">See screenshot<\/a><\/p>\n<p><strong>Step 3.<\/strong> Go to the <mark>&#8216;Conditions&#8217;<\/mark> -> <mark>&#8216;Distance&#8217;<\/mark> tab and set the parameters as shown in the screenshot below:<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/pricing_rules_faq\/chauffeur_pricing_rule_04_02.png\">See screenshot<\/a><\/p>\n<p><strong>Step 4.<\/strong> Go to the <mark>&#8216;Prices&#8217;<\/mark> tab and set the <mark>&#8216;Price Source Type&#8217;<\/mark> option to <mark>&#8216;Calculation based on distance (all ranges)&#8217;<\/mark>. In addition, you should set all price types to <mark>&#8216;- Inherited -&#8216;<\/mark>, so that this rule has no impact (does not reset) the prices in your configuration. See the screenshot below:<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/pricing_rules_faq\/chauffeur_pricing_rule_04_03.png\">See screenshot<\/a><\/p>\n<p><strong>Step 5.<\/strong> Save the rule by clicking <mark>&#8216;Publish&#8217;<\/mark>. The rule should look like this:<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/pricing_rules_faq\/chauffeur_pricing_rule_04_04.png\">See screenshot<\/a><\/p>\n<h2>Final Result<\/h2>\n<p>Here&#8217;s the pricing effect for renting BMW 5 Series Long vehicle for a distance of 48 km:<\/p>\n<p><a href=\"https:\/\/quanticalabs.com\/Envato\/Items\/Chauffeur_Booking_System_WordPress\/pricing_rules_faq\/chauffeur_pricing_rule_04_05.png\">See screenshot<\/a><\/p>\n<p>We hope this guide has equipped you with the necessary knowledge to calculate the average rate per kilometer. Thank you for reading!<\/p>\n<div class=\"doc-version\">\n<p><strong>Summary<\/strong><\/p>\n<p>Document version: 1.0<br \/>\n\tLast updated: March 1, 2024<br \/>\n\tPlugin version: 6.8+<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The average rate per distance can be one of the methods for calculating the final price for a ride. The guide below demonstrates how to calculate the average rate per kilometer (or mile) from given distance ranges and the prices assigned to them. Example Distance in Km \u2013 Price Per Km 0-10 km &#8211; $4.00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"lsvr_kba_cat":[7],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/574"}],"collection":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/comments?post=574"}],"version-history":[{"count":13,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/574\/revisions"}],"predecessor-version":[{"id":600,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/574\/revisions\/600"}],"wp:attachment":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/media?parent=574"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_cat?post=574"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_tag?post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}