Changeset 2603772
- Timestamp:
- 09/23/2021 03:37:23 PM (5 years ago)
- Location:
- triggerfish-bytbil-accesspaket
- Files:
-
- 3 deleted
- 4 edited
- 12 copied
-
tags/2.0.0 (copied) (copied from triggerfish-bytbil-accesspaket/trunk)
-
tags/2.0.0/assets/dist/1fbfd4bcffccb94e8e8a5ea70616b296.woff (copied) (copied from triggerfish-bytbil-accesspaket/trunk/assets/dist/1fbfd4bcffccb94e8e8a5ea70616b296.woff)
-
tags/2.0.0/assets/dist/2ec2cb2199d4d881e6a6ad86690f6add.svg (copied) (copied from triggerfish-bytbil-accesspaket/trunk/assets/dist/2ec2cb2199d4d881e6a6ad86690f6add.svg)
-
tags/2.0.0/assets/dist/f4292655f93dd12d9b8e4fc067ef2489.ttf (copied) (copied from triggerfish-bytbil-accesspaket/trunk/assets/dist/f4292655f93dd12d9b8e4fc067ef2489.ttf)
-
tags/2.0.0/frontend/build/asset-manifest.json (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/asset-manifest.json)
-
tags/2.0.0/frontend/build/index.html (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/index.html)
-
tags/2.0.0/frontend/build/service-worker.js (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/service-worker.js)
-
tags/2.0.0/frontend/build/static/css/main.39f3e57c.chunk.css (deleted)
-
tags/2.0.0/frontend/build/static/css/main.984009d9.chunk.css (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/static/css/main.984009d9.chunk.css)
-
tags/2.0.0/frontend/build/static/js/2.08df9016.chunk.js (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/static/js/2.08df9016.chunk.js)
-
tags/2.0.0/frontend/build/static/js/2.7e4a21eb.chunk.js (deleted)
-
tags/2.0.0/frontend/build/static/js/main.19d34827.chunk.js (copied) (copied from triggerfish-bytbil-accesspaket/trunk/frontend/build/static/js/main.19d34827.chunk.js)
-
tags/2.0.0/frontend/build/static/js/main.a3bdaa75.chunk.js (deleted)
-
tags/2.0.0/readme.txt (copied) (copied from triggerfish-bytbil-accesspaket/trunk/readme.txt) (1 diff)
-
tags/2.0.0/templates/single-page-parts/finance-data.php (modified) (2 diffs)
-
tags/2.0.0/triggerfish-bytbil-accesspaket.php (copied) (copied from triggerfish-bytbil-accesspaket/trunk/triggerfish-bytbil-accesspaket.php) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/templates/single-page-parts/finance-data.php (modified) (2 diffs)
-
trunk/triggerfish-bytbil-accesspaket.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
triggerfish-bytbil-accesspaket/tags/2.0.0/readme.txt
r2603621 r2603772 5 5 Tested up to: 5.3.2 6 6 Requires PHP: 7.3 7 Stable tag: 1.9.97 Stable tag: 2.0.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
triggerfish-bytbil-accesspaket/tags/2.0.0/templates/single-page-parts/finance-data.php
r2543635 r2603772 22 22 $dealer['emailAddressesInterest']; 23 23 } 24 25 function calculateMonthlyFrom($response, $currentPrice) 26 { 27 if (empty($response) || empty($response)) { 28 return; 29 } 30 31 if (empty($response['Rate']) || empty($response['MaxMonths']) || empty($response['MinUpfrontInPercent'])) { 32 return; 33 } 34 35 $rate = floatval($response['Rate']); 36 $maxMonths = intval($response['MaxMonths']); 37 $minUpfrontInPercent = floatval($response['MinUpfrontInPercent']); 38 $periodRate = ($rate / 12) * 0.01; 39 $totalRate = pow(1 + $periodRate, $maxMonths); 40 $restValue = 0; 41 $loanAmount = $currentPrice - ($currentPrice * $minUpfrontInPercent) / 100; 42 $monthCost = -(-$loanAmount * $totalRate + $restValue) / (($totalRate - 1) / $periodRate); 43 return ceil($monthCost); 44 } 45 46 $payment_per_month = calculateMonthlyFrom($response, $currentPrice); 24 47 ?> 48 49 25 50 26 51 <div id="tfap-price-container" class="tfap-primary-bg tfap-center-text" data-car-price="<?php echo $currentPrice; ?>" data-car-model-year="<?php echo $modelYear; ?>" data-repayment-months="<?php echo $response['DefaultMonthsSalvageValue']; ?>" data-car-cash="<?php echo $cash_min_value; ?>"> … … 33 58 <?php endif; ?> 34 59 35 <?php if ($response !== false && !$data['leasing']) : ?> 36 <?php $payment_per_month = ($currentPrice - $cash_min_value) / ($response['MaxMonths']); ?> 60 <?php if ($response !== false && !$data['leasing'] && !empty($payment_per_month)) : ?> 37 61 <p class="tfap-h5 tfap-mt1 tfap-color-white tfap-print-color-black"> 38 62 <?php -
triggerfish-bytbil-accesspaket/tags/2.0.0/triggerfish-bytbil-accesspaket.php
r2603621 r2603772 6 6 * Author URI: https://www.triggerfish.se 7 7 * Text Domain: access-package-integration 8 * Version: 1.9.98 * Version: 2.0.0 9 9 * Description: Plugin för att visa bilar till salu. 10 10 */ … … 16 16 } 17 17 18 define('TFAP_PLUGIN_VERSION', 1.9);18 define('TFAP_PLUGIN_VERSION', 2.0); 19 19 20 20 define('TFAP_PLUGIN_DIR', __DIR__); -
triggerfish-bytbil-accesspaket/trunk/readme.txt
r2603621 r2603772 5 5 Tested up to: 5.3.2 6 6 Requires PHP: 7.3 7 Stable tag: 1.9.97 Stable tag: 2.0.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
triggerfish-bytbil-accesspaket/trunk/templates/single-page-parts/finance-data.php
r2543635 r2603772 22 22 $dealer['emailAddressesInterest']; 23 23 } 24 25 function calculateMonthlyFrom($response, $currentPrice) 26 { 27 if (empty($response) || empty($response)) { 28 return; 29 } 30 31 if (empty($response['Rate']) || empty($response['MaxMonths']) || empty($response['MinUpfrontInPercent'])) { 32 return; 33 } 34 35 $rate = floatval($response['Rate']); 36 $maxMonths = intval($response['MaxMonths']); 37 $minUpfrontInPercent = floatval($response['MinUpfrontInPercent']); 38 $periodRate = ($rate / 12) * 0.01; 39 $totalRate = pow(1 + $periodRate, $maxMonths); 40 $restValue = 0; 41 $loanAmount = $currentPrice - ($currentPrice * $minUpfrontInPercent) / 100; 42 $monthCost = -(-$loanAmount * $totalRate + $restValue) / (($totalRate - 1) / $periodRate); 43 return ceil($monthCost); 44 } 45 46 $payment_per_month = calculateMonthlyFrom($response, $currentPrice); 24 47 ?> 48 49 25 50 26 51 <div id="tfap-price-container" class="tfap-primary-bg tfap-center-text" data-car-price="<?php echo $currentPrice; ?>" data-car-model-year="<?php echo $modelYear; ?>" data-repayment-months="<?php echo $response['DefaultMonthsSalvageValue']; ?>" data-car-cash="<?php echo $cash_min_value; ?>"> … … 33 58 <?php endif; ?> 34 59 35 <?php if ($response !== false && !$data['leasing']) : ?> 36 <?php $payment_per_month = ($currentPrice - $cash_min_value) / ($response['MaxMonths']); ?> 60 <?php if ($response !== false && !$data['leasing'] && !empty($payment_per_month)) : ?> 37 61 <p class="tfap-h5 tfap-mt1 tfap-color-white tfap-print-color-black"> 38 62 <?php -
triggerfish-bytbil-accesspaket/trunk/triggerfish-bytbil-accesspaket.php
r2603621 r2603772 6 6 * Author URI: https://www.triggerfish.se 7 7 * Text Domain: access-package-integration 8 * Version: 1.9.98 * Version: 2.0.0 9 9 * Description: Plugin för att visa bilar till salu. 10 10 */ … … 16 16 } 17 17 18 define('TFAP_PLUGIN_VERSION', 1.9);18 define('TFAP_PLUGIN_VERSION', 2.0); 19 19 20 20 define('TFAP_PLUGIN_DIR', __DIR__);
Note: See TracChangeset
for help on using the changeset viewer.