Skip to content

sharadjaiswal1411/product-comparsion-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

original package

https://github.com/jsartisan/shopkart-laravel/
Upgarding package for laravel 5.4
Upgrading dependencies phpunit and guzzle http
Creating support for snapdeal

Please Don't use, Still in development

Shopkart-Laravel is a very simple package for laravel for making call to Flipkart and Amazon Search APIs.

Installing Shopkart-Laravel

Install through Composer.

composer require phpscots/product-comparison dev-master

Next, add the service provider to app/config/app.php. :

# app.php

'providers' => [
    // ..
    Phpscots\ProductSearch\ProductSearchServiceProvider::class,
    
]

Also add the facade. :

# app.php

'aliases' => [
    // ..
    'ProductSearch'  => Phpscots\ProductSearch\Facades\ProductSearch::class,
    
]

Now add your flipkart and amazon affilate id credentials in services.php

# services.php

	// ..
	'amazon' => [
		'client_id'     	=>  'your_amazon_client_id',
		'client_secret' 	=>  'your_amazon_client_secret/',
		'tag'           	=>  'your_amazon_id_tag',
		'country'       	=>  'your_country_code'
	],
	
	'flipkart' => [
		'client_id'     	=>  'your_flipkart_client_id',
		'client_secret' 	=>  'your_flipkart_client_secret',
		'country'       	=>  '',
		'tag'           	=>  ''
	],
	'snapdeal' => [
		'client_id'     	=>  'your_snapdeal_client_id',
		'client_secret' 	=>  'your_snapdeal_client_secret',
		'country'       	=>  '',
		'tag'           	=>  ''
	],

Usage

Amazon API

To search for product in amazon api , write :

	ProductSearch::with('amazon')->search('PS3','Electronics');

This will return list of products based on Keyword 'PS3'.The important thing is you have to pass the Search Index for Amazon Search API Request which is 'Electronics' in our case. Check more about it here - Search Indices.

First parameter of amazon search method is the keyword and second parameter is the Search Index.

Flipkart API

To search for products in flipkart api, write :

	ProductSearch::with('flipkart')->search('PS3',5);

This will return list of flipkart products from their api based on keyword specified.('PS3' in our case).

First parameter of flipkart search method is the keyword and second parameter is the result count i.e. number or product you want from api. ( max 10 ).

Please Don't use, Still in development

Online Interview Questions

About

A product comparison Package for laravel with amazon and flipkart

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages