Posts

Ultimate Magento 1 Developer Guide : How to get product details using rest API in Magento 1.x ?

Future is mobile apps. Especially, eCommerce Mobile Apps. Sooner or later you’ll run into a case where you need REST API for your online store and you found that Magento does not support all Magento REST API. What should you do now? How can you write REST API for your online store as per client need?

The Magento REST API allows you to use various data entities such as customer, catalog and order information to third-party applications. I’d like to share it with you a quick, simple, well written and easy solution which will explain how can you retrieve the product details with the help of REST API.

You are working on a mobile application and want to display product after customer selected a category. You are able to get the list of the product by category in REST API request but that list doesn’t have many details about the product and you want to show more product details to the users. What should you do to get more product information so that you can show the image and other things in a mobile app?

Magento Rest API for Product Details by SKU

Step 1: Get the SKU which you need to get the product details.

      $sku  =  $this->getRequest()->getParam('SKU');

Step 2: Load the product using the product SKU. We can also load product by its attributes, like SKU, Id. Assuming product SKU to be ‘1000’.

    
       // Mage main object
	$catalogMageObj = Mage::getModel('catalog/product');
	$products = $catalogMageObj->loadByAttribute('sku', $sku);

Step 3: load the product custom attributes details.

	$custom_attributes = array();
	$attributes = $products->getAttributes();
	foreach ($attributes as $attribute) {
		if ($attribute->getAttributeCode() =="category_ids"){
			$custom_attributes[] = array(
				"attribute_code"=> $attribute->getAttributeCode(),
				"value"=> $products->getCategoryIds()
			);
		}
		else{
			$custom_attributes[] = array(
				"attribute_code"=> $attribute->getAttributeCode(),
				"value"=> $attribute->getFrontend()->getValue($products)
			);
		}
	}

Step 4: Create and return the full array of the loaded product.

	
protected function getProductDetailsBySku()
{
        $sku  =  $this->getRequest()->getParam('sku');	

        // Mage main object
	$catalogMageObj = Mage::getModel('catalog/product');
	$products = $catalogMageObj->loadByAttribute('sku', $sku);

	$custom_attributes = array();
	$attributes = $products->getAttributes();
	foreach ($attributes as $attribute) {
		if ($attribute->getAttributeCode() =="category_ids"){
			$custom_attributes[] = array(
				"attribute_code"=> $attribute->getAttributeCode(),
				"value"=> $products->getCategoryIds()
			);
		}
		else{
			$custom_attributes[] = array(
				"attribute_code"=> $attribute->getAttributeCode(),
				"value"=> $attribute->getFrontend()->getValue($products)
			);
		}
	}
				
	$data = array(
		'id' => $products->getEntityId(),
		'sku' => $products->getSku(),
		'name' => $products->getName(),
		'attribute_set_id' => (int)$products->getAttributeSetId(),
		'price' => $products->getPrice(),
		'status' => $products->getStatus(),
		'visibility' => $products->getVisibility(),
		'type_id' => $products->getTypeId(),
		'created_at' => $products->getCreatedAt(),
		'updated_at' => $products->getUpdatedAt(),
		'product_links' => $productstypes, 
		'custom_attributes'  => $custom_attributes
	);
		
	//return $products;
	return $data;
}

How to get Configured Product Extension Attributes

Getting all options of a specific attribute in Magento is fairly easy but sometimes A more challenging task is to get the options and values that are applicable to a particular configurable product. This can solve using the following code:

// get product extension attributes details
	public function getProductExtensionAttributes($productObj){
		
		if (!is_object($productObj)){
			return false;
		} 
		
		$extensionAttributesFinalArray = array();
		$extensionAttributesArray = array();
		if ($productObj->isConfigurable()){
			$optionsData = $productObj->getTypeInstance(true)->getConfigurableAttributesAsArray($productObj);
			foreach ($optionsData as $option) {
				// get option values
				$values =  $option['values'];
				$tempDataItems = array();
				foreach ($values as $value) {
					$tempData = array(
							"value_index" => $value['value_index'],
							"title" => $value['label']
					);
					$product_super_attribute_id =  $value['product_super_attribute_id'];
					array_push($tempDataItems, $tempData);
				}
				
				// create temp array for extension_attributes
				$extensionAttributesTempArray = array(
						"id" => $option['id'],
						"label" => $option['label'],
						"position" => $option['position'],
						"attribute_id" => $product_super_attribute_id,
						"values" => $tempDataItems,
						"product_id" => (int)$productObj->getEntityId(),
				);
				array_push($extensionAttributesFinalArray, $extensionAttributesTempArray);
			}
			$extensionAttributesArray['configurable_product_options'] = $extensionAttributesFinalArray;
			$extensionAttributesArray['configurable_product_links'] = [];
		}
		
		// returning response
		return $extensionAttributesArray;
	}

The resulting array will consist of an associative array, indexed by the attribute label, with nested arrays containing attribute value => attribute label items.

Conclusion

This is the era of eCommerce with the Mobile app as peoples are spending time on their mobile. The user has various choices to purchase an item from the web that’s why your eCommerce website should remain competitive in your business. The mobile app is a new way, which turns your Magento website into a fully functional eCommerce store with everything user needs.

On this tutorial, we have discussed how to get all the product details Magento which you can use to develop your Magento Mobile App.

References

Further reading

Ultimate Magento 1 Developer Guide : Token Base Rest API for authentication and authorization

