Created
May 1, 2020 15:37
-
-
Save ZgrK/e8452750b75599c1af6424686360805d to your computer and use it in GitHub Desktop.
Woocommerce Google Sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get isteği geldiğinde burası çalışacak | |
function doGet(e) { | |
return HtmlService.createHtmlOutput("request received"); | |
} | |
//Post isteği geldiğinde bu bölüm çalışacak | |
function doPost(e) { | |
var siteUrl = "https://wordpressyardim.com" | |
var myData = JSON.parse([e.postData.contents]); | |
var order_number = myData.number; | |
var order_created = myData.date_created; | |
var order_status = myData.status; | |
var order_total = myData.total; | |
var order_link = siteUrl +"/wp-admin/post.php?post="+myData.number+"&action=edit" | |
var timestamp = new Date(); | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
sheet.appendRow([timestamp,order_number,order_created,order_status,order_link,order_total]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment