Ecommerce Solution With CMS and Mobile App 1.0
Ionic-React WooCommerce is an easy solution for pragmatic developers around the world. With just one single compilation you can create mobile apps for your WooCommerce website and publish the Apps on play store and Appstore. It accommodates massive number of very famous and essential plugins like
Following are the objectives of Ionic-React WooCommerce:
Following are essentials you must have before installation
The package include:
Before you use the app and start the installation process on your machine, this is important points to know in detail.
For Ionic-React mobile app development, you need Ionic-React development environment ready. Please follow below official links to setup your development machine.
https://ionicframework.com/getting-started
https://ionicframework.com/docs/installation/cli
Below given are the essential dependencies that are needed to build the application and also for testing purpose i.e
Application is tested in following enviroment
Now we have set up the Ionic-React environment.
For install Ionic-React environment use this link
https://ionicframework.com/docs/react
You should have to install node modules in application first. For this purpose, apply following command
npm install
After node modules installation, if you find following error
Apply following command for successful compilation
npm rebuild node-sass
We need to connect our app with woocommerce website. Open the folder name (App Source Code)inside the downloaded packages.
Inside the folder, you will find all the Ionic-React application code.
You can need following file
folder/src/providers/WooComAPI/woo-com-api.ts
Now open project folder/src/providers/WooComAPI/woo-com-api.ts file and change the following.
It will load woocommerce products data into your application.
For application configurations:
The app has english language as default.the app has 2 languages(English, Arabic) preinstalled. You can switch the language to arabic.
To change the default language of the app. Please open the file app/src/providers/WooComAPI/woo-comp-api.js at the top of the page you can find below code.
localStorage.languageCode =”en”
This is your language two letter code change it to arabic we have to put the arabic country code here. which is “ar“.
localStorage.languageDirection = “ltr”
Every language has its own direction. So if you change the application language then you also has to define its direction(ltr, rtl). For left to right use “ltr” and for right to left use “rtl”. In case of arabic we have to change this to =”rtl”.
Now we have to remove the cache of the browser to see the changes we have made.
App has only two languages. But you can add more languages.to add new language. Please open the app/src/provider/i18n/GlobalLanguageJson.js. This folder has one file GlobolLanguageJson.js. This file contains all the app labels.
For example we want to add french language we copy the “a2” object from GolabLanguageJson.js file and add a new object a3{}
Then we open the file in editor and replace the translation of all the labels on right side of the labels. like
we have Close: “Close” in english, we replace it with french like this. Close: “Fermer”
After translating all the labels save the file and then change the language code and direction. To make it default.
// For Example
//a3:{
//}
Default currency is "USD". You can replace this with "EUR" to change currency.
The app has “$” currency as default.the app can have multiple currencies depending to your admin panel
To change the default currency of the app. Please open the file
app/src/providers/WooComAPI/woo-comp-api.js
at the top of the page you can find below code.
localStorage.currency = “$”
this is the currency Decimal code. you can get your code from the link https://html-css-js.com/html/character-codes/currency/
Please find your currency Decimal code and replace it.
localStorage.currencyCode = “USD”;
this is currency iso code you also find this from the link https://html-css-js.com/html/character-codes/currency/
please find your iso code and replace it with above code.
localStorage.currencyPos = “left”;
you can also control the currency direction you can place it either left or right side. To change it to right just change the left with right.
localStorage.decimals = 2;
this is the decimal placement of the currency with decimal 2 your currency will look like this
6.00$ (six dollar with 2 decimal value)
6.000$(six dollar with 3 decimal value)
change the value according to your requirement.
Please remove the cache of the browser to see the effect of changes. or uninstall the app if you are testing in real device and rebuild the app.
Default navigation is "side". You can replace this with "tabs" to change applicaiton navigation.
For tabs, you have to replace false with true for tabs Navigation
We have added JSON API and Ionic-React eCommerce plugins. These plugins can be installed in two ways.
You will find the JSON API and Ionic-React eCommerce plugins in a zipped folder in the pack.
Go straight to the admin panel>Plugin>Add New.
The above-given page will show up. From here, click on the “upload plugin” option, make sure that the plugin that you have is in .zip format. Click on the “Browse” option, upload the plugin folder and once the folder is chosen, click on the “Install Now” option”
Once the plugin is installed, you can activate or deactivate the plugin through settings according to your usage.
After WordPress plugins installation and setup, please follow the below-mentioned instructions to set up your mobile application.
After Intallation of plugin need to activate the controllers from Settings >> Json APi
Ionic-React Woocommerce app works with woocommerce rest api, please follow the link below to enable woocommerce rest api on your server.
https://docs.woocommerce.com/document/woocommerce-rest-api/
After enable rest api, please make sure your site woocommerce rest api working correctly. You can follow that simple tutorial link to check whether rest api works correctly on your sever or not.
https://github.com/woocommerce/woocommerce/wiki/Getting-started-with-the-REST-API
Now you have all set at your wordpress site end. Please proceed with ionic source code setup.
To enable the REST API with in WooCommerce, go to WooCommerce> Settings> Advanced and tick the Enable Legacy API link
The WooCommerce REST API works on a key system to control access. These keys are linked to WordPress users on your website.
To create or manage keys for specific WordPress user:
Go to: WooCommerce> Settings> Advanced> REST API
This allows you to log in through your Facebook credentials. Here is the official link with the detailed demonstration of Facebook integration
You have to enable facebook from CMS.
For more details please visit
https://ionicframework.com/docs/native/facebook/
Facebook App Id for application
File path for your facebook app id for application is
folder/android/app/src/main/res/values/string.xml
To avail of this feature, you need to create OneSignal account and obtain both needed keys that are App ID and App key. Place them here and make this feature functional. You can offer various discount coupons to your distinguished customers that would appear in their app like this
Here is the official link that would guide you throughout the process of OneSignal account creation
Generate a Google Server API Key
Your Google Server API Key and Google Project Number are used to send push notifications to ANDROID devices.
To begin, we’ll obtain a Google Server API Key and Google Project Number. These keys allow OneSignal to use Google’s web push services for your notifications.
Create A Firebase Project
Firebase Cloud Messaging Token and Sender Id
Getting your Firebase Cloud Messaging token and Sender ID
OneSignal App Android Setting
Configure your OneSignal app’s Android platform settings
Generate an IOS Push Certificate
Required for all IOS apps.
Required For Setup
Provisioning
Option A: Create Certificate Request Manually
We recently released a tool to automate this process!
Make sure your role for the team is Admin inside your Apple Developer account > Membership section. Otherwise you will not be able to use this tool.
Simply follow the directions on OneSignal’s Provisionator Tool then continue to Step 4.
OR
Option B: Create Certificate Request Manually
Enable Push Notification
To enable Push Notifications and apply the Certification Request to generate Certificate.
Creating A Private Key
Upload Your Push
Upload Your Push Certificate to OneSignal.
If you haven’t already, you should set up your OneSignal account.
If you want to show the “cancel order” button, select show. While you can also hide it by applying the “hide” option.
From here you can set a certain time duration, prior to which the buyer can cancel the order. For instance, the 8 Hours option implies that order could be cancelled at least 8 hours prior to the agreed delivery time.
This allows you to choose any of Home Screen Style from 8 available styles.
This option allows you to display or hide the “Cart”.
Here you need to place the URL of your business website.
Here you ought to place a specific currency symbol that you deal in.
This option allows you to tag your new arrivals as “New Product” for as many days as you select this option.
This option allows you to place a filter of maximum price so that the products falling within this certain range show on your site page.
If you want to show the “cancel order” button, select show. While you can also hide it by applying the “hide” option.
In checkout types, there are three further options available.
By enabling this option, you allow a random visitor to place the order without properly registering.
This custom CSS allows you to change/modify your checkout page options right in the manner you like.
This entire page is designed in order to facilitate the client in contacting you. You are supposed to fill in each column on this page appropriately and accurately. This contact form is a bridge between you and the client.