Skip to content

Instantly share code, notes, and snippets.

@aliaramli
Last active February 21, 2021 11:39
Show Gist options
  • Save aliaramli/e36b2a7a16f618740cf46095d9ec13bd to your computer and use it in GitHub Desktop.
Save aliaramli/e36b2a7a16f618740cf46095d9ec13bd to your computer and use it in GitHub Desktop.
<?php
/** Template Name: Page Delivery Calculator
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WordPress
* @subpackage Storefront Child
* @since Storefront Child 1.0
*/
?>
<html>
<?php get_header(); ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script defer src="https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=yY" type="text/javascript"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" id="bootstrap-css" rel="stylesheet" />
</head>
<body>
<div id="primary" class="content-area">
<div class="container">
<div class="row">
<div class="col-md-6">
<form id="distance_form">
<div class="form-group"><label>Store Location: </label> <input class="form-control" id="from_places" placeholder="Jalan USJ 6/4, Usj 6, Subang Jaya, Selangor, Malaysia" disabled /> <input id="origin" name="origin" required="" type="hidden" value="Jalan USJ 6/4, Usj 6, Subang Jaya, Selangor, Malaysia" /></div>
<div class="form-group"><label>Delivery Destination: </label> <input class="form-control" id="to_places" placeholder="Enter a location" /> <input id="destination" name="destination" required="" type="hidden" /></div>
<input class="btn btn-primary" type="submit" value="Calculate" /></form>
<div id="result">
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">Distance in KM: <label id="in_kilo"> </label> </li>
<li class="list-group-item d-flex justify-content-between align-items-center">Delivery charge estimation, accurate address accurate calculation: <label id="delivery_charge"> </label></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment