Utilisation CURL et php, fonctionne plus depuis MAJ de API

it’s good I treated my data differently depending on whether it was a search design or if it was my design.

Thank you for your help :slight_smile: (again)

hey while i’m wondering i would like to create products or articles on my site.

I thought I could use the tablomat / sketomat for the creation, I did it it works well but my problem is that it creates products and on the products there is no price. So the tablomat / sketomat during the creation gives me a price, but if a day this price is change I would not be because on the API the products are not expensive.

Do you know if it is possible to know the price of a product from the API?

or

Do you know if we can create articles from the tablomat / sketomat, because I cross that the articles have a price on the API?


it has nothing to do but you know what is the number in the hooks ** [5] **?

‘tag’ =>
object(SimpleXMLElement)[5]
public 0 => string ‘annonce,bientot,bientôt,bébé,cadeau,depuis,enceinte,famille,frère,frères et sœurs,futur,future,grossese,grossesse,idee,idée,naissance,petit frère’ (length=153)

If you create a product, then you should be able to retrieve all necessary data from the api like (incl. price):
https://api.spreadshirt.net/api/v1/shops/SHOP-ID/articles/ARTICLE-ID?locale=fr_FR&fullData=true
or from your User
https://api.spreadshirt.net/api/v1/users/8568956/articles/ARTICLE-ID?locale=fr_FR&fullData=true
But I’m not 100% sure if the articles which were created using tablomat/sketchomat are in shops.
Otherwise you could create the product with api without tablomat/sketchomat, but this depends on your use case.

see above

If you need some inspiration, have a look at WP-Spreadplugin – WordPress plugin | WordPress.org where I retrieve articles.


Here you could play with api, if you don’t know it already :slight_smile:
https://www.spreadshirt.net/api/api-browser/index.html

product vs article

https://www.spreadshirt.net/developer-blog/2009/11/21/spreadshirt-api-terminology-explained-1-the-difference-between-article-product-and-product-type/

the tablomat creates products in my shop automatically and return the link of the product created, I almost managed to recover all the prices (yes because it is necessary to fetch the price of the design, the price of the printing and the price of the tshirt ) and additions, so it’s complicated.

https://developer.spreadshirt.net/display/API/Product+Price+Calculation+Guide#ProductPriceCalculationGuide-Calculation

I thought maybe you knew a way to know the whole price directly because it is very difficult.


I did not know

Here you could play with api, if you do not know it already: slight_smile:
https://www.spreadshirt.net/api/api-browser/index.html

it’s great it will make my job a lot easier.

If you’re using the addtobasket callback function, you might try this:

article: XXXX, // chosen product id
size: X, // chosen size
appearance: 231, // chosen appearance
quantity: 1, // chosen quantity
action: myAjax, // callback
type: 1, // 1: article (sets if its an article or product)

That’s why I don’t have to calculate the price :wink:

@see for code here: https://shirtrecycler.de/ or my wp-spreadplugin installations worldwide

type: 1, // 1: article (sets if its an article or product)

Great I did not know! I will test it should be easier!

https://spreadshirt.github.io/apps/sketchomat

it is curious that the parameter “type” is not indicated in the documentation

it would have taken me two days but I am very happy I managed to calculate the price of a PRODUCT.

I will be able to use the tablomat from my site, to create products directly.

spreadshirt get price product - Pastebin.com

getProductPriceApi (‘https://api.spreadshirt.net/api/v1/shops/ID-SHOP/products/ID-PRODUCT’)

it’s thanks to you all that :):star_struck:

I did not handle the error though :stuck_out_tongue:

in fact the tablomat gives the price but if tomorrow / in 1 month / 6 months the price is changed my site to put it in the BDD automatically.

1 Like

CouCou @lovetee :grinning:

I try to create images automatically but I can not find anything on the API at the level of “modelId”

//image.spreadshirtmedia.net/image-server/v1/mp/products/P119470104MPC137792564/views/1,width=378,height=378 ,appearanceId=29,backgroundColor=E8E8E8,modelId=85,crop=list,version = 1520524785

I managed to identify 6 model 103, 260, 85, 290, 218, 212, but the problem is that I do not know in some colors it is available every time, I wonder if you do not know the link api of “modelId”?

thank you for your help :slight_smile:

you don’t need to have model id, its just for displaying “Models” with your designs on it. This is done automatically.

when I create a product in I do not have the characters, I only have that

https://image.spreadshirtmedia.net/image-server/v1/products/503201492/views/1

you don’t need else

lol no I do not need another, but for the style I would like a view of “actor”.

But yes I could be content with that.

@lovetee hello :slight_smile:

sorry I still need you, probably a detail but I can not find how the attribute ‘xlin: hrek’.

to get the ‘id’ attribute I make $myProduct->attributes()->id
but that does not work for the xlink: href.

I try ->getNamespaces(true)[‘xlink’] but it only returns “XLink namespace

Can you help me?

Sure!

This should work: ->attributes('http://www.w3.org/1999/xlink')

1 Like

thanks I will try !

1 Like