Security has always been a major concern we talk about high-level applications or mobile apps, especially when we talk about exposing our business through services. I have already explained a lot of REST API in my earlier articles. I explained, how do we create a Magento 1 REST API, how do we get the available categories from the store, How can you search the products in your mobile app etc. This article will explain how to make token based REST API to handle authentication among the devices. There is no standard way of doing token based authentication on the Magento 1 that’s why we design our own security technique and structure which suits best to our application.

One of the key principles of REST is that it’s stateless. This means that the server never keeps user state. In the context of security, this aspect has impacts when implementing security. This means that authentication hints must be sent and verified at each time.  An authenticated user will be allowed to access resources for a particular period of time and can re-instantiate the request with an increased session time delta to access other resource or the same resource.

Magento REST API Security

Magento 1 Security in itself is very complicated and tricky topic. I’ll try to explain how we can achieve it in REST API security in my own way. When we plan to create a mobile app, we especially want to take care of authentication and authorization. There are various ways to achieve security in Magento 1 but we have decided to use token-based authentication on our mobile app.

Authentication

Authentication is all about the identity of an end user. It’s about validating the identity of a user who is accessing our system, that he is authenticated enough to use our resources or not. Does that end user have valid credentials to log in our system? Credentials can be in the form of a username and password. We’ll use Basic Authentication technique to understand how we can achieve authentication in WebAPI.

Authorization

Authorization should be considered as a second step after authentication to achieve security. Authorization means what all permissions the authenticated user has to access web resources. Is allowed to access/ perform an action on that resource? This could be achieved by setting roles and permissions for an end user who is authenticated or can be achieved through providing a secure token, using which an end user can have access to other services or resources.

Magenot Token Based Authorization

Authorization part comes just after authentication, once authenticated a service can send a token to an end user through which user can access other resources. The token could be any encrypted key, which only server/service understands and when it fetches the token from the request made by the end user, it validates the token and authorizes user into the system. Token generated could be stored in a database or an external file as well i.e. we need to persist the token for future references. The token can have its own lifetime and may expire accordingly. In that case, the user will again have to be authenticated into the system.

Implementation of the token based authorization in Magento 1

Below is the code which we have used to create & manage tokens in Magento 1.x version.

 Public function generateUserToken($data){
        // get the username & password of the user
        $username = $data['username'];
    	$password = $data['password'];

        // check username password exists on our system or not
         if (!$customer->authenticate($username, $password)) {
              // user is not registered with this Magento 1 website
         }

        // load customer details if exist
	$customerObj = $customer->loadByEmail($username);
	$customerId =  $customerObj->getEntityId();

        // check user token is already generated or not and return token if exist and return the token from database if exist
	$customerapitokensObj = Mage::getModel('customerapi/customerapitokens');
	$customerapitokensObj->load($customerId, 'customer_id');
	if ($customerapitokensObj->getToken()){
		$token = $customerapitokensObj->getToken();
		return $token;
	}

        // generate token and save customer tokens
	try {
                // create MD5 token with username and password and date comibanation to make token unique
		$date  = date("Y-m-d H:i:s")."".$username."".$password;
		$token = md5(uniqid($date, true));
				
		$customerapitokensObj->setCustomerId($customerId);
		$customerapitokensObj->setToken($token);
		$customerapitokensObj->setStatus(1);
		$customerapitokensObj->setDate(date("Y-m-d H:i:s"));
		$newUserData = $customerapitokensObj->save();
				
		return $token; 
	} catch (Exception $e) {
		$this->_critical($e->getMessage(), Mage_Api2_Model_Server::HTTP_UNAUTHORIZED);
	}

}

Database Structure for the Token support

magentoTokenBasedAutentication

 

Conclusion

In this article, I tried to explain about how we can build an API application with basic Authentication and Authorization. One can mold this concept to achieve the level of security needed. If you want to implement Token-based-authentication on your Magento 1 mobile apps then you will find these above steps easier. The above code will create and manage the token-based authentication on your Magento 1 store and you can display on your mobile app. If any better approach or solution your thoughts are most welcome. Please share with us so that it might help others as well.

References

Further reading

 

14 features in eCommerce Mobile App to increase your sales

The boom in mobile eCommerce has led to the creation of mobile apps and platforms. Our generation has become a comfortable shopping and paying their mobile devices. Smartphones and eCommerce Mobile App are having a meaningful impact on how we buy. Sales via the eCommerce Mobile App have grown 39% over last year to reach $123.13 billion this year in the United States. This means m-commerce will account for 1/3 of all eCommerce sales. Here is a list of 14 must-have features that attract online shoppers.

