定制 jsartisan/shopkart-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jsartisan/shopkart-laravel

最新稳定版本:0.1.0

Composer 安装命令:

composer require jsartisan/shopkart-laravel

包简介

Simple Product Search Package for Flipkart

关键字:

README 文档

README

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

Installing Shopkart-Laravel

Pull this package in through Composer.

#composer.json

{
    "require": {
        "jsartisan/shopkart-laravel": "0.1.*"
    }
}

then run the composer update.

composer update

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

# app.php

'providers' => [
    // ..
    JSArtisan\Shopkart\ShopkartServiceProvider::class,
    
]

Also add the facade. :

# app.php

'aliases' => [
    // ..
    'Shopkart'  => JSArtisan\Shopkart\Facades\Shopkart::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'           	=>  ''
	],

Usage

Amazon API

To search for product in amazon api , write :

	Shopkart::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 :

	Shopkart::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 ).

统计信息

  • 总下载量: 68
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-27