Create a homepage/frontpage with your product, here's an example:
Wooden Spoons
Welcome to my custom made wooden spoons store. I carve the best wooden spoons on the planet.
The best wooden spoons need the best payment system, which is why I use bitcoin to process my
payments online. If you are new to bitcoin you can go to bitcoin.org
to learn more and how to get started.
Latest Wooden Spoons For Sale
Buy Now! | Buy Now! | Buy Now! |
Buy Now! | Buy Now! | Buy Now! |
Then in order to process the payment create a separate PHP page for each item. This page can contain a form for the user to put in their shipping details. Then we generate a unique address for them to send their payment. After this an email is sent to your own personal email so you know who purchased what and which address they are sending your payment to:
Here's an example for item1.php file
$json = json_decode(file_get_contents($url), true);
$price = $json["ticker"]["last"];
$usdPrice = 20; // SET THE PRICE OF THE ITEM HERE
$calc = $usdPrice / $price;
$itemPrice = round($calc, 4);
$yourEmail = "[email protected]"; // ENTER YOUR EMAIL SO YOU CAN BE NOTIFIED WHEN SOMEONE BUYS SOMETHING
$emailTitle = "New Purchase";
$productName = "Enchanted Spoon"; // ENTER IN PRODUCT NAME
if(isset($_POST['submit'])){
$email = $_POST['email'];
$name = $_POST['name'];
$street = $_POST['street'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
//CREATE UNIQUE BITCOIN ADDRESS FOR PAYMENT
$id = "111aa111-aaa1-1111-a111-1111a111a1a1"; //YOUR UNIQUE BLOCKCHAIN.INFO ID
$pw = "correcthorsebatterystaple"; //YOUR BLOCKCHAIN.INFO PASSWORD
$new_address = "https://blockchain.info/merchant/$id/new_address?password=$pw";
$json_new_addr = json_decode(file_get_contents($new_address), true);
$display_address = $json_new_addr["address"];
$body = <<
New Purchase
Item Purchased: $productName
Email: $email
Name: $name
Street: $street
City: $city
State: $state
Zip: $zip
Payment Address: $display_address
Payment Amount: $itemPrice
EOD;
$headers = "From: [email protected]" ."\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail("$yourEmail", "$emailTitle", "$body", "$headers");
$message = "Thank you for your order!";
$message2 = "To finalize your order please send " . $itemPrice . " to " . $display_address;
$message3 = "We have emailed you this information if you have to pay later.";
$custEmail = <<
Please send payment to finalize your purchase
Payment Address: $display_address
Payment Amount: $itemPrice
Item Purchased: $productName
Email: $email
Name: $name
Street: $street
City: $city
State: $state
Zip: $zip
EOD;
$customerCopy = mail($email, "Wooden Spoons Purchase", $custEmail, $headers);
}
?>
Wooden Spoons
You selected to buy the Enchanted Spoon.
The Enchanted Spoon was carved by hand and coated with special shaman herbs.
It looks and smells great! You can use it to eat soup or just display it on a shelf.
Price: ฿echo $itemPrice; ?>
Shipping Information
echo "
";
echo $message2;
echo "
";
echo $message3;
?>