Skip to main content

Google site with mini e-commerce with QR pay

Perfect! Let’s upgrade your order form so the user can calculate totals AND pay instantly via UPI QR or Razorpay link — all embedded in the same Google Sites page. Here’s a ready-to-use HTML + JS snippet:


HTML + JavaScript Order Form with Payment

<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>

  <h4>Payment</h4>
  <p>Scan UPI QR to pay or click Razorpay link</p>
  <img src="YOUR_UPI_QR_URL_HERE" alt="UPI QR Code" style="width:150px;">
  <br>
  <a href="#" id="razorpayLink" target="_blank" style="display:inline-block; margin-top:10px; padding:8px 12px; background:#0c6efd; color:white; text-decoration:none; border-radius:4px;">Pay via Razorpay</a>

  <button onclick="submitOrder()" style="margin-top:10px; display:block;">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);

  // Update Razorpay link dynamically
  const amount = total * 100; // Razorpay amount in paise
  document.getElementById("razorpayLink").href = `https://rzp.io/l/YOUR_RAZORPAY_LINK?amount=${amount}`;
}

// 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;

  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>

Instructions for You

  1. Replace YOUR_UPI_QR_URL_HERE with your UPI QR image URL.

  2. Replace YOUR_RAZORPAY_LINK with your Razorpay checkout link.

    • The script will automatically append the correct total amount in paise.

  3. Embed this HTML snippet in Google Sites → Embed → Embed Code.

  4. Users can:

    • Enter product codes, quantity, and price.

    • See total automatically.

    • Pay immediately via UPI QR scan or Razorpay button.

    • Submit the order to your email via mailto.


This is fully self-contained and gives your customers a seamless flow: calculate → pay → send order.

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 ...

Electricity ; India and Life of People evolved

Electricity India  and Life of People evolved India is land of rich culture and heritage. After independence lt started to flourish with lots of development. Earlier life started with sunrise and rested with sunset. Then Slowly people had Single tungsten bulb and people started using it  For better life.  1 bulb  (40,60,100 watts)~  Monthly Charges about  (Rs.60 ~120/ -) Which gradually went upto  2 tube lights and one fan. Monthly charges went upto  (Rs.160/- ~200/ -) Slowly Radio and T.V. was also introduce which also increased consumption and rise in monthly bills reflected.  With limited supply and consumption it was well managed. Life was going well with it. Introduction of very much kitchen appliances also ease the life.  Mixy and grinder, Toaster, blender (boss) occasionally increased the consumption and reflected bill. Water gyser and water pump also added the charm to life. In situations specially morning if gyser...