eCommerce Mobile App Features

  1. Simple Registration Process: Almost customers will not like to fill the long forms demanding too much information. Make the registration process simple & put smallest required fields for ease operation. People rarely prefer the app which demands too much information for a registration.
  2. All payment options supported: Sometimes it happens that a buyer has a strong wish to buy a product from the specific mobile app. Unfortunately, he doesn’t find the payment option he wants, then it may result in the decreased sale ratio. Put all possible payment options which are used by the most shoppers.
  3. Eye-popping themes: A phone has a limited space and if the design is too cluttered, it would make the user journey complicated. Ensure the app uses space without compromising on design and meets business objectives. Moreover, the visual should be attractive, engaging and must convey to the users. What an app does and why it is better than the competition
  4. A feature of Push Notifications: Some of the most successful eCommerce mobile apps are the ones that have Push Notifications into their list of features. Push notifications tend to inspire immediate action like exclusive promotions, special offers. You can pair up this feature with analytics, and you would see a significant boost in sales in no time.
  5. 100% Custom Branding: Get a custom mobile app with your own logo and color combinations at a nominal cost of development. which will add greatest features to your users like displaying products listing, users account creation, adding into carts, apply coupons, checkout, view order and much more.
  6. Synchronizations: Any changes on the website to the Categories, Catalog or Customers profile get reflected in your mobile phone app. So you don’t have to perform the changes on your app again
  7. Google Analytics: Google Analytics for Mobile Apps measures your app’s full value. See what users love and how to make them happier — and make your app more successful.
  8. Product Review: You might think that having negative reviews is a sale killer. The opposite is actually true. Having negative reviews can often be positive. It’s shown that products without negative reviews are seen as censored.
  9. Wish List Button: E-commerce sites that aren’t using wish lists are leaving revenue on the virtual desktop table. What’s better than having customers bookmark items they want and will most likely buy in the future?
  10. Related Products: People that buy online are impatient and you constantly lose sales as a result. Use Recomatic to display smart Related Products and get those sales back. No time to set it up? No problem! We take care of everything for you.
  11. Quick Checkout: A mobile app should contain Quick Checkout feature. The Quick Checkout feature allows shoppers to complete an order with predefined information from the quick check out profile and automatically sets the shipping and billing addresses for the customer.
  12. Multi-Currency: Build Magento app that can transact in an endless list of international currencies including USD, GBP, EURO, AED, YEN, INR and much more. Offer customers the true experience of international payments, anywhere, anytime.
  13. Multi-Lingual: A mobile app should also contain multiple language support so that customer can convert your store into 30 or more languages of their choice by simply selecting the languages from the drop down menu.
  14. Return Policy: Return policies are an essential feature of any e-commerce website. return policy should be clearly visible and well-written or illustrated.

Above mentioned are just main features that any E-commerce app must have. Excluding these, there are many other features which make the app successful. So, for the extended requirements of your business, you may have other customized app features.

Conclusion

A Good mobile app involves more than technology and the latest tools. An effective mobile app is a platform that requires a solid strategy. These are the very common feature which a mobile app have. If you are planning to create an eCommerce mobile app than the experienced team at Ipragmatech will help you. We will first understand your ideas and then creates an amazing product to you. which is Mobile App Builder for e-commerce Mobile App to you. If you need more help and idea about setting up your mobile app, feel free to contact us.

References

Magento: A Gift for You

Mobile app builder for your online store based magento2

Further Reading

7 Reasons to choose Magento eCommerce platform for your Online Store

A complete guide to build a native e-commerce mobile app

6 Reasons eCommerce Store Needs Mobile App

 

How to build custom Magento Rest API effortlessly in less than 2 hours : Part 1

Sooner or later you’ll run into a case where you need REST API for your online store and you found that Magento does not support all Magento REST API. What should you do now? How can you write REST API for your online store as per client need?

The Magento REST API allows you to use various data entities such as customer, catalog and order information to third party applications. I’d like to share it with you a quick, simple, well written and easy solution with will explains how you can write an extension for Magento REST API.

Magento REST API Features

  • Simplistic design approach
  • Testing and troubleshooting is easier
  • Better performance than ever
  • Ability to manage customers, addresses, orders, inventories and products using HTTP verbs such as GET, POST, PUT and DELETE.
  • Data requests and responses can be in XML or JSON format.

Custom Extension for REST API

Create new custom module on your Magento server with the following structure to create a custom module with REST support.

rest-api-structure

 

Here’s the list of files required for the desired setup, Here Ip is the package and Productapi are the module name. You can edit as per your need:

  • app/code/local/Ip/Productapi/etc/config.xml: It’s a module configuration file.
  • app/code/local/Ip/Productapi/etc/api2.xml: It’s a file which declares the APIs provided by our module.
  • app/code/local/Ip/Productapi/Helper/Data.php: It’s a file used by the Magento translation system.
  • app/code/local/Ip/Productapi/Model/Api.php: It’s a model file which implements the logic of our API methods.
  • app/code/local/Ip/Productapi/Model/Api2/Product/Productlist/Rest/Guest/V1.php: It’s a file to support Magento’s v1 REST API.

Magento REST API Step 1: Enabling Extention

The first thing to now do is create your module definition file in app/etc/modules (not in the above folder diagram). For my extension, this is call Productapi.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Ip_Productapi>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Ip_Productapi>
  </modules>
</config>

Magento REST API Step 2: Extensions Configuration

Now, we need to start setting up our extensions configuration.  We need two files for this in our extension’s etc folder; config.xml and api2.xml.

Config.xml:

Create the config.xml file and put in the Ip -> Productapi -> etc directory and paste the below code. Here we are configuring Helper and Model file for the REST API and no need to change in Magento core file.

<?xml version="1.0"?>
<config>
  <modules>
    <Ip_Productapi>
      <version>0.1.0</version>
    </Ip_Productapi>
  </modules>
  <global>
    <helpers>
      <productapi>
        <class>Ip_Productapi_Helper</class>
      </productapi>
    </helpers>
    <models>
       <ip_productapi>
             <class>Ip_Productapi_Model</class>
        </ip_productapi>
        <api2>
	      <rewrite>
	            <request>Ip_Productapi_Model_Api2_Request</request>
	       </rewrite>
	</api2>
    </models>
  </global>
</config> 

api.xml: 

Create api2.xml and put in the Ip -> Productapi -> etc > api2.xml and paste the below code:

