當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript woocommerce-api類代碼示例

本文整理匯總了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;未經允許,請勿轉載。