質問 > その他 > Facebook連携プラグイン EC-CUBE4対応版のエラーについて |
その他
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
yt1969 |
投稿日時: 2020/11/30 22:02
対応状況: −−−
|
一人前 登録日: 2018/3/3 居住地: 投稿: 91 |
Re: Facebook連携プラグイン EC-CUBE4対応版のエラーについて Facebook Ads Extention
本日まさにこれで6時間くらいはまりました。 --- ・EC-CUBE3では問題なく動き、Facebook/Instagramで商品を扱えた ・EC-CUBE4でローカルのMAMP環境では問題なくproduct_feed.tsvを吐き出していた ・EC-CUBE4のさくらインターネットレンタルサーバ環境で商品登録エラーになった ・Facebookのカタログマネージャ->カタログ->データソースから URL(https://hogehoge/product_feed.tsv)を指定しての商品登録がエラーになる > 更新または追加された商品**0**件(28件中) > 却下された商品**28**件 (実際の商品点数は2000件以上) 登録エラーのレポートを見ると > **列の数が正しくありません(引用符が使用されています):** > この行の列の数が行1の列の数と一致しません。テキストに二重引用符を使用している場合、その後にもう一つ二重引用符を使用する必要があります。また、そのテキスト全体を二重引用符で囲む必要があります。(例: “24””TV”, “32””TV”) > **列の数が正しくありません:** > この行の列の数は行1の列の数と同じにしてください。 ・試しに、ローカルで吐き出させたproduct_feed.tsvを利用して ファイルアップロードで商品登録を行うと問題なく登録できる ・EC-CUBE4のエラーログvar/log/prod/site-2020-11-30.log > … システムエラーが発生しました。 ["Failed to start the session because headers have already been sent by \”…/src/Eccube/Service/CsvExportService.php\" at line 376." ・`curl https://hogehoge/product_feed.tsv`をみてみると ヘッダ部1行と残りエラーhtmlという内容 > id item_group_id title description google_product_category link image_link additional_image_link condition availability price brand > <!doctype html> > <html lang=“ja”>…</html> --- 結論としては app/Plugin/FacebookAdsExtention/Controller/ProductFeedController.phpで ``` fopen(); fputcsv($headers); fclose(); fopen(); foreach{fputcsv($row);} fclose(); ``` となっていたfopen()/fclose()を1回にまとめる ``` --- app/Plugin/FacebookAdsExtention/Controller/ProductFeedController.php +++ app/Customize/Controller/ProductFeedController.php @@ -8,7 +8,7 @@ * of patent rights can be found in the PATENTS file in the code directory. */ -namespace Plugin\FacebookAdsExtention\Controller; +namespace Customize\Controller; use Eccube\Application; @@ -39,7 +39,7 @@ class ProductFeedController extends Abst $this->csvExportService = $csvExportService; } /** - * @Route("/product_feed.tsv", name="plugin_FacebookAdsToolbox_feed") + * @Route("/product_feed.tsv", name="custom_plugin_FacebookAdsToolbox_feed") */ public function export(Application $app, Request $request, Packages $packages) { set_time_limit(0); @@ -74,9 +74,6 @@ class ProductFeedController extends Abst 'price', 'brand', ); - $this->csvExportService->fopen(); - $this->csvExportService->fputcsv($headers); - $this->csvExportService->fclose(); $qb = $this->csvExportService->getProductQueryBuilder($request); @@ -94,6 +91,7 @@ class ProductFeedController extends Abst $site_root = $request->getSchemeAndHttpHost(); $this->csvExportService->fopen(); + $this->csvExportService->fputcsv($headers); foreach ($query->getResult() as $Product) { // change availability based on status. ``` --- なぜそうなるのかとかまでは突っ込んでませんが、、 この修正以降は商品連携うまく動いているようです。ご参考までに。 |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
Facebook連携プラグイン EC-CUBE4対応版のエラーについて | yoshi0001 | 2020/6/29 17:32 |
Re: Facebook連携プラグイン EC-CUBE4対応版のエラーについて | nanasess | 2020/6/30 18:36 |
» Re: Facebook連携プラグイン EC-CUBE4対応版のエラーについて | yt1969 | 2020/11/30 22:02 |