<config>
    <api2>
        <resource_groups>
            <ip_productapi translate="title" module="ip_productapi">
                <title>Ip Products</title>
                <sort_order>10</sort_order>
            </ip_productapi>
        </resource_groups>
        <resources>        
        	<ip_productapi_list translate="title" module="ip_productapi">
                <group>ip_productapi</group>
                <model>ip_productapi/api2_product_productlist</model>
                <title>Product List</title>
                <sort_order>11</sort_order>
                <privileges>
                    <guest>
		         <retrieve>1</retrieve>
                    </guest>
                    <customer>
		          <retrieve>1</retrieve>
                    </customer>
                </privileges>
                <attributes translate="attribute1 attribute2 attribute3" module="ip_productapi">
                    <attribute1>attribute1</attribute1>
                    <attribute2>attribute2</attribute2>
                    <attribute3>attribute3</attribute3>                    
                </attributes>
                <routes>
                    <route_entity>
                        <route>/ip/V1/products</route>
                        <action_type>entity</action_type>
                    </route_entity>
		</routes>
                <versions>1</versions>
            </ip_productapi_list>
        </resources>
    </api2>
</config>

On the Model(under Resource), we are telling Magento the name of the models used in the API calls. privileges section say what our users(guest, customer) can do here.

On the attributes section, we are set up the attributes which we need on the REST API response. For the moment we are returning three attributes(attribute1, attribute2, attribute3).

The last section of api2.xml is the route. On the route section, we are telling the front controller name of the REST API. Magento API runs on the route and whenever gets API call it uses the route and pass request to the definition. That’s all from extension configuration and now all we need to do is write the API class to handle the REST request.

Magento REST API Step 3: Helper file

Next, we’ll need to create the Helper file to make sure the translation system of Magento works . It’s almost an empty file, but should be there as per the conventions!

<?php
/**
 * Copyright © 2015 Ipragmatech . All rights reserved.
 */
namespace IpragmatechIpreviewHelper;
class Data extends MagentoFrameworkAppHelperAbstractHelper
{
	public function __construct(MagentoFrameworkAppHelperContext $context
	) {
		parent::__construct($context);
	}
}

Creating Magento REST API Model file

we need to create a model file to support the Magento V1 API. Let’s create a model file with the following contents. On this file, we will write our logic and return the response.

<?php
/**
 * Override for Magento's Catalog REST API
 */
class Ip_Productapi_Model_Api2_Product_Productlist_Rest_Guest_V1 extends Mage_Catalog_Model_Api2_Product_Rest 
{
	/**
	 * Return item GET
	 */
	protected function _retrieve()
	{
		// Write your code Here
	}	
}

Note

So that’s it as far as the file setup is concern for the custom API implementation. If you’re curious, enable the module from the back­-end and don’t forget to clear the cache. In the next Article, we’ll go ahead and know how to configure the application with the Admin role.

Conclusion

It’s important to remember that HTTP was conceived to communicate between systems, which share nothing but an understanding of the protocol. In general, the fewer assumptions beyond HTTP you make, the better: this allows the widest range of programs and devices to access your API.
If you are planning to add Magento REST API functionality on your website or mobile app then this article gives you the complete guide for creating Magento REST API structure in less time, effort and cost. You can also join the conversation if you have any other solution or idea which we can use to make it more attractive and easy. That’s all folks and feel free to contact us in case if you have any query.

References

For further reading

Is React Native a good choice for developing consumer or business mobile app?

Well ! As the ways of developing an app are changing these days, it provides useful and user-centric apps to businesses and organizations for improving their business presence through a mobile app. These all changes are possible due to the presence of various cutting-edge tools, platforms, and frameworks. These all things have brought ease and convenience for developers and designers to create incredibly potential mobile apps. The React Native is one of the new entrances in the mobile app development platform. It is a cross-platform app framework created by Facebook. It allows developers to use JavaScript in order to create mobile apps for both Android and iOS that look, feel, and are native.

React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about – learn once, write anywhere. So in few words, we can define ReactNative as:

  • It is a framework for mobile development
  • Responsible for building native mobile application
  • Provides basic set of components for mobile platforms
  • Uses ReactJs to build mobile app components

Benefits of React Native

There are many advantages for using React Native Framework but most effective are listed below

  • Code Reusability: Allow you to write some basic UI code that can be shared together with all the logic. Having the capacity to share the code is in good interest for many reasons like- better usage of human resources, less code to maintain, less possibility of bugs and much more.
  • Effective Developer Experience: With React Native it is not necessary to re-compile the entire rebuilt application every time you make a change, simply choose Cmd+R and refresh, like refreshing the browser to reflect the changes saving a lot of re-compilation time.
  • Declarative API: It allows you to consider only the current UI state without keeping track of the older ones.
  • Easy Reloading: It removes the need for recompilation of the application each time a change has been made. All that is required to see changes implemented in the code, is to refresh the app in the simulator, emulator, or device.
  • Cross Platform: It means that you need to write the code once and use it on multiple platforms like iOS, Android etc.
  • Open Source: It is open source and so, there is a big community of developers helping to implement more features, fix bugs, and help people.

Benefits of Native App

Native apps are smartphone applications written specifically for a particular device. iPhone apps are written in Obj-C or Swift while Android apps are written in Java.

  • Faster: Since native apps work with the device’s built-in features, they are easier to work with and also perform faster on the device.
  • Quality: While other methods can achieve greatness, native applications have the opportunity to be set apart. Greater chance your app will not get rejected due to poor user experience because the native app uses their native hardware’s feature to run the app.
  • Aspect Ratio: Apps developed for tablets can’t be used for phones and vice versa. Not just the aspect ratios are different, but dpi also vary from one device to another. All these differences can completely change how should an app look and workUsing Obj-C or Java gives you more control on the size, resolution and even orientation.
  • Native Look and Feel: We love being at home. Your application feels like it belongs to your device. Native apps feel and look like default apps, and users quickly get used to specific icons and button. Mobile apps that try to produce that old look again often appear worse because of unnatural valley effect.

