Jump to content
  • 0
BRANDSTORE.TIROL

[gelöst] Webservice Products

Question

HI,

 

weiß zufällig jemand von euch, wie ich über das POST für Products die verfügbare Menge mitgeben kann?

<quantity> wird ja nicht zugelassen

 

<?xml version="1.0" encoding="UTF-8" ?>
<prestashop>
    <product>
        <id_manufacturer>1</id_manufacturer>
        <id_category_default>19</id_category_default>
        <reference>Art.Nr.: 145 4191 | Farbe: 1907/10</reference>
        <state>1</state>
        <price>183.250000</price>
        <active>0</active>
        <link_rewrite>
            <language id="1">TESTAPI</language>
        </link_rewrite>
        <name>
            <language id="1">TESTAPI</language>
           </name>
        <associations>
          <categories nodeType="category" api="categories">
              <category>
                  <id>2</id>
              </category>
          </categories>
        </associations>
    </product>
</prestashop>

 

 

danke

tom

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

es sollte ja über die stock_availables gehen

 

<prestashop>
    <stock_available>
    <id_product>38</id_product>
    <id_product_attribute>0</id_product_attribute>
    <id_shop>1</id_shop>
    <id_shop_group>0</id_shop_group>
    <quantity>222</quantity>
    </stock_available>
</prestashop>

 

da kommt die Meldung: Method POST is not allowed for the resource stock_availables

die API sagt

<stock_availables xlink:href="https://myshop/api/stock_availables" get="true" put="true" post="true" delete="true" head="true"></stock_availables>

 

ist das ein Bug?

 

Share this post


Link to post
Share on other sites
  • 0
vor 22 Stunden schrieb BRANDSTORE.TIROL:

Problem gelöst

Woran lags?

Grüsse
Whiley

Share this post


Link to post
Share on other sites
  • 0

Hi Whiley... das geht über die Combination

Produkt anlegen

prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <product>
        <id_manufacturer>1</id_manufacturer>
        <id_category_default>19</id_category_default>
        <id_tax_rules_group>1</id_tax_rules_group>
        <reference>Art.Nr.: 145 4191 | Farbe: 1907/10</reference>
        <state>1</state>
        <price>183.250000</price>
        <active>0</active>
        <link_rewrite>
            <language id="1">TESTAPI</language>
        </link_rewrite>
        <name>
            <language id="1">TESTAPI</language>
           </name>
        <associations>
          <categories nodeType="category" api="categories">
              <category>
                  <id>19</id>
              </category>
          </categories>
        </associations>
    </product>
</prestashop>

-> liefert die ProduktId zurück -> 47

------------
Varianten anlegen
mit der ProduktId von oben
product_option_value = Werte einer Eigenschaft, z.B. XL=31

COMBINATIONS anlegen
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <combination>
      <id_product>47</id_product>
      <minimal_quantity>1</minimal_quantity>
        <associations>
            <product_option_values nodeType="product_option_value" api="product_option_values">
                <product_option_value>
                    <id>31</id>
                </product_option_value>
            </product_option_values>
       </associations>
    </combination>
</prestashop>

-> liefert die COMBINATIONS zurück -> 105

POST: https://xxxxxx.at/api/combination
-> liefert COMBINATIONS ID -> damit die passende "https://xxxxx.at/api/stock_availables/" suchen (Feld: id_product_attribute)

------------

PUT
-> mit der Produkt ID die ID des stock_available suchen: (https://xxxxx.at/api/stock_availables) -> 168
diese Felder <id_product>47</id_product> und <id_product_attribute>105</id_product_attribute> kommen aus der Abfrage
 
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
    <stock_available>
      <id>173</id>
      <id_product>47</id_product>
      <id_product_attribute>105</id_product_attribute>
      <id_shop>1</id_shop>
      <id_shop_group>0</id_shop_group>
      <quantity>9</quantity>
      <depends_on_stock>0</depends_on_stock>
      <out_of_stock>0</out_of_stock>
    </stock_available>
</prestashop>

------------

Funktioniert einwandfrei

 

lg

tom

Share this post


Link to post
Share on other sites
  • 0

Hallo Tom,

ah, alles klar. danke für die Info.

Ich stelle den thread  auf gelöst.

Grüsse
Whiley

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More