dpd66100 2017-02-03 13:08
浏览 7
已采纳

确切的在线Picqer股票请求

I'm trying to build an import function for exact online to Magento. I want to read out all products (Items) in exact online and add the right Stock and Sale Price to a loop.

However I cant get it to work because of the different errors i get.

Can you guys push me in the right direction with this one?

<?php
// Authenticate with the server
include 'authenticate.php';

$id = '0df2e928-12f1-4830-93c1-004f983c6d83';
$filter_stock = "itemId eq guid'$id'";
echo $filter_stock;

try {
   $stockPosition = new \Picqer\Financials\Exact\StockPosition($connection);
   $stockPositions = $stockPosition->filter($filter_stock);
   var_dump($stockPositions);
} catch (\Exception $e) {
   echo get_class($e) . ' : ' . $e->getMessage();
}

This gives me itemId eq guid'0df2e928-12f1-4830-93c1-004f983c6d83'Picqer\Financials\Exact\ApiException : Error 400: Bad Request - Error in query syntax.

What is the error in my query syntax? I tried = instead of eq and ItemID ItemId itemid etc...

  • 写回答

1条回答 默认 最新

  • dpw50696 2017-02-03 15:29
    关注

    There was a known error with StockPisition.php.

    I managed to fix this by changing the default filter function to:

    $stockPositions = $stockPosition->filter([], '', '', ['itemId' => "guid'{$itemID}'"]);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