Native or React Native?

Every framework has their pros and cons like – As React Native is new, it is not very perfect yet and it still has some bugs. There are still some features that are available in the native frameworks that have not been exposed to React Native.So, sometimes, developers can be stuck when diving deeper. On the other hand, Native is time-consuming and more costly due to high maintenance of multiple code bases. It may require more developers with experience in each framework to maintain.

In order to decide if you want to develop a native app or React Native app, you need to consider the following points:

  • your existing coding skills,
  • the purpose of your app,
  • the longevity of the project.
  • How important speed and performance would be, to you
  • If you would like your app to include any device-specific features
  • Your budget, vs. the estimated cost of developing your app

Conclusion

Though, React Native is following the write once and run anywhere, it would be proved to be a successful solution if you are building an app for any social group, eCommerce business etc. but, not any graphic specific app like- game because it can make your app slow and less responsive.

So, if you are new in the mobile development, I would recommend you to start with android native instead of React Native if you want to particularly develop android apps. As it will help you to understand the background knowledge of the Android which is required for any android app development otherwise you can be stuck in some problems which are related to the underlying platform. Especially, when your app targets many android API versions. I hope this article helped you in deciding which platform will suit you most for your app development. 🙂

If you are looking for React native developer with great experience please contact us at iPragmatech. We provide end to end Software Development based on the latest technologies back by unique quality management systems to provide complete client satisfaction. Clear communication, dedicated support, prompt response and on-time delivery of solutions within the budget are the main USP of our company.

If you are interested in designing a mobile app, please get in touch with us.

Here are our Contact Details:

References

React Native

Facebook React

Further Reading

Quick guide to search, sort and filter products in prestashop mobile app

PrestaShop is based on open source platform for e-commerce which provides smooth shopping cart system with control over the look and functionality of the store. It is growing in the e-commerce market day by day. More traders are using this platform for their e-store. It provides various feature for an e-commerce store , you can check its features in our previous blog. With the increase in the e-commerce stores, mobile-commerce has also become popular these days. Mobile visits account for one-third of e-commerce sites traffic. To have an e-commerce mobile app for electronic commerce store is like putting a  retail outlet in the customer’s pocket . PrestaShop provides SEO, items management, and other tools which enforce traders to have the mobile app for superb shopping experience for customers.  In this blog, I am going to discuss some important features i.e searching , sorting and filtering implementation in the Prestashop mobile app.

Let me first start with the basics. PrestaShop system API is constructed by principle CRUD (Create, Read, Update, Delete). All methods are to be called through the /api/ gateway. Most methods can be accessed in a REST manner, with the 5 main HTTP request methods: HEAD, GET, POST, PUT, DELETE.

How to Search products in PrestaShop mobile app using REST API

search can only be accessed using GET and HEAD in PrestaShop API . Following the syntax for retrieving searched data or product :

      /api/method/?filter[parameter name to search]=[parameter value to search]

for example- let search a product by its name , then its request call will be like :

 /api/products/?display=full&filter[name]=[Blouse]

This call will return the product full details with the name “Blouse”. In the above syntax “parameter name to search” can be anything that products method has in its schema. You can search as many numbers of values at a time i.e :

 /api/products/?display=full&filter[name]=[Blouse, Shirt, Top]  .

 /api/customers/?display=full&filter[firstname]=[John]&filter[lastname]=[Parol] .

How to Sort products in PrestaShop mobile app using REST API

Following the syntax for retrieving searched data or product :

      /api/method/?sort=[sort by field with the suffix _ASC _DESC or in the order]

for example- let sort products by its name , then its request call will be like :

/api/products/?display=full&sort=[name_ASC]

This call will return the product in ascending order of ‘name’ with all details.

      /api/products/?display=full&sort=[price_DESC]

How to Filter products in PrestaShop mobile app using REST API

Following the syntax for filtering data or products :

      /api/method/?filter[field]=[value1|value2]

Above syntax  filter “field” with value between ‘value1 ” and “value2”

      /api/method/?filter[field]=[value1,value2...]

Above syntax  filter  field for values specified between brackets   

      /api/method/?filter[field]=[value]%

Above syntax  filter “columns” for values containing “value”

for example- let filter products by its ids then its request call will be like :
/api/products/?display=full&filter[id]=[1,10]  – This will list the products with id 1 to 10.

/api/products/?display=full&filter[id]=[1|5]  – This will list all the products between 1 to 5

/api/products/?display=full&filter[name]=[appl]%  – This will list all the products name starting with “Appl”.

NOTE: In the above all calls “display=full” means it will display all product details. You can display your product according to your choice. For example – “display=[birthday]” will display only the birthday.

Conclusion

As the implementation of PrestaShop framework is increasing day by day for the e-commerce stores , demand for mobile-commerce is also increasing with the same speed and popularity. So developing an e-commerce mobile app is becoming common and for any e-commerce store searching, sorting and filtering are very common and powerful property. Keeping these all things  in mind I wrote this article to help the new developer for PrestaShop. I hope this will help you… :-). Below is our sample app based on Prestashop REST API, you can refer it as an example which has shown the use of sort, search and filter APIs.

