---
title: Promotion prices
slug: hyperdealer/promotion-prices
icon: 💶
docTags: 
createdAt: 2021-07-02T06:50:40.000Z
---

## General

Toyota and Lexus both have a **general discount** section also, whereby if there are 0 matches in the users given input we give a default discount of x% (user chooses) to that vehicle.

We **fetch** the vehicles from HyperPortal **every hour.**
We use the scheduled importer to **import&#x20;**&#x65;ach time after the normal import should have run, at the moment this is **3 times a day**

## Ciac Ford

[Link](https://docs.google.com/spreadsheets/d/1IK4NydTbht3a5lFD6VdlRybdGOQqtLvebjB9nEa3Q6A/edit)

Logic is based on 'Model' and part of the 'Vehicle description'.
Because of the part of vehicle description we need there is an extra tab '**Description fetcher'.**
In this tab we take the version description of the vehicle (from the import file), which we lower case, and use this formula:

\=IF(ISBLANK(A2),"", IF(REGEXMATCH(A2,"mhev"), "mhev", IF(REGEXMATCH(A2,"phev"), "phev", IF(REGEXMATCH(A2,"fhev"), "fhev", IF(REGEXMATCH(A2,"raptor"), "raptor", "")))))

This formula just tries to extract matching version descriptions that the customer gave. Ideally we need to get a more dynamic function that uses the customers input to seek matching values.
At the moment every time a new type comes out this list needs to get expanded.

In the **'Discount Calulcation'&#x20;**&#x77;e concat:
&#x20;\- **'results » productLine » title'** from vehicle import
&#x20;\- **'finder'** column that we described above

Based on this we will find matches and apply discounts

## Ciac Lexus

[Link](https://docs.google.com/spreadsheets/d/1Oc9sdTq6gjYQ2y_dF9g0PMl3yVQzXr9xJAu9aBEXTAY/edit#gid=557999218)&#x20;

This one is very simple they just look at the model of the vehicle.
So in the discount '**Discount calculation'&#x20;**&#x77;e just use **'results » productLine » title'&#x20;**&#x74;o match what the user inputed in his first sheet.

## Ciac Toyota (Aalst/Gent)

[Link Aalst](https://docs.google.com/spreadsheets/d/1IK4NydTbht3a5lFD6VdlRybdGOQqtLvebjB9nEa3Q6A/edit#gid=557999218)
[Link Gent](https://docs.google.com/spreadsheets/d/1POLKHS7djzWgVdFUFNY0FJU6W10EMGhH5GjN7rrx0ew/edit)

Here the user can give in 3 values:
\- Model
\- Fuel
\- Version

Since 'Version is unique  (as opposed to version of Ford) we create a function whereby we IF the 'Version' is filled in, we use that or else we concat the 'Model' and 'Fuel'&#x20;

In the '**Discount calculation'&#x20;**&#x77;e concat (all from import file):
\- **'results » productLine » title'**
\- **'results » fuel » title'**
\- **'results » versionDescription'**

Since the logic is made up quite easily we can easily match the concat of this with the concat in the first sheet to apply discounts.


ToDo
----

With output options we can make sure we only output the data we really want and in always in the same order e.g.:

```javascript
results[].{entityId:entityId,productLine:productLine}
```

This will make sure that the google sheet cannot fail anymore (which has happened 2 times so far)

::Image[]{src="https://api.archbee.com/api/optimize/5goaGPkGyPYxtK7K75CEC/dUl0kAXbOG1_kKS2yRAOu_image.png" size="22" width="223" height="412" position="center" showCaption="false"}



&#x20;







****


****





