Skip to main content

Google site with mini e-commerce features

Perfect! You want a self-contained order form on your site where the user enters Product Code, Quantity, and Price, and the total amount is automatically calculated using embedded HTML + JavaScript. Here’s a clean solution you can embed directly into Google Sites.


HTML + JavaScript Order Form

<div style="max-width:500px; margin:auto; font-family:sans-serif;">
  <h3>Place Your Order</h3>

  <table id="orderTable" style="width:100%; border-collapse: collapse;">
    <tr>
      <th style="border-bottom:1px solid #ccc;">Product Code</th>
      <th style="border-bottom:1px solid #ccc;">Quantity</th>
      <th style="border-bottom:1px solid #ccc;">Price (₹)</th>
      <th style="border-bottom:1px solid #ccc;">Subtotal (₹)</th>
    </tr>
    <tr>
      <td><input type="text" class="pcode" placeholder="GR01"></td>
      <td><input type="number" class="qty" value="1" min="1"></td>
      <td><input type="number" class="price" value="0" min="0"></td>
      <td class="subtotal">0</td>
    </tr>
  </table>

  <button onclick="addRow()" style="margin-top:10px;">Add Another Product</button>

  <h4>Total: ₹<span id="total">0</span></h4>

  <h4>Delivery Details</h4>
  <input type="text" id="name" placeholder="Your Name" style="width:100%; margin:5px 0;">
  <input type="text" id="phone" placeholder="Phone Number" style="width:100%; margin:5px 0;">
  <textarea id="address" placeholder="Delivery Address" style="width:100%; margin:5px 0;"></textarea>

  <button onclick="submitOrder()" style="margin-top:10px;">Submit Order</button>
</div>

<script>
function calculateTotal() {
  let total = 0;
  const rows = document.querySelectorAll("#orderTable tr:not(:first-child)");
  rows.forEach(row => {
    const qty = parseFloat(row.querySelector(".qty").value) || 0;
    const price = parseFloat(row.querySelector(".price").value) || 0;
    const subtotal = qty * price;
    row.querySelector(".subtotal").innerText = subtotal.toFixed(2);
    total += subtotal;
  });
  document.getElementById("total").innerText = total.toFixed(2);
}

// Add new product row
function addRow() {
  const table = document.getElementById("orderTable");
  const row = table.insertRow();
  row.innerHTML = `
    <td><input type="text" class="pcode" placeholder="Code"></td>
    <td><input type="number" class="qty" value="1" min="1"></td>
    <td><input type="number" class="price" value="0" min="0"></td>
    <td class="subtotal">0</td>
  `;
  row.querySelectorAll(".qty, .price").forEach(input => input.addEventListener("input", calculateTotal));
  calculateTotal();
}

// Listen for changes to recalc total
document.querySelectorAll(".qty, .price").forEach(input => input.addEventListener("input", calculateTotal));

function submitOrder() {
  calculateTotal();
  const rows = document.querySelectorAll("#orderTable tr:not(:first-child)");
  let orderDetails = "";
  rows.forEach((row, i) => {
    const code = row.querySelector(".pcode").value;
    const qty = row.querySelector(".qty").value;
    const price = row.querySelector(".price").value;
    orderDetails += `${i+1}. Code: ${code}, Quantity: ${qty}, Price: ₹${price}\n`;
  });
  const name = document.getElementById("name").value;
  const phone = document.getElementById("phone").value;
  const address = document.getElementById("address").value;
  const total = document.getElementById("total").innerText;

  // Prepare email link (mailto)
  const mailtoLink = `mailto:youremail@example.com?subject=New%20Order&body=Name:%20${encodeURIComponent(name)}%0APhone:%20${encodeURIComponent(phone)}%0AAddress:%20${encodeURIComponent(address)}%0AOrder:%0A${encodeURIComponent(orderDetails)}%0ATotal:%20₹${total}`;
  window.location.href = mailtoLink;
}
</script>

How it Works

  1. User enters Product Code, Quantity, Price.

  2. Subtotals and total are automatically calculated.

  3. Can add multiple products dynamically with “Add Another Product”.

  4. User fills name, phone, address.

  5. Clicking Submit Order opens the default email client with all order details pre-filled, ready to send to you.

  6. You can manually confirm payment via UPI/Instamojo/Razorpay separately.


Advantages

  • Fully embedded on Google Sites.

  • No backend needed.

  • Works instantly for small jewelry stores.

  • Automatic calculation of totals.

Limitations

  • Customers need to send email via their mail client.

  • Payments are handled manually via UPI or payment links.


If you want, I can make a version that also includes a UPI QR code or Razorpay link directly in the form so customers can pay instantly after filling the order — all on the same page.

Do you want me to add that next?

Comments

Popular posts from this blog

Digital Marketing Strategist, Animation Consultant, Production Coordinator, Researcher, and Project Development.

Here’s your finalized Resume and Application , incorporating all your roles, including Digital Marketing Strategist , Animation Consultant , Production Coordinator , Researcher , and Project Development insights: Application for Any Suitable Post Respected Sir/Madam, I am Hukumchand Dedhia , a seasoned professional with over 17 years of experience in Digital Marketing , Animation Consulting , Production Coordination , and Project Development . I have an extensive background in both multimedia education and digital marketing , and have had the opportunity to collaborate with several high-profile organizations to develop and implement successful marketing strategies. Over the years, I have honed my skills as an Animation Consultant and Production Coordinator in the fields of 2D and 3D animation , visual effects , and graphic design . I have been fortunate enough to contribute to the growth of animation studios and educational institutions, while helping companies grow their on...

Project Proposal Draft: Animation Project - "Untitled Animation Film"

Project Proposal Draft: Animation Project - "Untitled Animation Film" Project Overview The "Untitled Animation Film" is an ambitious 5-minute animation project that will leverage cutting-edge animation techniques, including 2D, 3D, VFX , and sound design to deliver an immersive visual experience. The project aims to create high-quality animation content suitable for OTT platforms , YouTube , merchandising , and more, generating long-term revenue through various revenue-sharing models. 1. Project Structure & Funding Model This proposal outlines a flexible funding model that encourages active participation from artists and project owners , with minimal upfront investment, while offering the potential for long-term revenue benefits. This model ensures that the Project Owner and Artists share both the production costs and revenue based on their shareholding percentage. The total production cost for the animation will be raised as needed , with both ...

WhatsApp Has Lost Credibility

10 Strong Reasons WhatsApp Has Lost Credibility 1. Forced Commercialization of the Platform WhatsApp shifted from a private, personal messaging app to a business-first ecosystem. Users feel the platform is now designed more for companies than for human conversations. 2. Explosion of Spam & Promotional Messages With Business accounts and easy onboarding to APIs, spam has surged. Many users now receive unsolicited offers, automated messages, and cold-pitches—something WhatsApp promised it would never allow. 3. Automation Has Made Conversations Feel Fake The “free API distribution” and chatbot builders have flooded WhatsApp with low-quality automation. Users can’t tell if they’re talking to a person or a bot—destroying trust in the platform. 4. Misuse by Unverified or Low-Quality Businesses WhatsApp APIs are now given out cheaply or freely through multiple partners, allowing poorly-vetted businesses to message users directly. This has led to scams, phishing attempts, and decep...