prestashopeePrestashopee
The PrestaShopee mobile app developed using native platforms that gels well with all mobile devices.It has used PrestaShop’s APIs for data. Further performance wise your app will be steadfast and hence customers are assured of a quick shopping experience.

References

Prestashop is a free open-source which provides the solution for e-commerce. For more information, you can visit the following link PrestaShop.

PrestaShop provides documentation for the list of all basic APIs that  are needed for the e-store.To get more details about the documentation you can visit this link PrestaShop Webservice

A complete guide to build a native e-commerce mobile app.

Mobile technologies are emerging as a growth engine for small and medium enterprises (SME). Many studies have proved that SMEs who adopt mobile technologies to stay connected with customers and streamline operations are growing revenue 2X faster and developing 8X more jobs than follower and laggard SMEs. It means that Mobile e-commerce is exploding. Our generation is now comfortable not only with the mobile but paying online as well. Today’s faster technology and smoother interfaces have eliminated the e-commerce friction. There are many eye-opening proofs that show consumers now spend more time with online retail on mobile devices than desktop and laptop PCs. So developing an native eCommerce mobile app is an smart choice.

No matter how new technologies change our lifestyle, people are and will go to shop. Developing and designing mobile apps for e-commerce businesses has its own tricks. Below are all the building blocks needed to plan and develop your mobile e-commerce technology. Starting with the concepts, market insights, payment technology, analytics, and more.

UI Component

Mobile applications on smartphones and tablets and on mobile devices, in general, have increased the dependence of the user on icons and graphic elements for effective communication via the interface. Well-designed icons and graphics allow the user to recognise without the need of additional instructions the functions available on the mobile device in question. So the first thing that you need in your e-commerce app is the UI. If you have your designer good enough or you can take help from any design expert. Below are some of the popular links for different UI design library.

cocoaCocoa Control
It is one of the most famous open-source of UI component for iOS. It provides uncountable UI component to make any app attractive and user friendly.

android-arsnelAndroid Arsenal
It provides a collection of libraries, tools and projects for Android developers. It is an android developer portal with tools, libraries, and apps and provides an uncountable UI designs component for android.

Webservice for the accessing data in your native eCommerce mobile app

As you are developing a native eCommerce mobile app, it means you are going to access data from any web server. So, after designing the UI the second important step is to have Webservices or the application services that allow the creation of applications which access the features or data of an operating system, application, or other service. This helps to fetch data from server and fill it in your application. This can of any framework depending on your choice. The popular frameworks for eccommerce are:

magentoMagento
Magento is an open-source e-commerce platform written in PHP. Magento is the most flexible full-featured e-commerce software available to all types of businesses. Magento is fully scalable to grow and change as your business does. Whether you need basic e-commerce features for your online store or advanced options to accommodate growth, Magento has a solution for your business.

WooCommerce
Woo-commerce is based on open source platform. Woo-commerce is a strong, extendable plugin that helps you sell anything efficiently. Woo-commerce integrates seamlessly with WordPress. It provides a good secure apis for any e-commerce store.

PrestaShop
Prestashop is based on open source platform. Prestashop is a strong, extendable plugin that helps you sell anything efficiently. It is very popular plateform for secure e-store.

Integration of Payment gateway in your native eCommerce mobile app

A payment gateway is an interface or outlet to your payment system. A digital gateway can be the screens and buttons of an online shopping cart that accepts input payment information. An analog gateway is a physical credit card reader. A payment gateway is important because it provides a secure path from the customer to your payment system. It does this by encrypting the data and handling the connection to the payment processor. Without a gateway, your credit card numbers and banking information would be at risk. Or you would need to build your own security systems. Following are the some popular payment sdks available, which help you to integrate the payment system in your app easily.

PayPal
PayPal is the faster, safer way to send money, make an online payment, receive money or set up a merchant account. Online money transfers serve as electronic alternatives to traditional paper methods like checks and money orders. PayPal is one of the world’s largest Internet payment companies.

Google Wallet
It is the fast, easy, and free way to send money to friends and family. Google Wallet is a peer-to-peer payments service developed by Google that allows people to send and receive money from a mobile device or desktop computer at no cost to either sender or receiver.

Apple Pay
Apple Pay is a mobile payment and digital wallet service by AppleInc. that lets users make payments using the iPhone 6, 6 Plus, iPhone SE, and later, Apple Watch-compatible devices (iPhone 5 and later models), iPad Air 2, iPad Pro and iPad Mini 3 and later.

Analytics for Mobile App eCommerce

The web has obsessed over sales funnels and it’s just as important to track and optimize on mobile. Your app will have some sort of checkout flow, and it’s important to understand how users are navigating your app. Those already using Google Analytics on the web will likely want to choose Google Mobile Analytics. Then you can see a full profile of your business from one dashboard. Flurry and MixPanel are two other very good and well-adopted solutions.

Google Mobile Analytics
Use Google Analytics for Mobile Apps to measure and optimize user acquisition and engagement with mobile apps. It measures the impact your app has on your business. App measurement in Google Analytics helps you measure your app’s full value and the impact it has on your business.

Flurry Analytics
It allows to track the apps’ performance anytime, anyplace, anywhere.It allows you to view data for multiple apps at one time to gain a holistic view of performance for any company.

Parse Analytics
It provides insight into user interactions around push notifications. It gives a look at all API Requests passing through Parse. It tracks arbitrary events with an arbitrary set of dimensions.

Conlusion

