本文整理汇总了TypeScript中woocommerce-api类的典型用法代码示例。如果您正苦于以下问题:TypeScript woocommerce-api类的具体用法?TypeScript woocommerce-api怎么用?TypeScript woocommerce-api使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce-api类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor() {
this.Woocommerce = WC({
url:"http://arvactur.000webhostapp.com/wordpress-4.9.1/wordpress/",
consumerKey:"ck_524a1b27aa955b9a5b481ce41c454295645c1320",
consumerSecret:"cs_881e9343fbe3133c8cf50b7c1856f69eb5bbe45b"
});
this.WoocommerceV2 = WC({
url:"http://arvactur.000webhostapp.com/wordpress-4.9.1/wordpress/",
consumerKey:"ck_524a1b27aa955b9a5b481ce41c454295645c1320",
consumerSecret:"cs_881e9343fbe3133c8cf50b7c1856f69eb5bbe45b",
wpAPI: true,
version: "wc/v2"
});
}
开发者ID:arvac,项目名称:woo,代码行数:15,代码来源:woocommerce.ts
示例2: constructor
constructor() {
this.WooCommerce = WC({
url: "http://samarth.cloudapp.net",
consumerKey: "ck_d6c5feec9ea1c407d2f91661c5137c6e3e48ae3b",
consumerSecret: "cs_de8e6cf03a5afd10491dfb1756415ac5a0169ae8"
});
}
开发者ID:musasesay,项目名称:wooionic3,代码行数:7,代码来源:woocommerce.ts
示例3: constructor
constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public alertCtrl: AlertController, public payPal: PayPal) {
this.newOrder = {};
this.newOrder.billing_address = {};
this.newOrder.shipping_address = {};
this.billing_shipping_same = false;
this.paymentMethods = [
{ method_id: "bacs", method_title: "Direct Bank Transfer" },
{ method_id: "cheque", method_title: "Cheque Payment" },
{ method_id: "cod", method_title: "Cash on Delivery" },
{ method_id: "paypal", method_title: "PayPal" }];
this.WooCommerce = WC({
url: "http://samarth.southeastasia.cloudapp.azure.com",
consumerKey: "ck_a55da2f5918a380ed8565ba180fb04f4ec67f304",
consumerSecret: "cs_3a5776160220af80f004a6983942fc5e06de22a4"
});
this.storage.get("userLoginInfo").then((userLoginInfo) => {
this.userInfo = userLoginInfo.user;
let email = userLoginInfo.user.email;
this.WooCommerce.getAsync("customers/email/" + email).then((data) => {
this.newOrder = JSON.parse(data.body).customer;
})
})
}
开发者ID:musasesay,项目名称:wooionic3,代码行数:33,代码来源:checkout.ts
示例4: constructor
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.page = 1;
this.category = this.navParams.get("category");
this.WooCommerce = WC({
url: "http://samarth.southeastasia.cloudapp.azure.com",
consumerKey: "ck_a55da2f5918a380ed8565ba180fb04f4ec67f304",
consumerSecret: "cs_3a5776160220af80f004a6983942fc5e06de22a4"
});
this.WooCommerce.getAsync("products?filter[category]=" + this.category.slug).then((data) => {
console.log(JSON.parse(data.body));
this.products = JSON.parse(data.body).products;
}, (err) => {
console.log(err)
})
}
开发者ID:musasesay,项目名称:wooionic3,代码行数:20,代码来源:products-by-category.ts
示例5: constructor
constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public modalCtrl: ModalController, private events: Events) {
this.homePage = 'HomePage';
this.categories = [];
this.user = {};
this.WooCommerce = WC({
url: "http://samarth.southeastasia.cloudapp.azure.com",
consumerKey: "ck_a55da2f5918a380ed8565ba180fb04f4ec67f304",
consumerSecret: "cs_3a5776160220af80f004a6983942fc5e06de22a4"
});
this.WooCommerce.getAsync("products/categories").then((data) => {
console.log(JSON.parse(data.body).product_categories);
let temp: any[] = JSON.parse(data.body).product_categories;
for (let i = 0; i < temp.length; i++) {
if (temp[i].parent == 0) {
temp[i].subCategories = [];
if (temp[i].slug == "clothing") {
temp[i].icon = "shirt";
}
if (temp[i].slug == "music") {
temp[i].icon = "musical-notes";
}
if (temp[i].slug == "posters") {
temp[i].icon = "images";
}
this.categories.push(temp[i]);
}
}
//Groups Subcategories
for (let i = 0; i < temp.length; i++){
for (let j = 0; j < this.categories.length; j++){
//console.log("Checking " + j + " " + i)
if(this.categories[j].id == temp[i].parent){
this.categories[j].subCategories.push(temp[i]);
}
}
}
}, (err) => {
console.log(err)
});
this.events.subscribe("updateMenu", () => {
this.storage.ready().then(() => {
this.storage.get("userLoginInfo").then((userLoginInfo) => {
if (userLoginInfo != null) {
console.log("User logged in...");
this.user = userLoginInfo.user;
console.log(this.user);
this.loggedIn = true;
}
else {
console.log("No user found.");
this.user = {};
this.loggedIn = false;
}
})
});
})
}
开发者ID:musasesay,项目名称:wooionic3,代码行数:76,代码来源:menu.ts
注:本文中的woocommerce-api类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论