2012-11-02 5 views
1
<?xml version="1.0" encoding="UTF-8"?> 
<product> 
    <id type="integer">100159400</id> 
<title>150 Watt Mini Stereo Power Amplifier</title> 
<variants type="array"> 
<variant> 
<id type="integer">233139732</id> 
<grams type="integer">700</grams> 
<inventory-quantity type="integer">222</inventory-quantity> 
</variant> 
</variants> 
</product> 

나를 위해 작동하지 않습니다. 난 내가 단일 값을 구문 분석하고있어 shopify API 호출 여기XML 배열을 Shopify API 호출에 전달하는 방법

$recurring_application_charge = $shopify('PUT', '/admin/products/109720638.xml', $product); 

의 XML 배열을 분석하고있어하지만 난 shopify 저장소에 레코드 삽입 후 데이터베이스에 저장된 동적 값을 전달해야합니다. 하나의 제품에 대해서도 업데이트 명령조차도 작동하지 않습니다. 도와주세요.

+0

라이브러리 또는 원시 HTTP 요청을 사용하고 있습니까? Content-Type 헤더가 설정되었는지 확인하십시오 (예 : text/xml). 또한 어떤 응답을 얻었는지 알려주십시오. –

답변

1

Sandeep의 PHP 어댑터를 사용하는 경우 콘텐츠 유형을 (Shopify.php)의 XML로 변경해야합니다. 기본적으로 어댑터는 Json 형식을 사용하여 POST 요청을 사용합니다.

관련 문제