├── .editorconfig ├── .gitignore ├── .sourcemaps ├── 0.js.map ├── 1.js.map ├── 2.js.map ├── 3.js.map ├── 4.js.map ├── 5.js.map ├── 6.js.map ├── 7.js.map └── main.js.map ├── Play Store Assets ├── Screenshot_1.png ├── Screenshot_2.png ├── Screenshot_3.png ├── Screenshot_4.png ├── WooIonic-512.png ├── WooIonic-feature-graphic.png └── WooIonic-promo-graphic.png ├── README.md ├── WooIonic.apk ├── config.xml ├── desktop.ini ├── ionic.config.json ├── my-release-key.keystore ├── package.json ├── resources ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── ios │ ├── icon │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ ├── icon-83.5@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ └── Default~iphone.png └── splash.png ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ ├── icon │ │ └── favicon.ico │ └── images │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── banner.jpg │ │ ├── banner2.jpg │ │ ├── clothing.jpg │ │ ├── logo.png │ │ ├── music.jpg │ │ ├── poster.jpg │ │ └── rock.png ├── declarations.d.ts ├── index.html ├── manifest.json ├── pages │ ├── cart │ │ ├── cart.html │ │ ├── cart.scss │ │ └── cart.ts │ ├── checkout │ │ ├── checkout.html │ │ ├── checkout.module.ts │ │ ├── checkout.scss │ │ └── checkout.ts │ ├── home │ │ ├── home.html │ │ ├── home.module.ts │ │ ├── home.scss │ │ └── home.ts │ ├── login │ │ ├── login.html │ │ ├── login.module.ts │ │ ├── login.scss │ │ └── login.ts │ ├── menu │ │ ├── menu.html │ │ ├── menu.module.ts │ │ ├── menu.scss │ │ └── menu.ts │ ├── product-details │ │ ├── product-details.html │ │ ├── product-details.module.ts │ │ ├── product-details.scss │ │ └── product-details.ts │ ├── products-by-category │ │ ├── products-by-category.html │ │ ├── products-by-category.module.ts │ │ ├── products-by-category.scss │ │ └── products-by-category.ts │ ├── search │ │ ├── search.html │ │ ├── search.module.ts │ │ ├── search.scss │ │ └── search.ts │ └── signup │ │ ├── signup.html │ │ ├── signup.module.ts │ │ ├── signup.scss │ │ └── signup.ts ├── providers │ └── woocommerce │ │ └── woocommerce.ts ├── service-worker.js └── theme │ └── variables.scss ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | 10 | # We recommend you to keep these unchanged 11 | end_of_line = lf 12 | charset = utf-8 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.tmp 8 | *.tmp.* 9 | log.txt 10 | *.sublime-project 11 | *.sublime-workspace 12 | .vscode/ 13 | npm-debug.log* 14 | 15 | .idea/ 16 | .sass-cache/ 17 | .tmp/ 18 | .versions/ 19 | coverage/ 20 | dist/ 21 | node_modules/ 22 | tmp/ 23 | temp/ 24 | hooks/ 25 | platforms/ 26 | plugins/ 27 | plugins/android.json 28 | plugins/ios.json 29 | www/ 30 | $RECYCLE.BIN/ 31 | 32 | .DS_Store 33 | Thumbs.db 34 | UserInterfaceState.xcuserstate 35 | -------------------------------------------------------------------------------- /.sourcemaps/0.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/signup/signup.module.ts","../../src/pages/signup/signup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACd;AAalC,IAAa,YAAY;IAAzB;IAA2B,CAAC;IAAD,mBAAC;AAAD,CAAC;AAAf,YAAY;IAXxB,uEAAQ,CAAC;QACR,YAAY,EAAE;YACZ,uDAAM;SACP;QACD,OAAO,EAAE;YACP,sEAAe,CAAC,QAAQ,CAAC,uDAAM,CAAC;SACjC;QACD,OAAO,EAAE;YACP,uDAAM;SACP;KACF,CAAC;GACW,YAAY,CAAG;AAAH;;;;;;;;;;;;;;;;;;;;;;ACfiB;AACiD;AAEb;AAO9E,IAAa,MAAM;IAOjB,gBAAmB,OAAsB,EAAS,SAAoB,EAAS,SAA0B,EAAS,SAA0B,EAAU,EAA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,EAAC,QAAQ,CAAC,QAAQ,CAAC,EAAC;gBACpB,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACpB,KAAK,EAAE,iBAAiB;oBACxB,OAAO,EAAE,sEAAsE;oBAC/E,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,OAAO;4BACb,OAAO,EAAE;gCACP,MAAM;4BACR,CAAC;yBACF,CAAC;iBACH,CAAC,CAAC,OAAO,EAAE,CAAC;YACf,CAAC;YAAC,IAAI,CAAC,EAAE,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAC;gBACzB,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACpB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO;oBACnC,eAAe,EAAE,IAAI;iBACtB,CAAC,CAAC,OAAO,EAAE,CAAC;YACf,CAAC;QAEH,CAAC,CAAC;IAEJ,CAAC;IAEL,aAAC;AAAD,CAAC;AA5IY,MAAM;IAJlB,wEAAS,CAAC;QACT,QAAQ,EAAE,aAAa;OACG;KAC3B,CAAC;WAQ6K;AAqI9K;SA5IY,MAAM,mB","file":"0.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { Signup } from './signup';\r\n\r\n@NgModule({\r\n declarations: [\r\n Signup,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(Signup),\r\n ],\r\n exports: [\r\n Signup\r\n ]\r\n})\r\nexport class SignupModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/signup/signup.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, ToastController, AlertController } from 'ionic-angular';\r\nimport * as WC from 'woocommerce-api';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-signup',\r\n templateUrl: 'signup.html',\r\n})\r\nexport class Signup {\r\n\r\n\r\n newUser: any = {};\r\n billing_shipping_same: boolean;\r\n WooCommerce: any;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController, public alertCtrl: AlertController, private WP: WoocommerceProvider) {\r\n\r\n this.newUser.billing_address = {};\r\n this.newUser.shipping_address = {};\r\n this.billing_shipping_same = false; \r\n\r\n //this.newUser.billing_address.country = \"India\"\r\n\r\n this.WooCommerce = WP.init();\r\n }\r\n\r\n ionViewDidLoad() {\r\n console.log('ionViewDidLoad Signup');\r\n }\r\n\r\n setBillingToShipping(){\r\n this.billing_shipping_same = !this.billing_shipping_same;\r\n }\r\n\r\n checkEmail(){\r\n\r\n let validEmail = false;\r\n\r\n let reg = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\r\n if(reg.test(this.newUser.email)){\r\n //email looks valid\r\n\r\n this.WooCommerce.getAsync('customers/email/' + this.newUser.email).then( (data) => {\r\n let res = (JSON.parse(data.body));\r\n\r\n if(res.errors){\r\n validEmail = true;\r\n\r\n this.toastCtrl.create({\r\n message: \"Congratulations. Email is good to go.\",\r\n duration: 3000\r\n }).present();\r\n\r\n } else {\r\n validEmail = false;\r\n\r\n this.toastCtrl.create({\r\n message: \"Email already registered. Please check.\",\r\n showCloseButton: true\r\n }).present();\r\n }\r\n\r\n console.log(validEmail);\r\n\r\n })\r\n\r\n\r\n\r\n } else {\r\n validEmail = false;\r\n this.toastCtrl.create({\r\n message: \"Invalid Email. Please check.\",\r\n showCloseButton: true\r\n }).present();\r\n console.log(validEmail);\r\n }\r\n\r\n }\r\n\r\n signup(){\r\n\r\n let customerData = {\r\n customer : {}\r\n }\r\n\r\n customerData.customer = {\r\n \"email\": this.newUser.email,\r\n \"first_name\": this.newUser.first_name,\r\n \"last_name\": this.newUser.last_name,\r\n \"username\": this.newUser.username,\r\n \"password\": this.newUser.password,\r\n \"billing_address\": {\r\n \"first_name\": this.newUser.first_name,\r\n \"last_name\": this.newUser.last_name,\r\n \"company\": \"\",\r\n \"address_1\": this.newUser.billing_address.address_1,\r\n \"address_2\": this.newUser.billing_address.address_2,\r\n \"city\": this.newUser.billing_address.city,\r\n \"state\": this.newUser.billing_address.state,\r\n \"postcode\": this.newUser.billing_address.postcode,\r\n \"country\": this.newUser.billing_address.country,\r\n \"email\": this.newUser.email,\r\n \"phone\": this.newUser.billing_address.phone\r\n },\r\n \"shipping_address\": {\r\n \"first_name\": this.newUser.first_name,\r\n \"last_name\": this.newUser.last_name,\r\n \"company\": \"\",\r\n \"address_1\": this.newUser.shipping_address.address_1,\r\n \"address_2\": this.newUser.shipping_address.address_2,\r\n \"city\": this.newUser.shipping_address.city,\r\n \"state\": this.newUser.shipping_address.state,\r\n \"postcode\": this.newUser.shipping_address.postcode,\r\n \"country\": this.newUser.shipping_address.country\r\n }\r\n }\r\n\r\n if(this.billing_shipping_same){\r\n this.newUser.shipping_address = this.newUser.shipping_address;\r\n }\r\n\r\n this.WooCommerce.postAsync('customers', customerData).then( (data) => {\r\n\r\n let response = (JSON.parse(data.body));\r\n\r\n if(response.customer){\r\n this.alertCtrl.create({\r\n title: \"Account Created\",\r\n message: \"Your account has been created successfully! Please login to proceed.\",\r\n buttons: [{\r\n text: \"Login\",\r\n handler: ()=> {\r\n //TODO\r\n }\r\n }]\r\n }).present();\r\n } else if(response.errors){\r\n this.toastCtrl.create({\r\n message: response.errors[0].message,\r\n showCloseButton: true\r\n }).present();\r\n }\r\n\r\n })\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/signup/signup.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/search/search.module.ts","../../src/pages/search/search.ts"],"names":[],"mappings":";;;;;;;;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CAAgB,GAAhB,UAAiB,KAAK;QAAtB,iBAmBC;QAjBC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,qBAAqB,GAAG,IAAI,CAAC,WAAW,GAAG,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAC,UAAU;YACzG,KAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;YAE3E,EAAE,EAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC,EAAC;gBACnD,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAEpB,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACpB,OAAO,EAAE,mBAAmB;oBAC5B,QAAQ,EAAE,IAAI;iBACf,CAAC,CAAC,OAAO,EAAE,CAAC;YAEf,CAAC;YAED,KAAK,CAAC,QAAQ,EAAE,CAAC;YACjB,KAAI,CAAC,IAAI,EAAG,CAAC;QAEf,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,iBAAC;AAAD,CAAC;AA7CY,UAAU;IAJtB,wEAAS,CAAC;QACT,QAAQ,EAAE,aAAa;OACG;KAC3B,CAAC;eAQ0I;AAsC3I;SA7CY,UAAU,e","file":"1.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { SearchPage } from './search';\r\n\r\n@NgModule({\r\n declarations: [\r\n SearchPage,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(SearchPage),\r\n ],\r\n exports: [\r\n SearchPage\r\n ]\r\n})\r\nexport class SearchPageModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/search/search.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, ToastController } from 'ionic-angular';\r\nimport * as WC from 'woocommerce-api';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-search',\r\n templateUrl: 'search.html',\r\n})\r\nexport class SearchPage {\r\n\r\n searchQuery: string = \"\";\r\n WooCommerce: any;\r\n products: any[] = [];\r\n page: number = 2;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController, private WP: WoocommerceProvider) {\r\n console.log(this.navParams.get(\"searchQuery\"));\r\n this.searchQuery = this.navParams.get(\"searchQuery\");\r\n\r\n this.WooCommerce = WP.init();\r\n\r\n this.WooCommerce.getAsync(\"products?filter[q]=\" + this.searchQuery).then((searchData) => {\r\n this.products = JSON.parse(searchData.body).products;\r\n });\r\n\r\n\r\n }\r\n\r\n ionViewDidLoad() {\r\n console.log('ionViewDidLoad SearchPage');\r\n }\r\n\r\n loadMoreProducts(event){\r\n\r\n this.WooCommerce.getAsync(\"products?filter[q]=\" + this.searchQuery + \"&page=\" + this.page).then((searchData) => {\r\n this.products = this.products.concat(JSON.parse(searchData.body).products);\r\n\r\n if(JSON.parse(searchData.body).products.length < 10){\r\n event.enable(false);\r\n\r\n this.toastCtrl.create({\r\n message: \"No more products!\",\r\n duration: 5000\r\n }).present();\r\n\r\n }\r\n\r\n event.complete();\r\n this.page ++;\r\n\r\n });\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/search/search.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/products-by-category/products-by-category.module.ts","../../src/pages/products-by-category/products-by-category.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACY;AAa5D,IAAa,wBAAwB;IAArC;IAAuC,CAAC;IAAD,+BAAC;AAAD,CAAC;AAA3B,wBAAwB;IAXpC,uEAAQ,CAAC;QACR,YAAY,EAAE;YACZ,i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;QACzC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,4BAA4B,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAC5G,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;YAE5C,KAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;YAC3B,KAAK,CAAC,QAAQ,EAAE,CAAC;YAEjB,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;gBACnB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC;IAED,4CAAe,GAAf,UAAgB,OAAO;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC,CAAE,CAAC;IAC7D,CAAC;IAEH,yBAAC;AAAD,CAAC;AA9CY,kBAAkB;IAJ9B,wEAAS,CAAC;QACT,QAAQ,EAAE,2BAA2B;OACG;KACzC,CAAC;uBAQuG;AAuCxG;SA9CY,kBAAkB,qB","file":"2.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { ProductsByCategory } from './products-by-category';\r\n\r\n@NgModule({\r\n declarations: [\r\n ProductsByCategory,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(ProductsByCategory),\r\n ],\r\n exports: [\r\n ProductsByCategory\r\n ]\r\n})\r\nexport class ProductsByCategoryModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/products-by-category/products-by-category.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams } from 'ionic-angular';\r\nimport * as WC from 'woocommerce-api';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n// import { ProductDetails } from '../product-details/product-details';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-products-by-category',\r\n templateUrl: 'products-by-category.html',\r\n})\r\nexport class ProductsByCategory {\r\n\r\n WooCommerce: any;\r\n products: any[];\r\n page: number;\r\n category: any;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, private WP: WoocommerceProvider) {\r\n\r\n this.page = 1;\r\n this.category = this.navParams.get(\"category\");\r\n\r\n this.WooCommerce = WP.init();\r\n\r\n this.WooCommerce.getAsync(\"products?filter[category]=\" + this.category.slug).then((data) => {\r\n console.log(JSON.parse(data.body));\r\n this.products = JSON.parse(data.body).products;\r\n }, (err) => {\r\n console.log(err)\r\n })\r\n\r\n }\r\n\r\n ionViewDidLoad() {\r\n console.log('ionViewDidLoad ProductsByCategory');\r\n }\r\n\r\n loadMoreProducts(event) {\r\n this.page++;\r\n console.log(\"Getting page \" + this.page);\r\n this.WooCommerce.getAsync(\"products?filter[category]=\" + this.category.slug + \"&page=\" + this.page).then((data) => {\r\n let temp = (JSON.parse(data.body).products);\r\n\r\n this.products = this.products.concat(JSON.parse(data.body).products)\r\n console.log(this.products);\r\n event.complete();\r\n\r\n if (temp.length < 10)\r\n event.enable(false);\r\n })\r\n }\r\n\r\n openProductPage(product){\r\n this.navCtrl.push('ProductDetails', {\"product\": product} );\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/products-by-category/products-by-category.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/3.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/product-details/product-details.module.ts","../../src/pages/product-details/product-details.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACG;AAanD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IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;wBAEzC,CAAC;wBAED,OAAO,CAAC,OAAO,EAAE,CAAC;;;;;KAEnB;IAEH,qBAAC;AAAD,CAAC;AAxOY,cAAc;IAJ1B,wEAAS,CAAC;QACT,QAAQ,EAAE,sBAAsB;OACG;KACpC,CAAC;mBAY8O;AA6N/O;SAxOY,cAAc,oB","file":"3.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { ProductDetails } from './product-details';\r\n\r\n@NgModule({\r\n declarations: [\r\n ProductDetails,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(ProductDetails),\r\n ],\r\n exports: [\r\n ProductDetails\r\n ]\r\n})\r\nexport class ProductDetailsModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/product-details/product-details.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, ToastController, ModalController, LoadingController } from 'ionic-angular';\r\nimport * as WC from 'woocommerce-api';\r\nimport { Cart } from '../cart/cart';\r\n\r\nimport { Storage } from '@ionic/storage';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-product-details',\r\n templateUrl: 'product-details.html',\r\n})\r\nexport class ProductDetails {\r\n\r\n product: any;\r\n WooCommerce: any;\r\n reviews: any[] = [];\r\n selectedOptions: any = {};\r\n requireOptions: boolean = true;\r\n productVariations: any[] = [];\r\n productPrice: number = 0.0;\r\n selectedVariation: any;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public toastCtrl: ToastController, public modalCtrl: ModalController, private WP: WoocommerceProvider, private loadingCtrl: LoadingController) {\r\n\r\n this.product = this.navParams.get(\"product\");\r\n console.log(this.product);\r\n\r\n this.WooCommerce = WP.init(true);\r\n\r\n this.WooCommerce.getAsync('products/' + this.product.id + '/reviews').then((data) => {\r\n\r\n this.reviews = JSON.parse(data.body);\r\n console.log(this.reviews);\r\n\r\n }, (err) => {\r\n console.log(err);\r\n })\r\n\r\n }\r\n\r\n addToCart(product) {\r\n\r\n //counting selected attribute options\r\n let count = 0;\r\n for (let k in this.selectedOptions) if (this.selectedOptions.hasOwnProperty(k)) count++;\r\n\r\n //counting variation attributes options\r\n let count_ = 0;\r\n for (var index = 0; index < this.product.attributes.length; index++) {\r\n \r\n if(this.product.attributes[index].variation)\r\n count_++;\r\n \r\n }\r\n\r\n //checking if user selected all the variation options or not\r\n\r\n if(count_ != count || this.requireOptions)\r\n {\r\n this.toastCtrl.create({\r\n message: \"Select Product Options\",\r\n duration: 2000,\r\n showCloseButton: true\r\n }).present();\r\n return; \r\n }\r\n\r\n\r\n\r\n this.storage.get(\"cart\").then((data) => {\r\n\r\n if (data == undefined || data.length == 0) {\r\n data = [];\r\n\r\n data.push({\r\n \"product\": product,\r\n \"qty\": 1,\r\n \"amount\": parseFloat(product.price)\r\n });\r\n\r\n if(this.selectedVariation){\r\n data[0].variation = this.selectedVariation;\r\n data[0].amount = parseFloat(this.selectedVariation.price);\r\n }\r\n\r\n } else {\r\n\r\n let alreadyAdded = false;\r\n let alreadyAddedIndex = -1;\r\n\r\n for (let i = 0; i < data.length; i++){\r\n if(data[i].product.id == product.id){ //Product ID matched\r\n if(this.productVariations.length > 0){ //Now match variation ID also if it exists\r\n if(data[i].variation.id == this.selectedVariation.id){\r\n alreadyAdded = true;\r\n alreadyAddedIndex = i;\r\n break;\r\n }\r\n } else { //product is simple product so variation does not matter\r\n alreadyAdded = true;\r\n alreadyAddedIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if(alreadyAdded == true){\r\n if(this.selectedVariation){\r\n data[alreadyAddedIndex].qty = parseFloat(data[alreadyAddedIndex].qty) + 1;\r\n data[alreadyAddedIndex].amount = parseFloat(data[alreadyAddedIndex].amount) + parseFloat(this.selectedVariation.price);\r\n data[alreadyAddedIndex].variation = this.selectedVariation;\r\n } else {\r\n data[alreadyAddedIndex].qty = parseFloat(data[alreadyAddedIndex].qty) + 1;\r\n data[alreadyAddedIndex].amount = parseFloat(data[alreadyAddedIndex].amount) + parseFloat(data[alreadyAddedIndex].product.price);\r\n } \r\n } else {\r\n if(this.selectedVariation){\r\n data.push({\r\n product: product,\r\n qty: 1,\r\n amount: parseFloat(this.selectedVariation.price),\r\n variation: this.selectedVariation\r\n })\r\n } else {\r\n data.push({\r\n product: product,\r\n qty: 1,\r\n amount: parseFloat(product.price)\r\n })\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n this.storage.set(\"cart\", data).then(() => {\r\n console.log(\"Cart Updated\");\r\n console.log(data);\r\n\r\n this.toastCtrl.create({\r\n message: \"Cart Updated\",\r\n duration: 3000\r\n }).present();\r\n\r\n })\r\n\r\n })\r\n\r\n }\r\n\r\n openCart(){\r\n\r\n this.modalCtrl.create(Cart).present();\r\n\r\n }\r\n\r\n async check(justSelectedAttribute) {\r\n\r\n let loading = this.loadingCtrl.create({\r\n content: \"Getting Product Variations\"\r\n });\r\n\r\n //counting selected attribute options\r\n let count = 0;\r\n for (let k in this.selectedOptions) \r\n if (this.selectedOptions.hasOwnProperty(k)) \r\n count++;\r\n\r\n let count_ = 0;\r\n for (var index = 0; index < this.product.attributes.length; index++) {\r\n \r\n if(this.product.attributes[index].variation)\r\n count_++;\r\n \r\n }\r\n\r\n //checking if user selected all the variation options or not\r\n\r\n if(count_ != count){\r\n this.requireOptions = true;\r\n return;\r\n } else {\r\n this.requireOptions = false;\r\n\r\n //Get product variations only once when all product variables are selected by the user\r\n loading.present();\r\n this.productVariations = JSON.parse((await this.WooCommerce.getAsync('products/' + this.product.id + '/variations/')).body);\r\n console.log(this.productVariations)\r\n }\r\n\r\n let i = 0, matchFailed = false;\r\n\r\n if (this.productVariations.length > 0) {\r\n for (i = 0; i < this.productVariations.length; i++) {\r\n matchFailed = false;\r\n let key: string = \"\";\r\n\r\n for (let j = 0; j < this.productVariations[i].attributes.length; j++) {\r\n key = this.productVariations[i].attributes[j].name;\r\n\r\n console.log(this.selectedOptions[key].toLowerCase()+ \" \" + this.productVariations[i].attributes[j].option.toLowerCase())\r\n\r\n if (this.selectedOptions[key].toLowerCase() == this.productVariations[i].attributes[j].option.toLowerCase()) {\r\n //Do nothing\r\n } else {\r\n console.log(matchFailed)\r\n matchFailed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (matchFailed) {\r\n continue;\r\n } else {\r\n //found the matching variation\r\n //console.log(productVariations[i])\r\n this.productPrice = this.productVariations[i].price;\r\n this.selectedVariation = this.productVariations[i];\r\n console.log(this.selectedVariation)\r\n\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n if(matchFailed == true){\r\n this.toastCtrl.create({\r\n message: \"No Such Product Found\",\r\n duration: 3000\r\n }).present().then(()=>{\r\n this.requireOptions = true;\r\n })\r\n }\r\n } else {\r\n this.productPrice = this.product.price;\r\n\r\n }\r\n\r\n loading.dismiss();\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/product-details/product-details.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/4.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/menu/menu.module.ts","../../src/pages/menu/menu.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AAClB;AAa9B,IAAa,cAAc;IAA3B;IAA6B,CAAC;IAAD,qBAAC;AAAD,CAAC;AAAjB,cAAc;IAX1B,uEAAQ,CAAC;QACR,YAAY,EAAE;YACZ,mDAAI;SACL;QACD,OAAO,EAAE;YACP,sEAAe,CAAC,QAAQ,CAAC,mDAAI,CAAC;SAC/B;QACD,OAAO,EAAE;YACP,mDAAI;SACL;KACF,CAAC;GACW,cAAc,CAAG;AAAH;;;;;;;;;;;;;;;;;;;;;;;;ACf0B;AAC6B;AAKlF,oFAAoF;AAC3C;AACL;AAC0C;AAO9E,IAAa,IAAI;IASf,cAAmB,OAAsB,EAAS,SAAoB,EAAS,OAAg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Q;QAEvB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE5E,CAAC;IAED,uBAAQ,GAAR,UAAS,QAAgB;QAAzB,iBAkBC;QAjBC,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;QACD,EAAE,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;QACD,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC;gBACxC,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;gBACf,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACxB,CAAC,CAAC;QACJ,CAAC;QACD,EAAE,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC;YACvB,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,wDAAI,CAAC,CAAC;YACxC,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IAEH,CAAC;IAEH,WAAC;AAAD,CAAC;AA/HuB;IAArB,0EAAS,CAAC,SAAS,CAAC;8BAAe,oEAAa;0CAAC;AALvC,IAAI;IAJhB,wEAAS,CAAC;QACT,QAAQ,EAAE,WAAW;OACG;KACzB,CAAC;SAU2L;AA2H5L;SApIY,IAAI,mB","file":"4.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { Menu } from './menu';\r\n\r\n@NgModule({\r\n declarations: [\r\n Menu,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(Menu),\r\n ],\r\n exports: [\r\n Menu\r\n ]\r\n})\r\nexport class MenuPageModule {}\n\n\n// WEBPACK FOOTER //\n// ./src/pages/menu/menu.module.ts","import { Component, ViewChild } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, ModalController, Events } from 'ionic-angular';\r\n// import { HomePage } from '../home/home';\r\n// import { Signup } from '../signup/signup';\r\n// import { Login } from '../login/login';\r\nimport * as WC from 'woocommerce-api';\r\n// import { ProductsByCategory } from '../products-by-category/products-by-category'\r\nimport { Storage } from '@ionic/storage';\r\nimport { Cart } from '../cart/cart';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-menu',\r\n templateUrl: 'menu.html',\r\n})\r\nexport class Menu {\r\n\r\n homePage: Component;\r\n WooCommerce: any;\r\n categories: any[];\r\n @ViewChild('content') childNavCtrl: NavController;\r\n loggedIn: boolean;\r\n user: any;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public modalCtrl: ModalController, private events: Events, private WP: WoocommerceProvider) {\r\n this.homePage = 'HomePage';\r\n this.categories = [];\r\n this.user = {};\r\n\r\n this.WooCommerce = WP.init();\r\n\r\n\r\n this.WooCommerce.getAsync(\"products/categories\").then((data) => {\r\n console.log(JSON.parse(data.body).product_categories);\r\n\r\n let temp: any[] = JSON.parse(data.body).product_categories;\r\n\r\n for (let i = 0; i < temp.length; i++) {\r\n if (temp[i].parent == 0) {\r\n\r\n temp[i].subCategories = [];\r\n\r\n if (temp[i].slug == \"clothing\") {\r\n temp[i].icon = \"shirt\";\r\n }\r\n if (temp[i].slug == \"music\") {\r\n temp[i].icon = \"musical-notes\";\r\n }\r\n if (temp[i].slug == \"posters\") {\r\n temp[i].icon = \"images\";\r\n }\r\n\r\n this.categories.push(temp[i]);\r\n } \r\n }\r\n\r\n //Groups Subcategories\r\n\r\n for (let i = 0; i < temp.length; i++){\r\n for (let j = 0; j < this.categories.length; j++){\r\n //console.log(\"Checking \" + j + \" \" + i)\r\n if(this.categories[j].id == temp[i].parent){\r\n this.categories[j].subCategories.push(temp[i]);\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n }, (err) => {\r\n console.log(err)\r\n });\r\n\r\n this.events.subscribe(\"updateMenu\", () => {\r\n this.storage.ready().then(() => {\r\n this.storage.get(\"userLoginInfo\").then((userLoginInfo) => {\r\n\r\n if (userLoginInfo != null) {\r\n\r\n console.log(\"User logged in...\");\r\n this.user = userLoginInfo.user;\r\n console.log(this.user);\r\n this.loggedIn = true;\r\n }\r\n else {\r\n console.log(\"No user found.\");\r\n this.user = {};\r\n this.loggedIn = false;\r\n }\r\n\r\n })\r\n });\r\n\r\n\r\n })\r\n }\r\n\r\n ionViewDidEnter() {\r\n\r\n this.storage.ready().then(() => {\r\n this.storage.get(\"userLoginInfo\").then((userLoginInfo) => {\r\n\r\n if (userLoginInfo != null) {\r\n\r\n console.log(\"User logged in...\");\r\n this.user = userLoginInfo.user;\r\n console.log(this.user);\r\n this.loggedIn = true;\r\n }\r\n else {\r\n console.log(\"No user found.\");\r\n this.user = {};\r\n this.loggedIn = false;\r\n }\r\n\r\n })\r\n })\r\n\r\n\r\n }\r\n\r\n openCategoryPage(category) {\r\n\r\n this.childNavCtrl.setRoot('ProductsByCategory', { \"category\": category });\r\n\r\n }\r\n\r\n openPage(pageName: string) {\r\n if (pageName == \"signup\") {\r\n this.navCtrl.push('Signup');\r\n }\r\n if (pageName == \"login\") {\r\n this.navCtrl.push('Login');\r\n }\r\n if (pageName == 'logout') {\r\n this.storage.remove(\"userLoginInfo\").then(() => {\r\n this.user = {};\r\n this.loggedIn = false;\r\n })\r\n }\r\n if (pageName == 'cart') {\r\n let modal = this.modalCtrl.create(Cart);\r\n modal.present();\r\n }\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/menu/menu.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/5.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/login/login.module.ts","../../src/pages/login/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AAChB;AAahC,IAAa,WAAW;IAAxB;IAA0B,CAAC;IAAD,kBAAC;AAAD,CAAC;AAAd,WAAW;IAXvB,uEAAQ,CAAC;QACR,YAAY,EAAE;YACZ,qDAAK;SACN;QACD,OAAO,EAAE;YACP,sEAAe,CAAC,QAAQ,CAAC,qDAAK,CAAC;SAChC;QACD,OAAO,EAAE;YACP,qDAAK;SACN;KACF,CAAC;GACW,WAAW,CAAG;AAAH;;;;;;;;;;;;;;;;;;;;;;;ACfkB;AACyD;AAC9D;AACI;AAOzC,IAAa,KAAK;IAKhB,eAAmB,OAAsB,EAAS,SAAoB,EAAS,IAAU,EAAS,SAA0B,EAAS,OAAgB,EAAS,SAA0B,EAAS,MAAc;QAA5L,YAAO,GAAP,OAAO,CAAe;QAAS,cAAS,GAAT,SAAS,CAAW;QAAS,SAAI,GAAJ,IAAI,CAAM;QAAS,cAAS,GAAT,SAAS,CAAiB;QAAS,YAAO,GAAP,OAAO,CAAS;QAAS,cAAS,GAAT,SAAS,CAAiB;QAAS,WAAM,GAAN,MAAM,CAAQ;QAE7M,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IAErB,CAAC;IAED,qBAAK,GAAL;QAAA,iBA8CC;QA5CC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,wGAAwG,GAAG,IAAI,CAAC,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;aACrK,SAAS,CAAE,UAAC,GAAG;YACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAExB,IAAI,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;YAE1B,EAAE,EAAC,QAAQ,CAAC,KAAK,CAAC,EAAC;gBACjB,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACpB,OAAO,EAAE,QAAQ,CAAC,KAAK;oBACvB,QAAQ,EAAE,IAAI;iBACf,CAAC,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC;YACT,CAAC;YAGD,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAE,UAAC,IAAI;gBAErD,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACpB,KAAK,EAAE,kBAAkB;oBACzB,OAAO,EAAE,uCAAuC;oBAChD,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,IAAI;4BACV,OAAO,EAAE;gCAEP,KAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;gCAElC,EAAE,EAAC,KAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAC;oCAC7B,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;gCAChD,CAAC;gCAAC,IAAI,CAAC,CAAC;oCACN,KAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;gCACrB,CAAC;4BACH,CAAC;yBACF,CAAC;iBACH,CAAC,CAAC,OAAO,EAAE,CAAC;YAGf,CAAC,CAAC;QAKJ,CAAC,CAAC,CAAC;IAGL,CAAC;IAEH,YAAC;AAAD,CAAC;AA5DY,KAAK;IAJjB,wEAAS,CAAC;QACT,QAAQ,EAAE,YAAY;OACG;KAC1B,CAAC;UAM+M;AAuDhN;SA5DY,KAAK,mB","file":"5.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { Login } from './login';\r\n\r\n@NgModule({\r\n declarations: [\r\n Login,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(Login),\r\n ],\r\n exports: [\r\n Login\r\n ]\r\n})\r\nexport class LoginModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/login/login.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, ToastController, AlertController, Events } from 'ionic-angular';\r\nimport { Http } from '@angular/http';\r\nimport { Storage } from '@ionic/storage';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-login',\r\n templateUrl: 'login.html',\r\n})\r\nexport class Login {\r\n\r\n username: string;\r\n password: string;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http, public toastCtrl: ToastController, public storage: Storage, public alertCtrl: AlertController, public events: Events) {\r\n\r\n this.username = \"\";\r\n this.password = \"\";\r\n\r\n }\r\n\r\n login(){\r\n\r\n this.http.get(\"http://samarth.southeastasia.cloudapp.azure.com/api/auth/generate_auth_cookie/?insecure=cool&username=\" + this.username + \"&password=\" + this.password)\r\n .subscribe( (res) => {\r\n console.log(res.json());\r\n\r\n let response = res.json();\r\n\r\n if(response.error){\r\n this.toastCtrl.create({\r\n message: response.error,\r\n duration: 5000\r\n }).present();\r\n return;\r\n }\r\n\r\n\r\n this.storage.set(\"userLoginInfo\", response).then( (data) =>{\r\n\r\n this.alertCtrl.create({\r\n title: \"Login Successful\",\r\n message: \"You have been logged in successfully.\",\r\n buttons: [{\r\n text: \"OK\",\r\n handler: () => {\r\n\r\n this.events.publish(\"updateMenu\");\r\n\r\n if(this.navParams.get(\"next\")){\r\n this.navCtrl.push(this.navParams.get(\"next\"));\r\n } else {\r\n this.navCtrl.pop();\r\n } \r\n }\r\n }]\r\n }).present();\r\n\r\n\r\n })\r\n\r\n\r\n\r\n\r\n });\r\n\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/login/login.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/6.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/home/home.module.ts","../../src/pages/home/home.ts"],"names":[],"mappings":";;;;;;;;;;;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O,EAAC,CAAE,CAAC;IAC7D,CAAC;IAED,2BAAQ,GAAR,UAAS,KAAK;QACZ,EAAE,EAAC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,EAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAC,aAAa,EAAE,IAAI,CAAC,WAAW,EAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAEH,eAAC;AAAD,CAAC;AA1E6B;IAA3B,0EAAS,CAAC,eAAe,CAAC;8BAAgB,6DAAM;+CAAC;AARvC,QAAQ;IAJpB,wEAAS,CAAC;QACT,QAAQ,EAAE,WAAW;OACG;KACzB,CAAC;aAW6G;AAwE9G;SAlFY,QAAQ,e","file":"6.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { HomePage } from './home';\r\n\r\n@NgModule({\r\n declarations: [\r\n HomePage,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(HomePage),\r\n ],\r\n exports: [\r\n HomePage\r\n ]\r\n})\r\nexport class HomePageModule {}\n\n\n// WEBPACK FOOTER //\n// ./src/pages/home/home.module.ts","import { Component, ViewChild } from '@angular/core';\r\nimport { IonicPage, NavController, Slides, ToastController } from 'ionic-angular';\r\n// import { ProductDetails } from '../product-details/product-details';\r\n\r\nimport * as WC from 'woocommerce-api';\r\n// import { SearchPage } from \"../search/search\";\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-home',\r\n templateUrl: 'home.html'\r\n})\r\nexport class HomePage {\r\n\r\n WooCommerce: any;\r\n products: any[];\r\n moreProducts: any[];\r\n page: number;\r\n searchQuery: string = \"\";\r\n\r\n @ViewChild('productSlides') productSlides: Slides;\r\n\r\n constructor(public navCtrl: NavController, public toastCtrl: ToastController, private WP: WoocommerceProvider) {\r\n\r\n this.page = 2;\r\n\r\n this.WooCommerce = WP.init();\r\n\r\n this.loadMoreProducts(null);\r\n\r\n this.WooCommerce.getAsync(\"products\").then( (data) => {\r\n console.log(JSON.parse(data.body));\r\n this.products = JSON.parse(data.body).products;\r\n }, (err) => {\r\n console.log(err)\r\n })\r\n\r\n }\r\n\r\n // ionViewDidLoad(){\r\n // setInterval(()=> {\r\n\r\n // if(this.productSlides.getActiveIndex() == this.productSlides.length() -1)\r\n // this.productSlides.slideTo(0);\r\n\r\n // this.productSlides.slideNext();\r\n // }, 3000)\r\n // }\r\n\r\n loadMoreProducts(event){\r\n console.log(event);\r\n if(event == null)\r\n {\r\n this.page = 2;\r\n this.moreProducts = [];\r\n }\r\n else\r\n this.page++;\r\n\r\n this.WooCommerce.getAsync(\"products?page=\" + this.page).then( (data) => {\r\n console.log(JSON.parse(data.body));\r\n this.moreProducts = this.moreProducts.concat(JSON.parse(data.body).products);\r\n\r\n if(event != null)\r\n {\r\n event.complete();\r\n }\r\n\r\n if(JSON.parse(data.body).products.length < 10){\r\n event.enable(false);\r\n\r\n this.toastCtrl.create({\r\n message: \"No more products!\",\r\n duration: 5000\r\n }).present();\r\n\r\n }\r\n\r\n\r\n }, (err) => {\r\n console.log(err)\r\n })\r\n }\r\n\r\n openProductPage(product){\r\n this.navCtrl.push('ProductDetails', {\"product\": product} );\r\n }\r\n\r\n onSearch(event){\r\n if(this.searchQuery.length > 0){\r\n this.navCtrl.push('SearchPage', {\"searchQuery\": this.searchQuery});\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/home/home.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/7.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../src/pages/checkout/checkout.module.ts","../../src/pages/checkout/checkout.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AACO;AACV;AAatC,IAAa,kBAAkB;IAA/B;IAAiC,CAAC;IAAD,yBAAC;AAAD,CAAC;AAArB,kBAAkB;IAX9B,uEA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V,OAAO,EAAE;oCACP,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gCACnC,CAAC;6BACF,CAAC;qBACH,CAAC,CAAC,OAAO,EAAE,CAAC;gBAEf,CAAC,CAAC;YAEJ,CAAC,CAAC;QAEJ,CAAC;IAGH,CAAC;IAEH,eAAC;AAAD,CAAC;AAjMY,QAAQ;IAJpB,wEAAS,CAAC;QACT,QAAQ,EAAE,eAAe;OACG;KAC7B,CAAC;aAU0L;AAwL3L;SAjMY,QAAQ,mB","file":"7.js","sourcesContent":["import { NgModule } from '@angular/core';\r\nimport { IonicPageModule } from 'ionic-angular';\r\nimport { Checkout } from './checkout';\r\n\r\n@NgModule({\r\n declarations: [\r\n Checkout,\r\n ],\r\n imports: [\r\n IonicPageModule.forChild(Checkout),\r\n ],\r\n exports: [\r\n Checkout\r\n ]\r\n})\r\nexport class CheckoutPageModule {}\n\n\n// WEBPACK FOOTER //\n// ./src/pages/checkout/checkout.module.ts","import { Component } from '@angular/core';\r\nimport { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';\r\nimport { Storage } from '@ionic/storage';\r\nimport * as WC from 'woocommerce-api';\r\n// import { HomePage } from '../home/home';\r\n// import { Menu } from '../menu/menu';\r\nimport { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal';\r\nimport { WoocommerceProvider } from '../../providers/woocommerce/woocommerce';\r\n\r\n@IonicPage({})\r\n@Component({\r\n selector: 'page-checkout',\r\n templateUrl: 'checkout.html',\r\n})\r\nexport class Checkout {\r\n\r\n WooCommerce: any;\r\n newOrder: any;\r\n paymentMethods: any[];\r\n paymentMethod: any;\r\n billing_shipping_same: boolean;\r\n userInfo: any;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public alertCtrl: AlertController, public payPal: PayPal, private WP: WoocommerceProvider) {\r\n this.newOrder = {};\r\n this.newOrder.billing = {};\r\n this.newOrder.shipping = {};\r\n this.billing_shipping_same = false;\r\n\r\n this.paymentMethods = [\r\n { method_id: \"bacs\", method_title: \"Direct Bank Transfer\" },\r\n { method_id: \"cheque\", method_title: \"Cheque Payment\" },\r\n { method_id: \"cod\", method_title: \"Cash on Delivery\" },\r\n { method_id: \"paypal\", method_title: \"PayPal\" }];\r\n\r\n this.WooCommerce = WP.init(true);\r\n\r\n this.storage.get(\"userLoginInfo\").then((userLoginInfo) => {\r\n\r\n this.userInfo = userLoginInfo.user;\r\n\r\n let email = userLoginInfo.user.email;\r\n let id = userLoginInfo.user.id;\r\n\r\n this.WooCommerce.getAsync(\"customers/\"+id).then((data) => {\r\n\r\n this.newOrder = JSON.parse(data.body);\r\n\r\n })\r\n\r\n })\r\n\r\n }\r\n\r\n setBillingToShipping() {\r\n this.billing_shipping_same = !this.billing_shipping_same;\r\n\r\n if (this.billing_shipping_same) {\r\n this.newOrder.shipping = this.newOrder.billing;\r\n }\r\n\r\n }\r\n\r\n placeOrder() {\r\n\r\n let orderItems: any[] = [];\r\n let data: any = {};\r\n\r\n let paymentData: any = {};\r\n\r\n this.paymentMethods.forEach((element, index) => {\r\n if (element.method_id == this.paymentMethod) {\r\n paymentData = element;\r\n }\r\n });\r\n\r\n\r\n data = {\r\n payment_details: {\r\n method_id: paymentData.method_id,\r\n method_title: paymentData.method_title,\r\n paid: true\r\n },\r\n\r\n billing: this.newOrder.billing,\r\n shipping: this.newOrder.shipping,\r\n customer_id: this.userInfo.id || '',\r\n line_items: orderItems\r\n };\r\n\r\n\r\n if (paymentData.method_id == \"paypal\") {\r\n\r\n this.payPal.init({\r\n PayPalEnvironmentProduction: \"YOUR_PRODUCTION_CLIENT_ID\",\r\n PayPalEnvironmentSandbox: \"AYkkS2ObeSpaObaCqA3bybQjRNRMKOw_2vNSha7gmxESpG4l4AhEyMfYwuzrUFKSbWGhCsN-Vhtl5FOG\"\r\n }).then(() => {\r\n // Environments: PayPalEnvironmentNoNetwork, PayPalEnvironmentSandbox, PayPalEnvironmentProduction\r\n this.payPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration({\r\n // Only needed if you get an \"Internal Service Error\" after PayPal login!\r\n //payPalShippingAddressOption: 2 // PayPalShippingAddressOptionPayPal\r\n })).then(() => {\r\n\r\n this.storage.get(\"cart\").then((cart) => {\r\n\r\n let total = 0.00;\r\n cart.forEach((element, index) => {\r\n\r\n if(element.variation){\r\n orderItems.push({ product_id: element.product.id, variation_id: element.variation.id, quantity: element.qty });\r\n total = total + (element.variation.price * element.qty);\r\n } else {\r\n orderItems.push({ product_id: element.product.id, quantity: element.qty });\r\n total = total + (element.product.price * element.qty);\r\n }\r\n });\r\n\r\n let payment = new PayPalPayment(total.toString(), 'USD', 'Description', 'sale');\r\n this.payPal.renderSinglePaymentUI(payment).then((response) => {\r\n // Successfully paid\r\n\r\n alert(JSON.stringify(response));\r\n\r\n\r\n data.line_items = orderItems;\r\n //console.log(data);\r\n let orderData: any = {};\r\n\r\n orderData.order = data;\r\n\r\n this.WooCommerce.postAsync('orders', orderData.order).then((data) => {\r\n alert(\"Order placed successfully!\");\r\n\r\n let response = (JSON.parse(data.body));\r\n\r\n this.alertCtrl.create({\r\n title: \"Order Placed Successfully\",\r\n message: \"Your order has been placed successfully. Your order number is \" + response.order_number,\r\n buttons: [{\r\n text: \"OK\",\r\n handler: () => {\r\n this.navCtrl.push('HomePage');\r\n }\r\n }]\r\n }).present();\r\n })\r\n\r\n })\r\n\r\n }, () => {\r\n // Error or render dialog closed without being successful\r\n });\r\n }, () => {\r\n // Error in configuration\r\n });\r\n }, () => {\r\n // Error in initialization, maybe PayPal isn't supported or something else\r\n });\r\n\r\n\r\n\r\n\r\n\r\n } else {\r\n\r\n this.storage.get(\"cart\").then((cart) => {\r\n\r\n cart.forEach((element, index) => {\r\n if(element.variation){\r\n orderItems.push({ product_id: element.product.id, variation_id: element.variation.id, quantity: element.qty });\r\n ///total = total + (element.variation.price * element.qty);\r\n } else {\r\n orderItems.push({ product_id: element.product.id, quantity: element.qty });\r\n ///total = total + (element.product.price * element.qty);\r\n }\r\n });\r\n\r\n data.line_items = orderItems;\r\n\r\n let orderData: any = {};\r\n\r\n orderData.order = data;\r\n\r\n this.WooCommerce.postAsync(\"orders\", orderData.order).then((data) => {\r\n\r\n let response = (JSON.parse(data.body));\r\n\r\n this.alertCtrl.create({\r\n title: \"Order Placed Successfully\",\r\n message: \"Your order has been placed successfully. Your order number is \" + response.order_number,\r\n buttons: [{\r\n text: \"OK\",\r\n handler: () => {\r\n this.navCtrl.setRoot('HomePage');\r\n }\r\n }]\r\n }).present();\r\n\r\n })\r\n\r\n })\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/checkout/checkout.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /.sourcemaps/main.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../node_modules/@angular/core/@angular lazy","../../src lazy","../../node_modules/ajv/lib","../../src/providers/woocommerce/woocommerce.ts","../../src/pages/cart/cart.ts","../../src/app/main.ts","../../src/app/app.module.ts","../../buffer (ignored)","../../crypto (ignored)","webpack:///crypto (ignored)?25ff","../../node_modules/ajv/lib/compile","../../src/app/app.component.ts"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,kC;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA,qC;;;;;;;AC9CA;AACA;AACA;AACA,uCAAuC,WAAW;AAClD;AACA;AACA,6B;;;;;;;;;;;;;;;;;;;;;ACN2C;AACL;AAItC,IAAa,mBAAmB;IAK9B;QACE,IAAI,CAAC,WAAW,GA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CAAC;8BAAM,0DAAG;kCAAC;AADd,KAAK;IAHjB,wEAAS,CAAC;OACc;KACxB,CAAC;UAOkI;AAgCnI;SAtCY,KAAK,2B","file":"main.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncatched exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 188;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/@angular/core/@angular lazy\n// module id = 188\n// module chunks = 8","var map = {\n\t\"../pages/checkout/checkout.module\": [\n\t\t624,\n\t\t7\n\t],\n\t\"../pages/home/home.module\": [\n\t\t626,\n\t\t6\n\t],\n\t\"../pages/login/login.module\": [\n\t\t625,\n\t\t5\n\t],\n\t\"../pages/menu/menu.module\": [\n\t\t627,\n\t\t4\n\t],\n\t\"../pages/product-details/product-details.module\": [\n\t\t631,\n\t\t3\n\t],\n\t\"../pages/products-by-category/products-by-category.module\": [\n\t\t630,\n\t\t2\n\t],\n\t\"../pages/search/search.module\": [\n\t\t628,\n\t\t1\n\t],\n\t\"../pages/signup/signup.module\": [\n\t\t629,\n\t\t0\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tvar ids = map[req];\n\tif(!ids)\n\t\treturn Promise.reject(new Error(\"Cannot find module '\" + req + \"'.\"));\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__(ids[0]);\n\t});\n};\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 229;\nmodule.exports = webpackAsyncContext;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src lazy\n// module id = 229\n// module chunks = 8","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 287;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/ajv/lib\n// module id = 287\n// module chunks = 8","import { Injectable } from '@angular/core';\nimport * as WC from 'woocommerce-api';\n\n\n@Injectable()\nexport class WoocommerceProvider {\n\n Woocommerce: any;\n WoocommerceV2: any;\n\n constructor() {\n this.Woocommerce = WC({\n url: \"http://52.66.171.54\",\n consumerKey: \"ck_2ec7be12c0191a8a222cb85e89eea6291e0746e1\",\n consumerSecret: \"cs_a300ce55d107c61910208ae1d37f4c4978561b87\"\n });\n\n this.WoocommerceV2 = WC({\n url: \"http://52.66.171.54\",\n consumerKey: \"ck_2ec7be12c0191a8a222cb85e89eea6291e0746e1\",\n consumerSecret: \"cs_a300ce55d107c61910208ae1d37f4c4978561b87\",\n wpAPI: true,\n version: \"wc/v2\"\n });\n }\n\n init(v2?: boolean){\n if(v2 == true){\n return this.WoocommerceV2;\n } else {\n return this.Woocommerce;\n }\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/providers/woocommerce/woocommerce.ts","import { Component } from '@angular/core';\r\nimport { NavController, NavParams, ViewController, ToastController } from 'ionic-angular';\r\nimport { Storage } from '@ionic/storage';\r\n// import { Checkout } from '../checkout/checkout';\r\n// import { Login } from '../login/login';\r\n\r\n@Component({\r\n selector: 'page-cart',\r\n templateUrl: 'cart.html',\r\n})\r\nexport class Cart {\r\n\r\n cartItems: any[] = [];\r\n total: any;\r\n showEmptyCartMessage: boolean = false;\r\n\r\n constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public viewCtrl: ViewController, public toastController: ToastController) {\r\n \r\n this.total = 0.0;\r\n \r\n this.storage.ready().then(()=>{\r\n\r\n this.storage.get(\"cart\").then( (data)=>{\r\n this.cartItems = data;\r\n console.log(this.cartItems);\r\n\r\n if(this.cartItems.length > 0){\r\n\r\n this.cartItems.forEach( (item, index)=> {\r\n\r\n if(item.variation){\r\n this.total = this.total + (parseFloat(item.variation.price) * item.qty);\r\n } else {\r\n this.total = this.total + (item.product.price * item.qty)\r\n }\r\n\r\n })\r\n\r\n } else {\r\n\r\n this.showEmptyCartMessage = true;\r\n\r\n }\r\n\r\n\r\n })\r\n\r\n })\r\n\r\n }\r\n\r\n removeFromCart(item, i){\r\n\r\n let price;\r\n \r\n if(item.variation){\r\n price = item.variation.price\r\n } else {\r\n price = item.product.price;\r\n }\r\n let qty = item.qty;\r\n\r\n this.cartItems.splice(i, 1);\r\n\r\n this.storage.set(\"cart\", this.cartItems).then( ()=> {\r\n\r\n this.total = this.total - (price * qty);\r\n\r\n });\r\n\r\n if(this.cartItems.length == 0){\r\n this.showEmptyCartMessage = true;\r\n }\r\n\r\n\r\n }\r\n\r\n closeModal(){\r\n this.viewCtrl.dismiss();\r\n }\r\n\r\n checkout(){\r\n\r\n this.storage.get(\"userLoginInfo\").then( (data) => {\r\n if(data != null){\r\n this.navCtrl.push('Checkout');\r\n } else {\r\n this.navCtrl.push('Login', {next: 'Checkout'})\r\n }\r\n })\r\n\r\n }\r\n\r\n changeQty(item, i, change){\r\n\r\n let price;\r\n \r\n if(!item.variation)\r\n price = item.product.price;\r\n else\r\n price = parseFloat(item.variation.price);\r\n \r\n let qty = item.qty;\r\n\r\n if(change < 0 && item.qty == 1){\r\n return;\r\n }\r\n\r\n qty = qty + change;\r\n item.qty = qty;\r\n item.amount = qty * price;\r\n\r\n this.cartItems[i] = item;\r\n\r\n this.storage.set(\"cart\", this.cartItems).then( ()=> {\r\n\r\n this.toastController.create({\r\n message: \"Cart Updated.\",\r\n duration: 2000,\r\n showCloseButton: true\r\n }).present();\r\n\r\n });\r\n\r\n this.total = (parseFloat(this.total.toString()) + (parseFloat(price.toString()) * change));\r\n\r\n\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/pages/cart/cart.ts","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app.module';\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/main.ts","import { BrowserModule } from '@angular/platform-browser';\r\nimport { ErrorHandler, NgModule } from '@angular/core';\r\nimport { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';\r\n\r\nimport { MyApp } from './app.component';\r\n// import { HomePage } from '../pages/home/home';\r\n// import { Menu } from '../pages/menu/menu';\r\n// import {ProductsByCategory} from '../pages/products-by-category/products-by-category';\r\n// import { ProductDetails } from '../pages/product-details/product-details';\r\nimport { Cart } from '../pages/cart/cart';\r\n\r\nimport { StatusBar } from '@ionic-native/status-bar';\r\nimport { SplashScreen } from '@ionic-native/splash-screen';\r\n// import { Signup } from '../pages/signup/signup';\r\n// import { Login } from '../pages/login/login';\r\n// import { Checkout } from '../pages/checkout/checkout';\r\nimport { HttpModule } from '@angular/http';\r\nimport { PayPal } from '@ionic-native/paypal';\r\n// import { SearchPage } from '../pages/search/search';\r\nimport { IonicStorageModule } from '@ionic/storage';\r\nimport { OneSignal } from \"@ionic-native/onesignal\";\r\nimport { WoocommerceProvider } from '../providers/woocommerce/woocommerce';\r\n\r\n@NgModule({\r\n declarations: [\r\n MyApp,\r\n Cart\r\n ],\r\n imports: [\r\n BrowserModule,\r\n HttpModule,\r\n IonicModule.forRoot(MyApp),\r\n IonicStorageModule.forRoot()\r\n ],\r\n bootstrap: [IonicApp],\r\n entryComponents: [\r\n MyApp,\r\n Cart\r\n ],\r\n providers: [\r\n StatusBar,\r\n SplashScreen,\r\n PayPal,\r\n OneSignal,\r\n {provide: ErrorHandler, useClass: IonicErrorHandler},\r\n WoocommerceProvider\r\n ]\r\n})\r\nexport class AppModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// buffer (ignored)\n// module id = 440\n// module chunks = 8","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// crypto (ignored)\n// module id = 441\n// module chunks = 8","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// crypto (ignored)\n// module id = 508\n// module chunks = 8","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 563;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/ajv/lib/compile\n// module id = 563\n// module chunks = 8","import { Component, ViewChild } from '@angular/core';\r\nimport { Nav, Platform } from 'ionic-angular';\r\nimport { StatusBar } from '@ionic-native/status-bar';\r\nimport { SplashScreen } from '@ionic-native/splash-screen';\r\n\r\nimport { Menu } from '../pages/menu/menu';\r\nimport { Signup } from '../pages/signup/signup';\r\nimport { OneSignal } from \"@ionic-native/onesignal\";\r\n\r\n@Component({\r\n templateUrl: 'app.html'\r\n})\r\nexport class MyApp {\r\n @ViewChild(Nav) nav: Nav;\r\n\r\n rootPage: any = 'Menu';\r\n\r\n\r\n constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public oneSignal: OneSignal) {\r\n this.initializeApp();\r\n\r\n\r\n\r\n }\r\n\r\n initializeApp() {\r\n this.platform.ready().then(() => {\r\n // Okay, so the platform is ready and our plugins are available.\r\n // Here you can do any higher level native things you might need.\r\n this.statusBar.styleDefault();\r\n this.splashScreen.hide();\r\n\r\n // this.oneSignal.startInit('b019dab9-5078-40eb-a958-df477ef9b220', '706507838730');\r\n\r\n // this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);\r\n\r\n // this.oneSignal.handleNotificationReceived().subscribe(() => {\r\n // // do something when notification is received\r\n // });\r\n\r\n // this.oneSignal.handleNotificationOpened().subscribe(() => {\r\n // // do something when a notification is opened\r\n // });\r\n\r\n // this.oneSignal.endInit();\r\n\r\n\r\n });\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts"],"sourceRoot":""} -------------------------------------------------------------------------------- /Play Store Assets/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/Screenshot_1.png -------------------------------------------------------------------------------- /Play Store Assets/Screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/Screenshot_2.png -------------------------------------------------------------------------------- /Play Store Assets/Screenshot_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/Screenshot_3.png -------------------------------------------------------------------------------- /Play Store Assets/Screenshot_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/Screenshot_4.png -------------------------------------------------------------------------------- /Play Store Assets/WooIonic-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/WooIonic-512.png -------------------------------------------------------------------------------- /Play Store Assets/WooIonic-feature-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/WooIonic-feature-graphic.png -------------------------------------------------------------------------------- /Play Store Assets/WooIonic-promo-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/Play Store Assets/WooIonic-promo-graphic.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WOOIONIC 2 | 3 | [![WooIonic](http://image.prntscr.com/image/b9ca6de4976b4f42bb0a40aeb9df3cef.png)](https://www.udemy.com/ionic-3-apps-for-woocommerce-build-an-ecommerce-mobile-app/) 4 | 5 | WooIonic is an Ionic 3 Apps built for a Udemy Course [Ionic 3 Apps for WooCommerce: Build an eCommerce Mobile App][df1]. The app connects to the WooCommerce Store using the WooCommerce API and allows the users to browse products, categories, orders and even place orders. The users/customers can signup and login and can pay for their orders via PayPal as well. 6 | 7 | # SCREENSHOTS 8 | 9 | | ![Screenshot1](http://i.imgur.com/EK4Eddd.jpg) | ![Screenshot2](http://i.imgur.com/9bwruUm.jpg) | ![Screenshot3](http://i.imgur.com/qflN5wj.jpg) | 10 | | ------ | ------ | ------ | 11 | | | | | 12 | 13 | Project by Samarth Agarwal 14 | 15 | [df1]: 16 | 17 | -------------------------------------------------------------------------------- /WooIonic.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/WooIonic.apk -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | WooIonic 4 | An awesome Ionic/Cordova app. 5 | Ionic Framework Team 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /desktop.ini: -------------------------------------------------------------------------------- 1 | [ViewState] 2 | Mode= 3 | Vid= 4 | FolderType=Generic 5 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WooIonic", 3 | "app_id": "", 4 | "type": "ionic-angular", 5 | "integrations": { 6 | "cordova": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /my-release-key.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/my-release-key.keystore -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-hello-world", 3 | "author": "Ionic Framework", 4 | "homepage": "http://ionicframework.com/", 5 | "private": true, 6 | "scripts": { 7 | "clean": "ionic-app-scripts clean", 8 | "build": "ionic-app-scripts build", 9 | "ionic:build": "ionic-app-scripts build", 10 | "ionic:serve": "ionic-app-scripts serve" 11 | }, 12 | "dependencies": { 13 | "@angular/common": "4.0.0", 14 | "@angular/compiler": "4.0.0", 15 | "@angular/compiler-cli": "4.0.0", 16 | "@angular/core": "4.0.0", 17 | "@angular/forms": "4.0.0", 18 | "@angular/http": "4.0.0", 19 | "@angular/platform-browser": "4.0.0", 20 | "@angular/platform-browser-dynamic": "4.0.0", 21 | "@ionic-native/core": "^3.6.1", 22 | "@ionic-native/network": "^4.2.1", 23 | "@ionic-native/onesignal": "^3.6.1", 24 | "@ionic-native/paypal": "^3.5.0", 25 | "@ionic-native/splash-screen": "3.4.2", 26 | "@ionic-native/status-bar": "3.4.2", 27 | "@ionic/app-scripts": "^3.1.8", 28 | "@ionic/storage": "2.0.1", 29 | "cordova-android": "~6.1.2", 30 | "cordova-plugin-console": "1.0.5", 31 | "cordova-plugin-device": "1.1.4", 32 | "cordova-plugin-splashscreen": "~4.0.1", 33 | "cordova-plugin-statusbar": "2.2.1", 34 | "cordova-plugin-whitelist": "1.3.1", 35 | "ionic-angular": "^3.9.2", 36 | "ionic-plugin-keyboard": "~2.2.1", 37 | "ionicons": "3.0.0", 38 | "onesignal-cordova-plugin": "~2.0.11", 39 | "rxjs": "5.1.1", 40 | "sw-toolbox": "3.4.0", 41 | "woocommerce-api": "^1.4.2", 42 | "zone.js": "^0.8.4" 43 | }, 44 | "devDependencies": { 45 | "@ionic/app-scripts": "1.3.0", 46 | "@ionic/cli-plugin-cordova": "1.6.2", 47 | "@ionic/cli-plugin-ionic-angular": "1.4.1", 48 | "ionic": "3.19.0", 49 | "typescript": "~2.2.1" 50 | }, 51 | "cordovaPlugins": [ 52 | "cordova-plugin-whitelist", 53 | "cordova-plugin-console", 54 | "cordova-plugin-statusbar", 55 | "cordova-plugin-device", 56 | "ionic-plugin-keyboard", 57 | "cordova-plugin-splashscreen" 58 | ], 59 | "cordovaPlatforms": [], 60 | "description": "WooIonic: An Ionic project", 61 | "cordova": { 62 | "platforms": [ 63 | "android" 64 | ], 65 | "plugins": { 66 | "ionic-plugin-keyboard": {}, 67 | "cordova-plugin-whitelist": {}, 68 | "cordova-plugin-console": {}, 69 | "cordova-plugin-statusbar": {}, 70 | "cordova-plugin-device": {}, 71 | "cordova-plugin-splashscreen": {}, 72 | "onesignal-cordova-plugin": {} 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { Nav, Platform } from 'ionic-angular'; 3 | import { StatusBar } from '@ionic-native/status-bar'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | 6 | import { Menu } from '../pages/menu/menu'; 7 | import { Signup } from '../pages/signup/signup'; 8 | import { OneSignal } from "@ionic-native/onesignal"; 9 | 10 | @Component({ 11 | templateUrl: 'app.html' 12 | }) 13 | export class MyApp { 14 | @ViewChild(Nav) nav: Nav; 15 | 16 | rootPage: any = 'Menu'; 17 | 18 | 19 | constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public oneSignal: OneSignal) { 20 | this.initializeApp(); 21 | 22 | 23 | 24 | } 25 | 26 | initializeApp() { 27 | this.platform.ready().then(() => { 28 | // Okay, so the platform is ready and our plugins are available. 29 | // Here you can do any higher level native things you might need. 30 | this.statusBar.styleDefault(); 31 | this.splashScreen.hide(); 32 | 33 | // this.oneSignal.startInit('b019dab9-5078-40eb-a958-df477ef9b220', '706507838730'); 34 | 35 | // this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert); 36 | 37 | // this.oneSignal.handleNotificationReceived().subscribe(() => { 38 | // // do something when notification is received 39 | // }); 40 | 41 | // this.oneSignal.handleNotificationOpened().subscribe(() => { 42 | // // do something when a notification is opened 43 | // }); 44 | 45 | // this.oneSignal.endInit(); 46 | 47 | 48 | }); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { ErrorHandler, NgModule } from '@angular/core'; 3 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 4 | 5 | import { MyApp } from './app.component'; 6 | // import { HomePage } from '../pages/home/home'; 7 | // import { Menu } from '../pages/menu/menu'; 8 | // import {ProductsByCategory} from '../pages/products-by-category/products-by-category'; 9 | // import { ProductDetails } from '../pages/product-details/product-details'; 10 | import { Cart } from '../pages/cart/cart'; 11 | 12 | import { StatusBar } from '@ionic-native/status-bar'; 13 | import { SplashScreen } from '@ionic-native/splash-screen'; 14 | // import { Signup } from '../pages/signup/signup'; 15 | // import { Login } from '../pages/login/login'; 16 | // import { Checkout } from '../pages/checkout/checkout'; 17 | import { HttpModule } from '@angular/http'; 18 | import { PayPal } from '@ionic-native/paypal'; 19 | // import { SearchPage } from '../pages/search/search'; 20 | import { IonicStorageModule } from '@ionic/storage'; 21 | import { OneSignal } from "@ionic-native/onesignal"; 22 | import { WoocommerceProvider } from '../providers/woocommerce/woocommerce'; 23 | 24 | @NgModule({ 25 | declarations: [ 26 | MyApp, 27 | Cart 28 | ], 29 | imports: [ 30 | BrowserModule, 31 | HttpModule, 32 | IonicModule.forRoot(MyApp), 33 | IonicStorageModule.forRoot() 34 | ], 35 | bootstrap: [IonicApp], 36 | entryComponents: [ 37 | MyApp, 38 | Cart 39 | ], 40 | providers: [ 41 | StatusBar, 42 | SplashScreen, 43 | PayPal, 44 | OneSignal, 45 | {provide: ErrorHandler, useClass: IonicErrorHandler}, 46 | WoocommerceProvider 47 | ] 48 | }) 49 | export class AppModule {} 50 | -------------------------------------------------------------------------------- /src/app/app.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/v2/theming/ 2 | 3 | 4 | // App Global Sass 5 | // -------------------------------------------------- 6 | // Put style rules here that you want to apply globally. These 7 | // styles are for the entire app and not just one component. 8 | // Additionally, this file can be also used as an entry point 9 | // to import other Sass files to be included in the output CSS. 10 | // 11 | // Shared Sass variables, which can be used to adjust Ionic's 12 | // default Sass variables, belong in "theme/variables.scss". 13 | // 14 | // To declare rules for a specific mode, create a child rule 15 | // for the .md, .ios, or .wp mode classes. The mode class is 16 | // automatically applied to the element in the app. 17 | -------------------------------------------------------------------------------- /src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/1.jpg -------------------------------------------------------------------------------- /src/assets/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/2.jpg -------------------------------------------------------------------------------- /src/assets/images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/3.jpg -------------------------------------------------------------------------------- /src/assets/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/4.jpg -------------------------------------------------------------------------------- /src/assets/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/banner.jpg -------------------------------------------------------------------------------- /src/assets/images/banner2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/banner2.jpg -------------------------------------------------------------------------------- /src/assets/images/clothing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/clothing.jpg -------------------------------------------------------------------------------- /src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/logo.png -------------------------------------------------------------------------------- /src/assets/images/music.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/music.jpg -------------------------------------------------------------------------------- /src/assets/images/poster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/poster.jpg -------------------------------------------------------------------------------- /src/assets/images/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samarthagarwal/wooionic3/a5dc92188f1504143223fe2ce8424675e19fb96d/src/assets/images/rock.png -------------------------------------------------------------------------------- /src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Declaration files are how the Typescript compiler knows about the type information(or shape) of an object. 3 | They're what make intellisense work and make Typescript know all about your code. 4 | 5 | A wildcard module is declared below to allow third party libraries to be used in an app even if they don't 6 | provide their own type declarations. 7 | 8 | To learn more about using third party libraries in an Ionic app, check out the docs here: 9 | http://ionicframework.com/docs/v2/resources/third-party-libs/ 10 | 11 | For more info on type definition files, check out the Typescript docs here: 12 | https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html 13 | */ 14 | declare module '*'; -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /src/pages/cart/cart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Your Cart 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Your Cart Description 16 | 17 | 18 | There are no products in your cart! 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |

{{ item.product.title }}

31 | 32 |

{{ att.option | titlecase }}  

33 | 34 |

{{ item.qty }} • 35 | {{ item.product.price }} 36 | {{ item.variation.price }}

37 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 49 | 50 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | TOTAL 71 | 72 | 73 | 74 | 75 | 76 | {{ total }} 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/pages/cart/cart.scss: -------------------------------------------------------------------------------- 1 | page-cart { 2 | .compact .item-inner .input-wrapper ion-label { 3 | margin: 0 !important; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/cart/cart.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, NavParams, ViewController, ToastController } from 'ionic-angular'; 3 | import { Storage } from '@ionic/storage'; 4 | // import { Checkout } from '../checkout/checkout'; 5 | // import { Login } from '../login/login'; 6 | 7 | @Component({ 8 | selector: 'page-cart', 9 | templateUrl: 'cart.html', 10 | }) 11 | export class Cart { 12 | 13 | cartItems: any[] = []; 14 | total: any; 15 | showEmptyCartMessage: boolean = false; 16 | 17 | constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public viewCtrl: ViewController, public toastController: ToastController) { 18 | 19 | this.total = 0.0; 20 | 21 | this.storage.ready().then(()=>{ 22 | 23 | this.storage.get("cart").then( (data)=>{ 24 | this.cartItems = data; 25 | console.log(this.cartItems); 26 | 27 | if(this.cartItems.length > 0){ 28 | 29 | this.cartItems.forEach( (item, index)=> { 30 | 31 | if(item.variation){ 32 | this.total = this.total + (parseFloat(item.variation.price) * item.qty); 33 | } else { 34 | this.total = this.total + (item.product.price * item.qty) 35 | } 36 | 37 | }) 38 | 39 | } else { 40 | 41 | this.showEmptyCartMessage = true; 42 | 43 | } 44 | 45 | 46 | }) 47 | 48 | }) 49 | 50 | } 51 | 52 | removeFromCart(item, i){ 53 | 54 | let price; 55 | 56 | if(item.variation){ 57 | price = item.variation.price 58 | } else { 59 | price = item.product.price; 60 | } 61 | let qty = item.qty; 62 | 63 | this.cartItems.splice(i, 1); 64 | 65 | this.storage.set("cart", this.cartItems).then( ()=> { 66 | 67 | this.total = this.total - (price * qty); 68 | 69 | }); 70 | 71 | if(this.cartItems.length == 0){ 72 | this.showEmptyCartMessage = true; 73 | } 74 | 75 | 76 | } 77 | 78 | closeModal(){ 79 | this.viewCtrl.dismiss(); 80 | } 81 | 82 | checkout(){ 83 | 84 | this.storage.get("userLoginInfo").then( (data) => { 85 | if(data != null){ 86 | this.navCtrl.push('Checkout'); 87 | } else { 88 | this.navCtrl.push('Login', {next: 'Checkout'}) 89 | } 90 | }) 91 | 92 | } 93 | 94 | changeQty(item, i, change){ 95 | 96 | let price; 97 | 98 | if(!item.variation) 99 | price = item.product.price; 100 | else 101 | price = parseFloat(item.variation.price); 102 | 103 | let qty = item.qty; 104 | 105 | if(change < 0 && item.qty == 1){ 106 | return; 107 | } 108 | 109 | qty = qty + change; 110 | item.qty = qty; 111 | item.amount = qty * price; 112 | 113 | this.cartItems[i] = item; 114 | 115 | this.storage.set("cart", this.cartItems).then( ()=> { 116 | 117 | this.toastController.create({ 118 | message: "Cart Updated.", 119 | duration: 2000, 120 | showCloseButton: true 121 | }).present(); 122 | 123 | }); 124 | 125 | this.total = (parseFloat(this.total.toString()) + (parseFloat(price.toString()) * change)); 126 | 127 | 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /src/pages/checkout/checkout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Checkout 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Personal Details 13 | 14 | First Name 15 | 16 | 17 | 18 | 19 | Last Name 20 | 21 | 22 | 23 | 24 | Email 25 | 26 | 27 | 28 | 29 | Username 30 | 31 | 32 | 33 | Billing Details 34 | 35 | 36 | Address Line 1 37 | 38 | 39 | 40 | 41 | Address Line 2 42 | 43 | 44 | 45 | 46 | Country 47 | 48 | India 49 | 50 | 51 | 52 | 53 | State 54 | 55 | New Delhi 56 | Uttar Pradesh 57 | Maharashtra 58 | Tamil Nadu 59 | Madhya Pradesh 60 | 61 | 62 | 63 | 64 | City 65 | 66 | 67 | 68 | 69 | Postal Code 70 | 71 | 72 | 73 | 74 | Phone 75 | 76 | 77 | 78 | 79 | Same Shipping Details 80 | 81 | 82 | 83 | Shipping Details 84 | 85 | 86 | First Name 87 | 88 | 89 | 90 | 91 | Last Name 92 | 93 | 94 | 95 | 96 | Address Line 1 97 | 98 | 99 | 100 | 101 | Address Line 2 102 | 103 | 104 | 105 | 106 | Country 107 | 108 | India 109 | 110 | 111 | 112 | 113 | State 114 | 115 | New Delhi 116 | Uttar Pradesh 117 | Maharashtra 118 | Tamil Nadu 119 | Madhya Pradesh 120 | 121 | 122 | 123 | 124 | City 125 | 126 | 127 | 128 | 129 | Postal Code 130 | 131 | 132 | 133 | 134 | Phone 135 | 136 | 137 | 138 | Payment Details 139 | 140 | 141 | Payment Method 142 | 143 | {{ p.method_title }} 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/pages/checkout/checkout.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { Checkout } from './checkout'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | Checkout, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(Checkout), 11 | ], 12 | exports: [ 13 | Checkout 14 | ] 15 | }) 16 | export class CheckoutPageModule {} -------------------------------------------------------------------------------- /src/pages/checkout/checkout.scss: -------------------------------------------------------------------------------- 1 | page-checkout { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/checkout/checkout.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular'; 3 | import { Storage } from '@ionic/storage'; 4 | import * as WC from 'woocommerce-api'; 5 | // import { HomePage } from '../home/home'; 6 | // import { Menu } from '../menu/menu'; 7 | import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal'; 8 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 9 | 10 | @IonicPage({}) 11 | @Component({ 12 | selector: 'page-checkout', 13 | templateUrl: 'checkout.html', 14 | }) 15 | export class Checkout { 16 | 17 | WooCommerce: any; 18 | newOrder: any; 19 | paymentMethods: any[]; 20 | paymentMethod: any; 21 | billing_shipping_same: boolean; 22 | userInfo: any; 23 | 24 | constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public alertCtrl: AlertController, public payPal: PayPal, private WP: WoocommerceProvider) { 25 | this.newOrder = {}; 26 | this.newOrder.billing = {}; 27 | this.newOrder.shipping = {}; 28 | this.billing_shipping_same = false; 29 | 30 | this.paymentMethods = [ 31 | { method_id: "bacs", method_title: "Direct Bank Transfer" }, 32 | { method_id: "cheque", method_title: "Cheque Payment" }, 33 | { method_id: "cod", method_title: "Cash on Delivery" }, 34 | { method_id: "paypal", method_title: "PayPal" }]; 35 | 36 | this.WooCommerce = WP.init(true); 37 | 38 | this.storage.get("userLoginInfo").then((userLoginInfo) => { 39 | 40 | this.userInfo = userLoginInfo.user; 41 | 42 | let email = userLoginInfo.user.email; 43 | let id = userLoginInfo.user.id; 44 | 45 | this.WooCommerce.getAsync("customers/"+id).then((data) => { 46 | 47 | this.newOrder = JSON.parse(data.body); 48 | 49 | }) 50 | 51 | }) 52 | 53 | } 54 | 55 | setBillingToShipping() { 56 | this.billing_shipping_same = !this.billing_shipping_same; 57 | 58 | if (this.billing_shipping_same) { 59 | this.newOrder.shipping = this.newOrder.billing; 60 | } 61 | 62 | } 63 | 64 | placeOrder() { 65 | 66 | let orderItems: any[] = []; 67 | let data: any = {}; 68 | 69 | let paymentData: any = {}; 70 | 71 | this.paymentMethods.forEach((element, index) => { 72 | if (element.method_id == this.paymentMethod) { 73 | paymentData = element; 74 | } 75 | }); 76 | 77 | 78 | data = { 79 | 80 | //Fixed a bug here. Updated in accordance with wc/v2 API 81 | payment_method: paymentData.method_id, 82 | payment_method_title: paymentData.method_title, 83 | set_paid: true, 84 | 85 | billing: this.newOrder.billing, 86 | shipping: this.newOrder.shipping, 87 | customer_id: this.userInfo.id || '', 88 | line_items: orderItems 89 | }; 90 | 91 | 92 | if (paymentData.method_id == "paypal") { 93 | 94 | this.payPal.init({ 95 | PayPalEnvironmentProduction: "YOUR_PRODUCTION_CLIENT_ID", 96 | PayPalEnvironmentSandbox: "AYkkS2ObeSpaObaCqA3bybQjRNRMKOw_2vNSha7gmxESpG4l4AhEyMfYwuzrUFKSbWGhCsN-Vhtl5FOG" 97 | }).then(() => { 98 | // Environments: PayPalEnvironmentNoNetwork, PayPalEnvironmentSandbox, PayPalEnvironmentProduction 99 | this.payPal.prepareToRender('PayPalEnvironmentSandbox', new PayPalConfiguration({ 100 | // Only needed if you get an "Internal Service Error" after PayPal login! 101 | //payPalShippingAddressOption: 2 // PayPalShippingAddressOptionPayPal 102 | })).then(() => { 103 | 104 | this.storage.get("cart").then((cart) => { 105 | 106 | let total = 0.00; 107 | cart.forEach((element, index) => { 108 | 109 | if(element.variation){ 110 | orderItems.push({ product_id: element.product.id, variation_id: element.variation.id, quantity: element.qty }); 111 | total = total + (element.variation.price * element.qty); 112 | } else { 113 | orderItems.push({ product_id: element.product.id, quantity: element.qty }); 114 | total = total + (element.product.price * element.qty); 115 | } 116 | }); 117 | 118 | let payment = new PayPalPayment(total.toString(), 'USD', 'Description', 'sale'); 119 | this.payPal.renderSinglePaymentUI(payment).then((response) => { 120 | // Successfully paid 121 | 122 | alert(JSON.stringify(response)); 123 | 124 | 125 | data.line_items = orderItems; 126 | //console.log(data); 127 | let orderData: any = {}; 128 | 129 | orderData.order = data; 130 | 131 | this.WooCommerce.postAsync('orders', orderData.order).then((data) => { 132 | alert("Order placed successfully!"); 133 | 134 | let response = (JSON.parse(data.body)); 135 | 136 | this.alertCtrl.create({ 137 | title: "Order Placed Successfully", 138 | message: "Your order has been placed successfully. Your order number is " + response.order_number, 139 | buttons: [{ 140 | text: "OK", 141 | handler: () => { 142 | this.navCtrl.push('HomePage'); 143 | } 144 | }] 145 | }).present(); 146 | }) 147 | 148 | }) 149 | 150 | }, () => { 151 | // Error or render dialog closed without being successful 152 | }); 153 | }, () => { 154 | // Error in configuration 155 | }); 156 | }, () => { 157 | // Error in initialization, maybe PayPal isn't supported or something else 158 | }); 159 | 160 | 161 | 162 | 163 | 164 | } else { 165 | 166 | this.storage.get("cart").then((cart) => { 167 | 168 | cart.forEach((element, index) => { 169 | if(element.variation){ 170 | orderItems.push({ product_id: element.product.id, variation_id: element.variation.id, quantity: element.qty }); 171 | ///total = total + (element.variation.price * element.qty); 172 | } else { 173 | orderItems.push({ product_id: element.product.id, quantity: element.qty }); 174 | ///total = total + (element.product.price * element.qty); 175 | } 176 | }); 177 | 178 | data.line_items = orderItems; 179 | 180 | let orderData: any = {}; 181 | 182 | orderData.order = data; 183 | 184 | this.WooCommerce.postAsync("orders", orderData.order).then((data) => { 185 | 186 | let response = (JSON.parse(data.body)); 187 | 188 | this.alertCtrl.create({ 189 | title: "Order Placed Successfully", 190 | message: "Your order has been placed successfully. Your order number is " + response.order_number, 191 | buttons: [{ 192 | text: "OK", 193 | handler: () => { 194 | this.navCtrl.setRoot('HomePage'); 195 | } 196 | }] 197 | }).present(); 198 | 199 | }) 200 | 201 | }) 202 | 203 | } 204 | 205 | 206 | } 207 | 208 | } 209 | -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Home 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |

{{ product.title }}

33 |

34 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |

{{ product.title }}

48 | 49 |

50 | 51 | 52 |

53 | 54 | 57 |
58 |
59 | 60 | 61 | 62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /src/pages/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { HomePage } from './home'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | HomePage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(HomePage), 11 | ], 12 | exports: [ 13 | HomePage 14 | ] 15 | }) 16 | export class HomePageModule {} -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | ion-card { 4 | margin: 0 !important; 5 | width: 100% !important; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { IonicPage, NavController, Slides, ToastController } from 'ionic-angular'; 3 | // import { ProductDetails } from '../product-details/product-details'; 4 | 5 | import * as WC from 'woocommerce-api'; 6 | // import { SearchPage } from "../search/search"; 7 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 8 | 9 | @IonicPage({}) 10 | @Component({ 11 | selector: 'page-home', 12 | templateUrl: 'home.html' 13 | }) 14 | export class HomePage { 15 | 16 | WooCommerce: any; 17 | products: any[]; 18 | moreProducts: any[]; 19 | page: number; 20 | searchQuery: string = ""; 21 | 22 | @ViewChild('productSlides') productSlides: Slides; 23 | 24 | constructor(public navCtrl: NavController, public toastCtrl: ToastController, private WP: WoocommerceProvider) { 25 | 26 | this.page = 2; 27 | 28 | this.WooCommerce = WP.init(); 29 | 30 | this.loadMoreProducts(null); 31 | 32 | this.WooCommerce.getAsync("products").then( (data) => { 33 | console.log(JSON.parse(data.body)); 34 | this.products = JSON.parse(data.body).products; 35 | }, (err) => { 36 | console.log(err) 37 | }) 38 | 39 | } 40 | 41 | // ionViewDidLoad(){ 42 | // setInterval(()=> { 43 | 44 | // if(this.productSlides.getActiveIndex() == this.productSlides.length() -1) 45 | // this.productSlides.slideTo(0); 46 | 47 | // this.productSlides.slideNext(); 48 | // }, 3000) 49 | // } 50 | 51 | loadMoreProducts(event){ 52 | console.log(event); 53 | if(event == null) 54 | { 55 | this.page = 2; 56 | this.moreProducts = []; 57 | } 58 | else 59 | this.page++; 60 | 61 | this.WooCommerce.getAsync("products?page=" + this.page).then( (data) => { 62 | console.log(JSON.parse(data.body)); 63 | this.moreProducts = this.moreProducts.concat(JSON.parse(data.body).products); 64 | 65 | if(event != null) 66 | { 67 | event.complete(); 68 | } 69 | 70 | if(JSON.parse(data.body).products.length < 10){ 71 | event.enable(false); 72 | 73 | this.toastCtrl.create({ 74 | message: "No more products!", 75 | duration: 5000 76 | }).present(); 77 | 78 | } 79 | 80 | 81 | }, (err) => { 82 | console.log(err) 83 | }) 84 | } 85 | 86 | openProductPage(product){ 87 | this.navCtrl.push('ProductDetails', {"product": product} ); 88 | } 89 | 90 | onSearch(event){ 91 | if(this.searchQuery.length > 0){ 92 | this.navCtrl.push('SearchPage', {"searchQuery": this.searchQuery}); 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/pages/login/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Login 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Username 18 | 19 | 20 | 21 | Password 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/pages/login/login.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { Login } from './login'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | Login, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(Login), 11 | ], 12 | exports: [ 13 | Login 14 | ] 15 | }) 16 | export class LoginModule {} 17 | -------------------------------------------------------------------------------- /src/pages/login/login.scss: -------------------------------------------------------------------------------- 1 | page-login { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/login/login.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, ToastController, AlertController, Events } from 'ionic-angular'; 3 | import { Http } from '@angular/http'; 4 | import { Storage } from '@ionic/storage'; 5 | 6 | @IonicPage({}) 7 | @Component({ 8 | selector: 'page-login', 9 | templateUrl: 'login.html', 10 | }) 11 | export class Login { 12 | 13 | username: string; 14 | password: string; 15 | 16 | constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http, public toastCtrl: ToastController, public storage: Storage, public alertCtrl: AlertController, public events: Events) { 17 | 18 | this.username = ""; 19 | this.password = ""; 20 | 21 | } 22 | 23 | login(){ 24 | 25 | this.http.get("http://samarth.southeastasia.cloudapp.azure.com/api/auth/generate_auth_cookie/?insecure=cool&username=" + this.username + "&password=" + this.password) 26 | .subscribe( (res) => { 27 | console.log(res.json()); 28 | 29 | let response = res.json(); 30 | 31 | if(response.error){ 32 | this.toastCtrl.create({ 33 | message: response.error, 34 | duration: 5000 35 | }).present(); 36 | return; 37 | } 38 | 39 | 40 | this.storage.set("userLoginInfo", response).then( (data) =>{ 41 | 42 | this.alertCtrl.create({ 43 | title: "Login Successful", 44 | message: "You have been logged in successfully.", 45 | buttons: [{ 46 | text: "OK", 47 | handler: () => { 48 | 49 | this.events.publish("updateMenu"); 50 | 51 | if(this.navParams.get("next")){ 52 | this.navCtrl.push(this.navParams.get("next")); 53 | } else { 54 | this.navCtrl.pop(); 55 | } 56 | } 57 | }] 58 | }).present(); 59 | 60 | 61 | }) 62 | 63 | 64 | 65 | 66 | }); 67 | 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/pages/menu/menu.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 |
WOOIONIC
13 |
Keep Shopping
14 |
15 | 16 | 17 | 18 | Categories 19 | 20 | 21 | 22 | 23 |

{{ category.name }}

24 |

{{ category.description }}

25 |
26 | 27 | 28 | 29 | 30 | 31 |

{{ sub.name }}

32 | 33 | 34 |
35 |
36 | 37 | Account 38 | 39 | 40 | 41 |

Sign Up

42 |

For a new account

43 |
44 | 45 | 46 | 47 |

Login

48 |

Using email and password

49 |
50 | 51 | 52 | 53 |

{{ (this.user.firstname == '' ? this.user.username : this.user.firstname) || "" }}

54 |

Welcome

55 |
56 | 57 | 58 | 59 |

Your Cart

60 |

Check items in your cart

61 |
62 | 63 | 64 | 65 |

Logout

66 |

of your Account

67 |
68 | 69 |
70 |
71 | 72 |
73 | 74 | -------------------------------------------------------------------------------- /src/pages/menu/menu.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { Menu } from './menu'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | Menu, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(Menu), 11 | ], 12 | exports: [ 13 | Menu 14 | ] 15 | }) 16 | export class MenuPageModule {} -------------------------------------------------------------------------------- /src/pages/menu/menu.scss: -------------------------------------------------------------------------------- 1 | .card-background-page { 2 | 3 | ion-card { 4 | position: relative; 5 | text-align: center; 6 | margin: 0px !important; 7 | width: 100% !important; 8 | } 9 | 10 | .card-title { 11 | position: absolute; 12 | top: 36%; 13 | font-size: 2.0em; 14 | width: 100%; 15 | font-weight: bold; 16 | color: #fff; 17 | } 18 | 19 | .card-subtitle { 20 | font-size: 1.0em; 21 | position: absolute; 22 | top: 60%; 23 | width: 100%; 24 | color: #fff; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/pages/menu/menu.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, ModalController, Events } from 'ionic-angular'; 3 | // import { HomePage } from '../home/home'; 4 | // import { Signup } from '../signup/signup'; 5 | // import { Login } from '../login/login'; 6 | import * as WC from 'woocommerce-api'; 7 | // import { ProductsByCategory } from '../products-by-category/products-by-category' 8 | import { Storage } from '@ionic/storage'; 9 | import { Cart } from '../cart/cart'; 10 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 11 | 12 | @IonicPage({}) 13 | @Component({ 14 | selector: 'page-menu', 15 | templateUrl: 'menu.html', 16 | }) 17 | export class Menu { 18 | 19 | homePage: Component; 20 | WooCommerce: any; 21 | categories: any[]; 22 | @ViewChild('content') childNavCtrl: NavController; 23 | loggedIn: boolean; 24 | user: any; 25 | 26 | constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public modalCtrl: ModalController, private events: Events, private WP: WoocommerceProvider) { 27 | this.homePage = 'HomePage'; 28 | this.categories = []; 29 | this.user = {}; 30 | 31 | this.WooCommerce = WP.init(); 32 | 33 | 34 | this.WooCommerce.getAsync("products/categories").then((data) => { 35 | console.log(JSON.parse(data.body).product_categories); 36 | 37 | let temp: any[] = JSON.parse(data.body).product_categories; 38 | 39 | for (let i = 0; i < temp.length; i++) { 40 | if (temp[i].parent == 0) { 41 | 42 | temp[i].subCategories = []; 43 | 44 | if (temp[i].slug == "clothing") { 45 | temp[i].icon = "shirt"; 46 | } 47 | if (temp[i].slug == "music") { 48 | temp[i].icon = "musical-notes"; 49 | } 50 | if (temp[i].slug == "posters") { 51 | temp[i].icon = "images"; 52 | } 53 | 54 | this.categories.push(temp[i]); 55 | } 56 | } 57 | 58 | //Groups Subcategories 59 | 60 | for (let i = 0; i < temp.length; i++){ 61 | for (let j = 0; j < this.categories.length; j++){ 62 | //console.log("Checking " + j + " " + i) 63 | if(this.categories[j].id == temp[i].parent){ 64 | this.categories[j].subCategories.push(temp[i]); 65 | } 66 | } 67 | } 68 | 69 | 70 | 71 | }, (err) => { 72 | console.log(err) 73 | }); 74 | 75 | this.events.subscribe("updateMenu", () => { 76 | this.storage.ready().then(() => { 77 | this.storage.get("userLoginInfo").then((userLoginInfo) => { 78 | 79 | if (userLoginInfo != null) { 80 | 81 | console.log("User logged in..."); 82 | this.user = userLoginInfo.user; 83 | console.log(this.user); 84 | this.loggedIn = true; 85 | } 86 | else { 87 | console.log("No user found."); 88 | this.user = {}; 89 | this.loggedIn = false; 90 | } 91 | 92 | }) 93 | }); 94 | 95 | 96 | }) 97 | } 98 | 99 | ionViewDidEnter() { 100 | 101 | this.storage.ready().then(() => { 102 | this.storage.get("userLoginInfo").then((userLoginInfo) => { 103 | 104 | if (userLoginInfo != null) { 105 | 106 | console.log("User logged in..."); 107 | this.user = userLoginInfo.user; 108 | console.log(this.user); 109 | this.loggedIn = true; 110 | } 111 | else { 112 | console.log("No user found."); 113 | this.user = {}; 114 | this.loggedIn = false; 115 | } 116 | 117 | }) 118 | }) 119 | 120 | 121 | } 122 | 123 | openCategoryPage(category) { 124 | 125 | this.childNavCtrl.setRoot('ProductsByCategory', { "category": category }); 126 | 127 | } 128 | 129 | openPage(pageName: string) { 130 | if (pageName == "signup") { 131 | this.navCtrl.push('Signup'); 132 | } 133 | if (pageName == "login") { 134 | this.navCtrl.push('Login'); 135 | } 136 | if (pageName == 'logout') { 137 | this.storage.remove("userLoginInfo").then(() => { 138 | this.user = {}; 139 | this.loggedIn = false; 140 | }) 141 | } 142 | if (pageName == 'cart') { 143 | let modal = this.modalCtrl.create(Cart); 144 | modal.present(); 145 | } 146 | 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /src/pages/product-details/product-details.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ product.title }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | {{ product.title }}   26 | 27 | {{ cat }} 28 | 29 | 30 | 31 |

32 | 33 |
34 | 35 | 36 |
37 | 38 | 39 | Product options 40 | 41 | 42 | {{ attribute.name | titlecase }} 43 | 44 | {{ option }} 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Specifications 54 | 55 | 56 | 57 | 58 | 59 | {{ att.name}} 60 | 61 | 62 | {{ option }} 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Reviews 74 | 75 | 76 | 77 | 78 | 79 | {{ review.reviewer_name }}
80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
97 | 98 | {{ review.review }} 99 | 100 | 101 |
102 |
103 |
104 |
105 | 106 |
107 | 108 | 109 | 110 | 113 | 114 | -------------------------------------------------------------------------------- /src/pages/product-details/product-details.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ProductDetails } from './product-details'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | ProductDetails, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(ProductDetails), 11 | ], 12 | exports: [ 13 | ProductDetails 14 | ] 15 | }) 16 | export class ProductDetailsModule {} 17 | -------------------------------------------------------------------------------- /src/pages/product-details/product-details.scss: -------------------------------------------------------------------------------- 1 | page-product-details { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/product-details/product-details.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, ToastController, ModalController, LoadingController } from 'ionic-angular'; 3 | import * as WC from 'woocommerce-api'; 4 | import { Cart } from '../cart/cart'; 5 | 6 | import { Storage } from '@ionic/storage'; 7 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 8 | 9 | @IonicPage({}) 10 | @Component({ 11 | selector: 'page-product-details', 12 | templateUrl: 'product-details.html', 13 | }) 14 | export class ProductDetails { 15 | 16 | product: any; 17 | WooCommerce: any; 18 | reviews: any[] = []; 19 | selectedOptions: any = {}; 20 | requireOptions: boolean = true; 21 | productVariations: any[] = []; 22 | productPrice: number = 0.0; 23 | selectedVariation: any; 24 | 25 | constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public toastCtrl: ToastController, public modalCtrl: ModalController, private WP: WoocommerceProvider, private loadingCtrl: LoadingController) { 26 | 27 | this.product = this.navParams.get("product"); 28 | console.log(this.product); 29 | 30 | this.WooCommerce = WP.init(true); 31 | 32 | this.WooCommerce.getAsync('products/' + this.product.id + '/reviews').then((data) => { 33 | 34 | this.reviews = JSON.parse(data.body); 35 | console.log(this.reviews); 36 | 37 | }, (err) => { 38 | console.log(err); 39 | }) 40 | 41 | } 42 | 43 | addToCart(product) { 44 | 45 | //counting selected attribute options 46 | let count = 0; 47 | for (let k in this.selectedOptions) if (this.selectedOptions.hasOwnProperty(k)) count++; 48 | 49 | //counting variation attributes options 50 | let count_ = 0; 51 | for (var index = 0; index < this.product.attributes.length; index++) { 52 | 53 | if(this.product.attributes[index].variation) 54 | count_++; 55 | 56 | } 57 | 58 | //checking if user selected all the variation options or not 59 | 60 | if(count_ != count || this.requireOptions) 61 | { 62 | this.toastCtrl.create({ 63 | message: "Select Product Options", 64 | duration: 2000, 65 | showCloseButton: true 66 | }).present(); 67 | return; 68 | } 69 | 70 | 71 | 72 | this.storage.get("cart").then((data) => { 73 | 74 | if (data == undefined || data.length == 0) { 75 | data = []; 76 | 77 | data.push({ 78 | "product": product, 79 | "qty": 1, 80 | "amount": parseFloat(product.price) 81 | }); 82 | 83 | if(this.selectedVariation){ 84 | data[0].variation = this.selectedVariation; 85 | data[0].amount = parseFloat(this.selectedVariation.price); 86 | } 87 | 88 | } else { 89 | 90 | let alreadyAdded = false; 91 | let alreadyAddedIndex = -1; 92 | 93 | for (let i = 0; i < data.length; i++){ 94 | if(data[i].product.id == product.id){ //Product ID matched 95 | if(this.productVariations.length > 0){ //Now match variation ID also if it exists 96 | if(data[i].variation.id == this.selectedVariation.id){ 97 | alreadyAdded = true; 98 | alreadyAddedIndex = i; 99 | break; 100 | } 101 | } else { //product is simple product so variation does not matter 102 | alreadyAdded = true; 103 | alreadyAddedIndex = i; 104 | break; 105 | } 106 | } 107 | } 108 | 109 | if(alreadyAdded == true){ 110 | if(this.selectedVariation){ 111 | data[alreadyAddedIndex].qty = parseFloat(data[alreadyAddedIndex].qty) + 1; 112 | data[alreadyAddedIndex].amount = parseFloat(data[alreadyAddedIndex].amount) + parseFloat(this.selectedVariation.price); 113 | data[alreadyAddedIndex].variation = this.selectedVariation; 114 | } else { 115 | data[alreadyAddedIndex].qty = parseFloat(data[alreadyAddedIndex].qty) + 1; 116 | data[alreadyAddedIndex].amount = parseFloat(data[alreadyAddedIndex].amount) + parseFloat(data[alreadyAddedIndex].product.price); 117 | } 118 | } else { 119 | if(this.selectedVariation){ 120 | data.push({ 121 | product: product, 122 | qty: 1, 123 | amount: parseFloat(this.selectedVariation.price), 124 | variation: this.selectedVariation 125 | }) 126 | } else { 127 | data.push({ 128 | product: product, 129 | qty: 1, 130 | amount: parseFloat(product.price) 131 | }) 132 | } 133 | } 134 | 135 | } 136 | 137 | 138 | this.storage.set("cart", data).then(() => { 139 | console.log("Cart Updated"); 140 | console.log(data); 141 | 142 | this.toastCtrl.create({ 143 | message: "Cart Updated", 144 | duration: 3000 145 | }).present(); 146 | 147 | }) 148 | 149 | }) 150 | 151 | } 152 | 153 | openCart(){ 154 | 155 | this.modalCtrl.create(Cart).present(); 156 | 157 | } 158 | 159 | async check(justSelectedAttribute) { 160 | 161 | let loading = this.loadingCtrl.create({ 162 | content: "Getting Product Variations" 163 | }); 164 | 165 | //counting selected attribute options 166 | let count = 0; 167 | for (let k in this.selectedOptions) 168 | if (this.selectedOptions.hasOwnProperty(k)) 169 | count++; 170 | 171 | let count_ = 0; 172 | for (var index = 0; index < this.product.attributes.length; index++) { 173 | 174 | if(this.product.attributes[index].variation) 175 | count_++; 176 | 177 | } 178 | 179 | //checking if user selected all the variation options or not 180 | 181 | if(count_ != count){ 182 | this.requireOptions = true; 183 | return; 184 | } else { 185 | this.requireOptions = false; 186 | 187 | //Get product variations only once when all product variables are selected by the user 188 | loading.present(); 189 | this.productVariations = JSON.parse((await this.WooCommerce.getAsync('products/' + this.product.id + '/variations/')).body); 190 | console.log(this.productVariations) 191 | } 192 | 193 | let i = 0, matchFailed = false; 194 | 195 | if (this.productVariations.length > 0) { 196 | for (i = 0; i < this.productVariations.length; i++) { 197 | matchFailed = false; 198 | let key: string = ""; 199 | 200 | for (let j = 0; j < this.productVariations[i].attributes.length; j++) { 201 | key = this.productVariations[i].attributes[j].name; 202 | 203 | console.log(this.selectedOptions[key].toLowerCase()+ " " + this.productVariations[i].attributes[j].option.toLowerCase()) 204 | 205 | if (this.selectedOptions[key].toLowerCase() == this.productVariations[i].attributes[j].option.toLowerCase()) { 206 | //Do nothing 207 | } else { 208 | console.log(matchFailed) 209 | matchFailed = true; 210 | break; 211 | } 212 | } 213 | 214 | if (matchFailed) { 215 | continue; 216 | } else { 217 | //found the matching variation 218 | //console.log(productVariations[i]) 219 | this.productPrice = this.productVariations[i].price; 220 | this.selectedVariation = this.productVariations[i]; 221 | console.log(this.selectedVariation) 222 | 223 | break; 224 | 225 | } 226 | 227 | } 228 | 229 | if(matchFailed == true){ 230 | this.toastCtrl.create({ 231 | message: "No Such Product Found", 232 | duration: 3000 233 | }).present().then(()=>{ 234 | this.requireOptions = true; 235 | }) 236 | } 237 | } else { 238 | this.productPrice = this.product.price; 239 | 240 | } 241 | 242 | loading.dismiss(); 243 | 244 | } 245 | 246 | } 247 | -------------------------------------------------------------------------------- /src/pages/products-by-category/products-by-category.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Products by Category 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |

{{ product.title }}

22 | 23 |

24 | 25 | 26 |

27 | 28 | 31 |
32 |
33 | 34 | 35 | 36 |
37 | -------------------------------------------------------------------------------- /src/pages/products-by-category/products-by-category.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { ProductsByCategory } from './products-by-category'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | ProductsByCategory, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(ProductsByCategory), 11 | ], 12 | exports: [ 13 | ProductsByCategory 14 | ] 15 | }) 16 | export class ProductsByCategoryModule {} 17 | -------------------------------------------------------------------------------- /src/pages/products-by-category/products-by-category.scss: -------------------------------------------------------------------------------- 1 | page-products-by-category { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/products-by-category/products-by-category.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import * as WC from 'woocommerce-api'; 4 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 5 | // import { ProductDetails } from '../product-details/product-details'; 6 | 7 | @IonicPage({}) 8 | @Component({ 9 | selector: 'page-products-by-category', 10 | templateUrl: 'products-by-category.html', 11 | }) 12 | export class ProductsByCategory { 13 | 14 | WooCommerce: any; 15 | products: any[]; 16 | page: number; 17 | category: any; 18 | 19 | constructor(public navCtrl: NavController, public navParams: NavParams, private WP: WoocommerceProvider) { 20 | 21 | this.page = 1; 22 | this.category = this.navParams.get("category"); 23 | 24 | this.WooCommerce = WP.init(); 25 | 26 | this.WooCommerce.getAsync("products?filter[category]=" + this.category.slug).then((data) => { 27 | console.log(JSON.parse(data.body)); 28 | this.products = JSON.parse(data.body).products; 29 | }, (err) => { 30 | console.log(err) 31 | }) 32 | 33 | } 34 | 35 | ionViewDidLoad() { 36 | console.log('ionViewDidLoad ProductsByCategory'); 37 | } 38 | 39 | loadMoreProducts(event) { 40 | this.page++; 41 | console.log("Getting page " + this.page); 42 | this.WooCommerce.getAsync("products?filter[category]=" + this.category.slug + "&page=" + this.page).then((data) => { 43 | let temp = (JSON.parse(data.body).products); 44 | 45 | this.products = this.products.concat(JSON.parse(data.body).products) 46 | console.log(this.products); 47 | event.complete(); 48 | 49 | if (temp.length < 10) 50 | event.enable(false); 51 | }) 52 | } 53 | 54 | openProductPage(product){ 55 | this.navCtrl.push('ProductDetails', {"product": product} ); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/pages/search/search.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | Search : {{ searchQuery }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |

{{ product.title }}

24 | 25 |

26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |

44 | 45 | 48 |
49 |
50 | 51 | 52 | 53 |
54 | -------------------------------------------------------------------------------- /src/pages/search/search.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { SearchPage } from './search'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | SearchPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(SearchPage), 11 | ], 12 | exports: [ 13 | SearchPage 14 | ] 15 | }) 16 | export class SearchPageModule {} 17 | -------------------------------------------------------------------------------- /src/pages/search/search.scss: -------------------------------------------------------------------------------- 1 | page-search { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/search/search.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, ToastController } from 'ionic-angular'; 3 | import * as WC from 'woocommerce-api'; 4 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 5 | 6 | @IonicPage({}) 7 | @Component({ 8 | selector: 'page-search', 9 | templateUrl: 'search.html', 10 | }) 11 | export class SearchPage { 12 | 13 | searchQuery: string = ""; 14 | WooCommerce: any; 15 | products: any[] = []; 16 | page: number = 2; 17 | 18 | constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController, private WP: WoocommerceProvider) { 19 | console.log(this.navParams.get("searchQuery")); 20 | this.searchQuery = this.navParams.get("searchQuery"); 21 | 22 | this.WooCommerce = WP.init(); 23 | 24 | this.WooCommerce.getAsync("products?filter[q]=" + this.searchQuery).then((searchData) => { 25 | this.products = JSON.parse(searchData.body).products; 26 | }); 27 | 28 | 29 | } 30 | 31 | ionViewDidLoad() { 32 | console.log('ionViewDidLoad SearchPage'); 33 | } 34 | 35 | loadMoreProducts(event){ 36 | 37 | this.WooCommerce.getAsync("products?filter[q]=" + this.searchQuery + "&page=" + this.page).then((searchData) => { 38 | this.products = this.products.concat(JSON.parse(searchData.body).products); 39 | 40 | if(JSON.parse(searchData.body).products.length < 10){ 41 | event.enable(false); 42 | 43 | this.toastCtrl.create({ 44 | message: "No more products!", 45 | duration: 5000 46 | }).present(); 47 | 48 | } 49 | 50 | event.complete(); 51 | this.page ++; 52 | 53 | }); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/pages/signup/signup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Customer Sign Up 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Personal Details 13 | 14 | 15 | First Name 16 | 17 | 18 | 19 | Last Name 20 | 21 | 22 | 23 | Email 24 | 25 | 26 | 27 | Username 28 | 29 | 30 | 31 | Password 32 | 33 | 34 | 35 | Confirm Password 36 | 37 | 38 | 39 | Billing Details 40 | 41 | 42 | Address Line 1 43 | 44 | 45 | 46 | 47 | Address Line 2 48 | 49 | 50 | 51 | 52 | Country 53 | 54 | India 55 | 56 | 57 | 58 | 59 | State 60 | 61 | New Delhi 62 | Uttar Pradesh 63 | Maharashtra 64 | Tamil Nadu 65 | Madhya Pradesh 66 | 67 | 68 | 69 | 70 | City 71 | 72 | 73 | 74 | 75 | Postal Code 76 | 77 | 78 | 79 | 80 | Phone 81 | 82 | 83 | 84 | 85 | Same Shipping Details 86 | 87 | 88 | 89 | 90 | Shipping Details 91 | 92 | 93 | Address Line 1 94 | 95 | 96 | 97 | 98 | Address Line 2 99 | 100 | 101 | 102 | 103 | Country 104 | 105 | India 106 | 107 | 108 | 109 | 110 | State 111 | 112 | New Delhi 113 | Uttar Pradesh 114 | Maharashtra 115 | Tamil Nadu 116 | Madhya Pradesh 117 | 118 | 119 | 120 | 121 | City 122 | 123 | 124 | 125 | 126 | Postal Code 127 | 128 | 129 | 130 | 131 | Phone 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /src/pages/signup/signup.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { Signup } from './signup'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | Signup, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(Signup), 11 | ], 12 | exports: [ 13 | Signup 14 | ] 15 | }) 16 | export class SignupModule {} 17 | -------------------------------------------------------------------------------- /src/pages/signup/signup.scss: -------------------------------------------------------------------------------- 1 | page-signup { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/signup/signup.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams, ToastController, AlertController } from 'ionic-angular'; 3 | import * as WC from 'woocommerce-api'; 4 | import { WoocommerceProvider } from '../../providers/woocommerce/woocommerce'; 5 | 6 | @IonicPage({}) 7 | @Component({ 8 | selector: 'page-signup', 9 | templateUrl: 'signup.html', 10 | }) 11 | export class Signup { 12 | 13 | 14 | newUser: any = {}; 15 | billing_shipping_same: boolean; 16 | WooCommerce: any; 17 | 18 | constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtrl: ToastController, public alertCtrl: AlertController, private WP: WoocommerceProvider) { 19 | 20 | this.newUser.billing_address = {}; 21 | this.newUser.shipping_address = {}; 22 | this.billing_shipping_same = false; 23 | 24 | //this.newUser.billing_address.country = "India" 25 | 26 | this.WooCommerce = WP.init(); 27 | } 28 | 29 | ionViewDidLoad() { 30 | console.log('ionViewDidLoad Signup'); 31 | } 32 | 33 | setBillingToShipping(){ 34 | this.billing_shipping_same = !this.billing_shipping_same; 35 | } 36 | 37 | checkEmail(){ 38 | 39 | let validEmail = false; 40 | 41 | let reg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 42 | 43 | if(reg.test(this.newUser.email)){ 44 | //email looks valid 45 | 46 | this.WooCommerce.getAsync('customers/email/' + this.newUser.email).then( (data) => { 47 | let res = (JSON.parse(data.body)); 48 | 49 | if(res.errors){ 50 | validEmail = true; 51 | 52 | this.toastCtrl.create({ 53 | message: "Congratulations. Email is good to go.", 54 | duration: 3000 55 | }).present(); 56 | 57 | } else { 58 | validEmail = false; 59 | 60 | this.toastCtrl.create({ 61 | message: "Email already registered. Please check.", 62 | showCloseButton: true 63 | }).present(); 64 | } 65 | 66 | console.log(validEmail); 67 | 68 | }) 69 | 70 | 71 | 72 | } else { 73 | validEmail = false; 74 | this.toastCtrl.create({ 75 | message: "Invalid Email. Please check.", 76 | showCloseButton: true 77 | }).present(); 78 | console.log(validEmail); 79 | } 80 | 81 | } 82 | 83 | signup(){ 84 | 85 | let customerData = { 86 | customer : {} 87 | } 88 | 89 | customerData.customer = { 90 | "email": this.newUser.email, 91 | "first_name": this.newUser.first_name, 92 | "last_name": this.newUser.last_name, 93 | "username": this.newUser.username, 94 | "password": this.newUser.password, 95 | "billing_address": { 96 | "first_name": this.newUser.first_name, 97 | "last_name": this.newUser.last_name, 98 | "company": "", 99 | "address_1": this.newUser.billing_address.address_1, 100 | "address_2": this.newUser.billing_address.address_2, 101 | "city": this.newUser.billing_address.city, 102 | "state": this.newUser.billing_address.state, 103 | "postcode": this.newUser.billing_address.postcode, 104 | "country": this.newUser.billing_address.country, 105 | "email": this.newUser.email, 106 | "phone": this.newUser.billing_address.phone 107 | }, 108 | "shipping_address": { 109 | "first_name": this.newUser.first_name, 110 | "last_name": this.newUser.last_name, 111 | "company": "", 112 | "address_1": this.newUser.shipping_address.address_1, 113 | "address_2": this.newUser.shipping_address.address_2, 114 | "city": this.newUser.shipping_address.city, 115 | "state": this.newUser.shipping_address.state, 116 | "postcode": this.newUser.shipping_address.postcode, 117 | "country": this.newUser.shipping_address.country 118 | } 119 | } 120 | 121 | if(this.billing_shipping_same){ 122 | this.newUser.shipping_address = this.newUser.shipping_address; 123 | } 124 | 125 | this.WooCommerce.postAsync('customers', customerData).then( (data) => { 126 | 127 | let response = (JSON.parse(data.body)); 128 | 129 | if(response.customer){ 130 | this.alertCtrl.create({ 131 | title: "Account Created", 132 | message: "Your account has been created successfully! Please login to proceed.", 133 | buttons: [{ 134 | text: "Login", 135 | handler: ()=> { 136 | //TODO 137 | } 138 | }] 139 | }).present(); 140 | } else if(response.errors){ 141 | this.toastCtrl.create({ 142 | message: response.errors[0].message, 143 | showCloseButton: true 144 | }).present(); 145 | } 146 | 147 | }) 148 | 149 | } 150 | 151 | } 152 | -------------------------------------------------------------------------------- /src/providers/woocommerce/woocommerce.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import * as WC from 'woocommerce-api'; 3 | 4 | 5 | @Injectable() 6 | export class WoocommerceProvider { 7 | 8 | Woocommerce: any; 9 | WoocommerceV2: any; 10 | 11 | constructor() { 12 | this.Woocommerce = WC({ 13 | url: "http://52.66.171.54", 14 | consumerKey: "ck_2ec7be12c0191a8a222cb85e89eea6291e0746e1", 15 | consumerSecret: "cs_a300ce55d107c61910208ae1d37f4c4978561b87" 16 | }); 17 | 18 | this.WoocommerceV2 = WC({ 19 | url: "http://52.66.171.54", 20 | consumerKey: "ck_2ec7be12c0191a8a222cb85e89eea6291e0746e1", 21 | consumerSecret: "cs_a300ce55d107c61910208ae1d37f4c4978561b87", 22 | wpAPI: true, 23 | version: "wc/v2" 24 | }); 25 | } 26 | 27 | init(v2?: boolean){ 28 | if(v2 == true){ 29 | return this.WoocommerceV2; 30 | } else { 31 | return this.Woocommerce; 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechrome.github.io/sw-toolbox/docs/master/index.html for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/main.css', 19 | './build/polyfills.js', 20 | 'index.html', 21 | 'manifest.json' 22 | ] 23 | ); 24 | 25 | // dynamically cache any other local assets 26 | self.toolbox.router.any('/*', self.toolbox.cacheFirst); 27 | 28 | // for any other requests go to the network, cache, 29 | // and then only use that cached resource if your user goes offline 30 | self.toolbox.router.default = self.toolbox.networkFirst; -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/v2/theming/ 3 | $font-path: "../assets/fonts"; 4 | 5 | @import "ionic.globals"; 6 | 7 | 8 | // Shared Variables 9 | // -------------------------------------------------- 10 | // To customize the look and feel of this app, you can override 11 | // the Sass variables found in Ionic's source scss files. 12 | // To view all the possible Ionic variables, see: 13 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/ 14 | 15 | 16 | 17 | 18 | // Named Color Variables 19 | // -------------------------------------------------- 20 | // Named colors makes it easy to reuse colors on various components. 21 | // It's highly recommended to change the default colors 22 | // to match your app's branding. Ionic uses a Sass map of 23 | // colors so you can add, rename and remove colors as needed. 24 | // The "primary" color is the only required color in the map. 25 | 26 | $colors: ( 27 | primary: #387ef5, 28 | secondary: #32db64, 29 | danger: #f53d3d, 30 | light: #f4f4f4, 31 | dark: #222 32 | ); 33 | 34 | 35 | // App iOS Variables 36 | // -------------------------------------------------- 37 | // iOS only Sass variables can go here 38 | 39 | 40 | 41 | 42 | // App Material Design Variables 43 | // -------------------------------------------------- 44 | // Material Design only Sass variables can go here 45 | 46 | 47 | 48 | 49 | // App Windows Variables 50 | // -------------------------------------------------- 51 | // Windows only Sass variables can go here 52 | 53 | 54 | 55 | 56 | // App Theme 57 | // -------------------------------------------------- 58 | // Ionic apps can have different themes applied, which can 59 | // then be future customized. This import comes last 60 | // so that the above variables are used and Ionic's 61 | // default are overridden. 62 | 63 | @import "ionic.theme.default"; 64 | 65 | 66 | // Ionicons 67 | // -------------------------------------------------- 68 | // The premium icon font for Ionic. For more info, please see: 69 | // http://ionicframework.com/docs/v2/ionicons/ 70 | 71 | @import "ionic.ionicons"; 72 | 73 | 74 | // Fonts 75 | // -------------------------------------------------- 76 | 77 | @import "roboto"; 78 | @import "noto-sans"; 79 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "module": "es2015", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es5" 15 | }, 16 | "include": [ 17 | "src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules" 21 | ], 22 | "compileOnSave": false, 23 | "atom": { 24 | "rewriteTsconfig": false 25 | } 26 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-duplicate-variable": true, 4 | "no-unused-variable": [ 5 | true 6 | ] 7 | }, 8 | "rulesDirectory": [ 9 | "node_modules/tslint-eslint-rules/dist/rules" 10 | ] 11 | } 12 | --------------------------------------------------------------------------------