-
-
Save ZgrK/314440169d8e7d487d440fea9f8f83fa to your computer and use it in GitHub Desktop.
Woocommerce Google Sheets https://wordpressyardim.com/woocommerce-siparislerinizi-canli-olarak-google-sheets-aktarma
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