Prestashopper is a ruby gem to interact with a Prestashop API. It has been tested with Prestashop v22.214.171.124
Prestashop is an open source e-commerce application written in PHP: visit the homepage.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install prestashopper
Enabling the Prestashop API and creating an API key
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.
Checking if the Prestashop API is enabled
Prestashopper.api_enabled? 'my.prestashop.com' => true
Checking if an API key is valid
Prestashopper.valid_key? 'my.prestashop.com', 'VALID_KEY' => true
Getting an API instance
api = Prestashopper::API.new 'my.prestashop.com', 'VALID_KEY'
Listing resources that can be accessed from an API instance
api.resources => [:customers, :orders, :products]
products = api.get_products products.description => "product 1" products.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
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.