Above described points are the essential elements for developing or building a good native eCommerce mobile app. There are many mobile apps for eCommerce are available in the market, you can take help from them and build an idea for your own app’s functionality and features . If you need more assistance and idea about setting up your mobile app, feel free to contact us.

cloviaClovia
One of the leading and fastest growing lingerie & nightwear shopping brands in India, Clovia is committed to being a woman’s one stop destination for all her lingerie needs. Being an exclusive lingerie and nightwear store, Clovia offers a wide variety of bras, briefs/panties and nightwear which are not only high on style quotient but are also comfortable.

myntraMyntra Online Shopping App
Swipe, select and shop! It’s fashion on the go with the all-new Myntra mobile app. Take the world of online shopping with you everywhere you go and get all your favorite fashion merchandise by top brands.Browse through 2,30,000+ product styles from 1600+ brands instantly on the Myntra shopping app

magento-logo
MagentoShop- A Shopping App
Looking for a native Magento mobile app builder (iOS/Android) for your Magento based online marketplace? Try the 30-day free trial of our Magento mobile app, go mobile commerce in a few hours and increase your sales exponentially. No Setup Fee, Pay as you go pack at just $69/month.

wooshopee_logoWooShopee – Woocommerce App
Looking for a native Woocomerce mobile app builder (iOS/Android) for your Woocommerce based online marketplace? Try the 30-day free trial of our Magento mobile app, go mobile commerce in a few hours and increase your sales exponentially. No Setup Fee, Pay as you go pack at just $69/month.

A quick guide to develop a PrestaShop mobile app.

We provide solutions to the client by building apps according to their requirements. We developed many apps on many different frameworks like SocialEngine, Magento, Woocommerce etc. Recently we got a new project from one of our clients. Their requirement was to develop an e-commerce app for their e-store which was on PrestaShop platform. Prestashop is a free open-source e-commerce solution. So the point was we have to build PrestaShop mobile app for their store using web-services.

As PrestaShop REST API was new for us and we knew that we would get problems during our implementation, but it would start at the first step was not expected 🙁 . We started the implementation and the first problem that we faced was how to build Prestashop mobile app. We can also say it as how to access Prestashop Webservice. Every time we hit the API , it gave “401 Unauthorized” and message “The server says welcome to Prestashop Webservice, please enter the authentication key as login. No password required”.
We did a lot of research, googled it, also found some solutions like – use the API key (The API key serves as the main identifier for the web service account you are creating) at the start of the URL

       http://[email protected]/

but every approach was fruitless. We tried every possible method to send the API Key with URL so that it can authorise the web service but nothing happened. The main confusing point was when we were hitting the URL directly on the browser by putting API Key at the start of URL it was working. Then after working several hours we found the solution. Before describing the solution I would like to list some essential points need to work on while accessing Prestashop Webservice :

Points to revisit before you start to build PrestaShop mobile app.

  1. Authentication key : This the most important key. Using this API key, the selected users will be able to access the web service. This key is provided by the server side. It is needed to send with the API.
  2. Permission for Resources : This is very important, as it enables the resources you want to make available to your user. These permissions are enabled from the server side.

To build Prestashop mobile app first you have to access its Webservice, so, you need to provide your authentication key or API key when request. No password is required only API key is enough for accessing the API. Now here, the problem is how to pass this API key with your request because if you will not provide this key it will not allow you to access Prestashop Webservice. The solution is while accessing the API from the mobile you need to pass this key in the header as BASIC AUTH.

When we add API Key with URL, Browsers are intelligent enough to understand it as username but the mobile web-services are not. So we need to pass it by building BASIC AUTH. We pass API Key as username and leave password blank as shown in below example:

     Request request = chain.request();
     String credential = Credentials.basic(Constants.API_KEY, "");
     request = request.newBuilder().header("Authorization", credential).build();

Conclusion

The above-explained solution can help many developers to start PrestaShop mobile app with its web-services. Giant eCommerce companies are now focusing on improving end-user experience on mobile devices. They are providing a strong technology infrastructure via cutting-edge mobile applications. Prestashop is one of the popular eCommerce open-source platforms and it has taken an important place in the eCommerce market for developing e-store. Using Prestashop API for e-store can be proved to be an intelligent option.You can also browse other apps already developed with Prestashop Webservices for example- PrestaShopee ,Prestashop mobile. If you need any help and assistance regarding app, website etc. development feel free to contact us.

References

Prestashop is a free open-source which provides the solution for e-commerce. For more information, you can visit the following link PrestaShop.

PrestaShop provides documentation for the list of all basic APIs that  are needed for the e-store.To get more details about the documentation you can visit this link PrestaShop Webservice

 

6 Reasons eCommerce Store Needs Mobile App

Mobile is becoming an important growth driver in e-commerce. The mobile e-commerce market size is currently estimated at 40 billion USD. Mobile visits account for one-third of e-commerce sites traffic. eCommerce store needs mobile app To have an e-commerce mobile app for electronic commerce store is like putting a  retail outlet in the customer’s pocket .

Most e-commerce store owners simply rely on a responsive web design for mobile visitors. Although this is a good commerce strategy, it isn’t a complete solution because responsive web design has some limitations such as :

  • All content is downloaded whether it is used or not.
  • Pages load slower; full-size images are downloaded, then resized to fit the device.
  • The initial cost of having a responsive website designed is usually higher than having a non-responsive site designed.

A complete and effective strategy has e-commerce mobile app as an integral part of it.The eCommerce store needs  mobile app because this is not just a “good to have” for e-commerce stores, they have become a must.

