Online quote tool (PHP)
=======================

A quote calculator for your website. Customers pick their property, see a price, and send
you their details (with photos for jobs that need them). You see every request in a private
admin page and by email.

What's in the folder
  quote.php            the page customers use
  admin.php            your private page: requests, business details, wording, prices, colours
  lib.php              shared code (don't open in a browser)
  config.php           the one setting you edit in a file: your setup code
  embed.js             the one line script for showing the tool inside another page
  wordpress/           optional WordPress plugin that adds a [quote_tool] shortcode
  data/                created automatically on first use. Holds your settings and requests.

Needs: normal PHP web hosting, PHP 7.4 or newer, with the GD image extension (almost every
host has it; it is only needed for photos and the logo). No database.

Setting it up
1. Open config.php in a text editor. Change CHANGE-ME to any private code. You'll type it
   once. Save.
2. Upload the whole folder to your site, for example as yoursite.com/quote/ (so the pages are
   /quote/quote.php and /quote/admin.php). PHP needs permission to write to the folder
   (755 usually works; use 775 if the data folder isn't created).
3. Visit /quote/admin.php. Enter your setup code and create a password (10 characters or more).
4. Business tab: your business name, phone number, email, website, what you quote for, currency
   and logo. Settings tab: your towns. Until the name, phone and towns are filled in, customers
   see a "being set up" message instead of the tool (you can still preview it while logged in).
5. Prices tab: put in your real prices and press Save prices. That opens the tool to customers.
6. Wording tab and Colours tab: make it sound and look like you.
7. Settings tab shows the link and the embed code to put it on your website.

Everything you can change in the admin page
- Business: name, tagline, your first name, phone, email, website, what you quote for, currency
  symbol, time zone, where requests are emailed, the address emails are sent from, logo.
- Wording: every sentence on the quote page, the thank you message and the headings. Type
  {name}, {phone}, {email}, {owner}, {service}, {website}, {tagline} or {areas} in any of them
  and they fill in automatically.
- Prices: base prices by bedrooms, property types (rename, remove, add your own), extras,
  frequencies (rename, hide, add your own), skylights, conservatory sizes, other jobs, and how
  many photos a customer can add.
- Colours: the quote box, the top bar and the colour of the options customers pick, with ready
  made looks and a live preview.
- Settings: your towns and villages, the embed code, your password.

Adding your own services
On the Prices tab, under "Other jobs", use "Add a service": type a name, a short description
and a price, then press Save prices. It appears on the quote page straight away. To take one
off, tick Remove next to it and save. The three built in jobs can be renamed, repriced or
hidden, but not removed.

How the prices work
- Base price: set per number of bedrooms (2 to 5). Customers who pick 6+ bedrooms see "Please
  call" with your number, and can send their details to be rung back.
- Percentages: property type and the 8 weekly, one off and first clean changes are all
  percentages with - and + buttons. Minus takes off, plus adds.
- Frequencies: each one has a switch to hide it from the quote page. "Add a frequency" makes
  your own, such as 2 weekly or 12 weekly, as a percentage change on the 4 weekly price. At
  least one has to stay shown.
- First clean: your regular price plus a percentage, or switch on "Charge the first clean the
  same as a one off clean".
- Skylights: customers say how many. Each adds your price per skylight to every clean.
- Conservatory: small, medium or large. Each adds a price to every clean, plus an extra amount
  on the first clean and on one off cleans.
- Photos: every job under "Other jobs" needs a photo to start with (switch that off per job in
  the Photo needed column). The customer's browser shrinks each photo, the server checks it is
  a real picture and saves a clean copy. You see them as thumbnails on the Requests tab, only
  while logged in. Deleting a request deletes its photos.
  Photos are stored in data/uploads. On Apache hosting the data folder is blocked from the web
  automatically. If your host uses nginx, ask them to deny web access to the data folder.

Putting the tool inside one of your own pages
You don't have to send people to quote.php. The Settings tab shows the exact code for your site.
- Any website: paste <script src="https://yoursite.com/quote/embed.js"></script> where you want
  the tool. It shows inside your page and resizes itself, so there's no scroll bar. (Add
  <div id="quote-tool"></div> first if you want to choose exactly where it goes.)
- WordPress: upload wordpress/quote-tool-shortcode.php to wp-content/plugins, switch it on under
  Plugins, then type [quote_tool] on any page. If the quote folder isn't at yoursite.com/quote/,
  use [quote_tool url="https://yoursite.com/yourfolder/"].
- Website builders that can't run PHP (such as Wix) can still show it with their Embed element
  using the script or an iframe, as long as the quote folder is on a PHP host somewhere.
Inside another page the tool drops the top bar and footer (your page already has its own) and
shows the quote box under the form instead of pinned to the bottom of the screen.

Updating from an earlier version
Replace lib.php, quote.php, admin.php and README.txt. Leave the data folder alone. Your prices,
colours and requests carry over. If you used to keep your setup code in lib.php, it now lives in
config.php (you only need it again if you ever delete the data folder).

What stays fixed (not editable in the admin page)
Small bits of wording such as "Included", "Quote to follow", "First clean:" and "One off
extras", the bedroom range (2 to 5, then 6+), and error messages. Everything else is yours.

Good to know
- Requests are saved in admin.php and also emailed to you. If emails don't arrive, check spam,
  then ask your host about PHP mail(). Setting "Emails are sent from" to a real mailbox on your
  own domain helps. The saved list in admin.php is always the backup.
- Prices are worked out again on the server when a request comes in, so customers can't change
  the numbers.
- Back up the data folder now and then if you want a copy of your requests and settings.
- To show the tool inside an existing page rather than linking to it, use the embed code on the
  Settings tab.

Free and full versions
  This download is the free version until a licence is added. The free version has the quote
  calculator, 5 towns, your prices and a notification email, with a small "Powered by BuzzQuote"
  link. The full version adds photos, customer confirmation emails, WhatsApp, extras, custom
  frequencies, unlimited towns, colours, fonts, logo, wording and removes the link.
  Licences are on sale at buzzquote.net/buy (£29.49 a year, one website, renews yearly). After buying, paste your key into the Licence box on the Settings tab of the admin and press Activate. No new download is needed. To move to another site, release the key from the Licence box (or at buzzquote.net/licence) and activate it on the new one. The site contacts buzzquote.net to switch the licence on and about once a day after that; it keeps working for up to 14 days if buzzquote.net can't be reached.

Backup and restore
  Admin, Settings tab: download a backup file (settings, requests, photos, logo) and restore it
  later or on another site. The admin password is never in the backup.
  backup.php           code for that (don't open in a browser)

Copyright and licence
  BuzzQuote is copyright (c) 2026 Plunge Studios. All rights reserved. https://buzzquote.net
  It is licensed for use, not sold. The free version may be used on your own website, and the full version on the website named in your licence. Please do not copy, resell, share or redistribute it, or remove the copyright notices.
