# Hsforms wordpress block

This wordpress plugin contains hsforms block which is basically a form to book rooms. It can be configured from block settings in the backend.

## 👉  `npm start`
- Use to compile and run the block in development mode.
- Watches for any changes and reports back any errors in your code.

Note: dont forget `npm install` and `composer install`

## 👉  `npm run build`
- Use to build production code for your block inside `dist` folder.
- Runs once and reports back the gzip file sizes of the produced code.

## 👉  `npm run eject`
- Use to eject your plugin out of `create-guten-block`.
- Provides all the configurations so you can customize the project as you want.
- It's a one-way street, `eject` and you have to maintain everything yourself.
- You don't normally have to `eject` a project because by ejecting you lose the connection with `create-guten-block` and from there onwards you have to update and maintain all the dependencies on your own.

## Templates override
Templates can be overridden in your plugin if needed:
```
$GLOBALS['hsforms']['view']['templateRootPaths'][100] = __DIR__ . '/Resources/Private/Templates/';
$GLOBALS['hsforms']['view']['partialRootPaths'][100] = __DIR__ . '/Resources/Private/Layouts/';
$GLOBALS['hsforms']['view']['layoutRootPaths'][100] = __DIR__ . '/Resources/Private/Partials/';
```

Note: Templates folder is wp-content/plugins/hsforms/src/Resources/Private/Templates

## Hsforms shortcode
There is a shortcode if dont want to use gutenberg block or have older wordpress like 4.x . Still gutenberg plugin is needed in older wordpress for hsforms to
work. shortcode is `[hsforms]` Attributes are given below:

- ibeurl (string)
- startdate (string e.g. "2020-11-10")
- enddate (string e.g. "2020-11-10")
- minnights (int)
- minadults (int)
- maxadults (int)
- minkinder (int)
- maxkinder (int)
- minrooms (int)
- maxrooms (int)
- btnlabel (string)
- allowedparams (string) 
- promocode (string)
- modaltitle (string)
- minlosbuffer (int e.g. 0, 1)
- isbutton (int e.g. 0, 1)
- keepparams (int e.g. 0, 1)
- promocodeflag (int e.g. 0, 1)
- addroomflag (int e.g. 0, 1)
- ratecodeflag (int e.g. 0, 1)
- segmentflag (int e.g. 0, 1)
- legendflag (int e.g. 0, 1)
- daysallowed (string e.g. "1,1,1,1,1,0,0")
