Prestashopper is a ruby gem to interact with a Prestashop API. It has been tested with Prestashop v1.6.1.2
Prestashop is an open source e-commerce application written in PHP: visit the homepage.
Add this line to your application's Gemfile:
gem 'prestashopper'
And then execute:
$ bundle
Or install it yourself as:
$ gem install prestashopper
For security reasons the Prestashop API is disabled by default. To be able to use this gem you will have to enable it.
Once enabled you'll have to create an API key and give it the necessary permissions for the operations you intend to perform. Most methods in this gem need a valid API key.
For more information about enabling the Prestashop API and managing API keys and their permissions, see the official documentation.
Prestashopper.api_enabled? 'my.prestashop.com'
=> true
Prestashopper.valid_key? 'my.prestashop.com', 'VALID_KEY'
=> true
api = Prestashopper::API.new 'my.prestashop.com', 'VALID_KEY'
api.resources
=> [:customers, :orders, :products]
products = api.get_products
products[0].description
=> "product 1"
products[0].price
=> "24.71"
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment. The documentation can be generated from the yard comments running yard doc
.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/amatriain/prestashopper.
The gem is available as open source under the terms of the MIT License.