werein / prestashop Goto Github PK
View Code? Open in Web Editor NEWPrestashop API for Ruby including low-level API access and Prestashop fields converted into PORO
Home Page: https://wereinhq.com/guides/prestashop
License: Other
Prestashop API for Ruby including low-level API access and Prestashop fields converted into PORO
Home Page: https://wereinhq.com/guides/prestashop
License: Other
Hi,
I know that you was already surprised that someone is still using that repository but yeah, and I have new problem.
I want to create an order so I'm using Prestashop::Api::Converter.build to create proper payload but I have a problem when I want to build couple the same XML elements like under cart_items:
<cart_rows>
<cart_row/>
<cart_row/>
<cart_row/>
<cart_row/>
</cart_rows>
So I tried to pass array as items, but it doesn't work :(
cart_rows = []
order.order_products.each do |product|
cart_rows.push({
id_product: product.product_id,
quantity: product.qty
})
end
{
id_shop: 1,
id_customer: customer[:customer][:id],
id_currency: currency_id,
id_lang: language_id,
id_address_delivery: address[:address][:id],
id_address_invoice: address[:address][:id],
id_carrier: carrier_id,
secure_key: customer[:customer][:secure_key],
associations: {
cart_rows: cart_rows
}
}
And of course I cant create hash with the same symbols, do you have any solution for that?
Should this be possible?
shop_client.connection.read :orders, nil, {:filter => { :current_state => 4 }, :display => '[associations]'}
It just returns an error with PS 1.6
One option is to display full but there's a lot of stuff there which I don't need.
Does the API support a full import/export of products including variants and maybe even images yet?
Looks like that's the "product options" case, right?
For creating manufacturer with name "D & G" i use this code (with PS 1.6):
manufacturer = Prestashop::Mapper::Manufacturer.new(id_lang: 'id_lang', name: "D & G")
manufacturer.find_or_create
In result, manufacturer with name "D & G"
created.
How can I create manufacturer with name: "D & G"?
Just started testing with Prestashop 1.6.1.4
Running Prestashop::Client::Implementation.create 'api_key', 'api_url'
gives the error can't modify frozen String
...
Ruby: 2.3.0
Rails: 4.2.6
Hi,
Just a quick notice: you have a typo in your gemspec, so the URL on rubygems.org pointing to the guides is wrong.
cheers!
Marian
def update(id, update_xml)
connection.put(table_sym, id, update_xml)
end
I double checked that id is integer and update_xml is xml string.
TypeError: no implicit conversion of Symbol into Integer
from ../.rvm/gems/ruby-2.6.3/bundler/gems/prestashop-c931a38a92ac/lib/prestashop/api/converter.rb:38:in `parse_error'
...
AFAIK now open-uri
uses simple paths /some/path/image.jpg
for local files.
And that's why this check prohibits the upload of local images https://github.com/werein/prestashop/blob/master/lib/prestashop/mapper/models/image.rb#L32
Based on http://doc.prestashop.com/display/PS16/Chapter+10+-+Price+management
Allow 'price' parameter
Prestashop::Client.read :products, nil, { display: '[id,name,my_price]', limit: 2, 'price[my_price][use_tax]' => 1 }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.