In this article, we have highlighted 6 reasons why we think mobile apps should be an important cornerstone of your mobile commerce strategy. Below are the reasons why your business needs mobile apps:

1. Customers Prefer Mobile Apps to Shopping Through Mobile Browsers

In a poll, 78% of customers said they prefer to access their desired shopping sites using an e-commerce mobile app than through mobile browsers. Mobile e-commerce makes shopping experience faster and more secure. Users do not have to worry about memorizing a URL or having to log in every time they want to place their usual order or even see what’s new.

2. Easier, Faster, And Secure Payments

A mobile app has secure payment options, which can be programmed to remember payment options for subsequent shopping. This reduces the buying process and time spent for the user. Buyers get discouraged when a buying process gets too complex leading to high cart abandonment rate. You definitely don’t want that.

3. Mobile Apps Support Social Sharing

Want your customers to do advertising for you by sharing your wares on Instagram,  Facebook, Twitter, and other social media sites? Mobile app developers have the ability to build social sharing right into the app. So your eCommerce store needs mobile app to share your store products socially which is very important for the store marketing. 

4. Mobile Apps Allow Push Notifications

The mobile app enables a personalized experience and interfaces perfectly designed for each device such as the Android or iPhone. Push notifications can be location based so that you can send your customers special offers when they get near one of your physical stores. Notifications can also be dispensed when you need to offer a promotion, run special sales, or even to get the word out about a new product. You cannot utilize push notifications to increase sales if you do not use mobile e-commerce.

5. More Control Over User Experience

Mobile apps give room for your developers to create a unique and powerful user experience tailored to the user’s device. You have control over the interface and present faster service. Apps let you go beyond the limitations of a responsive web design and work with the user’s preferred OS (iPhone, Android, etc.).

6. The eCommerce Store Needs Mobile App To Build Brand Loyalty

Nothing puts your products and brand at the forefront like a mobile app that the user sees every time they use their phone. Mobile apps are with the customers everywhere at all time; they have become like the virtual eyes and arms of the shopper making mobile apps a powerful tool for building and nurturing loyal customers.

Conclusion

These are just 6 of the benefits of developing  an e-commerce mobile app, but not everything. Some of the other benefits include caching heavy interface elements at your device once, geopositioning integration, offline mode, marketing advantages etc.

Want to see what mobile app development can do for your e-commerce business or startup? There are various native e-commerce mobile apps available in the market for example MagentoShop, SimiCartWooshopee etc. 

Top 5 Reasons why your online community needs mobile app

Do you have an online community? Would you like to improve user engagement on it ? One of the solutions is your online community needs a mobile app, because it will not only bring a large amount of user but also give an opportunity to access your community anytime and anywhere. More and more small and midsize businesses are following the mobile trend, understanding that an effective mobile strategy involves more than just a mobile-friendly website.

In fact, these days you’ll notice that many small businesses you interact with in your everyday life have their own dedicated mobile app — be it the corner coffee shop or the beauty spa downtown. These companies are ahead of the game when it comes to taking their marketing to the next level.

In this article, we have highlighted 5 reasons why we think mobile apps should be an important cornerstone of your online community. Below are the reasons why your online community needs mobile app:

1. Online community needs mobile app to improve User Engagement

No matter whether you are selling flowers or have a community for your family and friends, everyone needs a way to reach you. Having a messaging (or help desk) feature within your app can really make a difference in the way you communicate with your people. You can post messages to notify the members about a certain event; you can host debates and discussions among the members and keep the community active.

2. Be Visible to community member at All Times

We are attached to our mobile devices at the palms, and fingertips. We are never without our phones and we love using them everywhere from waiting for the bus or when we are on any trip. We can not carry our laptop everywhere and anytime, bu tit is easy to carry our mobile. It gives you a special opportunity to be with your community member at all time. We love the ability to share whenever we have a free second, and mobile devices allow us to be attached from anywhere at anytime.

3. Provide Value to Your Member

It allows more flexibility and can address specific member’s needs. You can text individually, sharing your personal thought that you do not want to share with other members of the community. You can create events or groups and can invite individually to any member. It makes you present yourselves to any member at any time and make them feel special and important

4. Build Brand and Recognition

The professionalism you show will increase trust and recognition by your targeted audience through your app. By having a mobile app, businesses get placed in the consumer’s pocket and are with them all the time. For your business what you really want to do is create an app that has features your customers will love while at the same time is well branded and beautifully designed.  The more often you can get customers involved with your app, the sooner they will be inclined to buy your product and/or service.

5. Cultivate Customer Loyalty

The most important reason why your online community needs a mobile app ,especially for your business , is customer loyalty. Other mediums like roadside banners, billboards, flashing signs, newspaper ads, flyers, coupons, websites, website banners, Facebook ads, and email marketing slowly lose impact on customers because of the immense amount of advertising surrounding us all. To make a true and sincere connection with your customers, and making them a loyal lover of your product and/or service it can be a way of staying closer to your customers, and being just a “fingertip” away at all times.

Conclusion

A mobile app can thus make things simpler for your members of any kind of community. A feature-rich mobile app with incredible performance can help you to attract your members. Therefore, it’s time you think about having a mobile app for your community and take action in that direction asap. There are a lot of mobile apps available in the market that can fit  your app like  SocialAPI-connect,communicate,collaborate , YouNet , SocialEngine Mobile App based on the different framework like Socialengine , BuddyPress , Oxwall, phpFox etc.

Portfolio Items