Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
155 stars 152 forks source link

Not an issue, but a request/suggestion #289

Closed Garfius closed 5 years ago

Garfius commented 6 years ago

I have seen your nice project, and compiled (some tiny modifications needed)

The idea is to use prestaSharp on powerShell scripts, and IT WORKS !!

Load the compiled binaries:

Add-Type -Path .\RestSharp.dll Add-Type -Path .\Bukimedia.PrestaSharp.dll

Set the url and key to variables

$key = "AKEYIDONTREMEMBERBLABLABLABLABLA"
$url = "http://www.myAwesomeWeb.com/api"

Test some commands

$b = New-Object Bukimedia.PrestaSharp.Factories.StockAvailableFactory($url,$key,"") $b.GetAll() $b.Get(12)

Create a typed object to upload, i copied the one from Get(12) with MODIFIED QUANTITY

_$c = New-Object Bukimedia.PrestaSharp.Entities.stock_available $c.id = 12 $c.id_product = 15501 $c.id_shop = 1 $c.quantity = 123 $c.id_product_attribute =0 $c.id_shopgroup =0

Post to prestashop

$b.Update($c) $b.GetAll()

And everything works perfect!!

SOOOOOO

Can anyone create a powershell tutorial 'cause scripting matters !!

Thanks, great job!

mowcixo commented 5 years ago

Hi @Garfius, it would be great if you could make a pull request over README.md documenting this.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.