且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento:以编程方式添加新产品

更新时间:2023-08-26 15:27:46

AMP ,OP,已经可以自答问题.

AMP, the OP, already self-answered the question.

报价:

很酷,我发现了问题所在,该行: $newproduct->setWebsiteIDs(array(0));应为: $newproduct->setWebsiteIDs(array(1));令人惊讶的最小的东西 会浪费几个小时!

Cool, I have found the problem, the line: $newproduct->setWebsiteIDs(array(0)); should be: $newproduct->setWebsiteIDs(array(1)); Amazing how the smallest thing can waste hours!

注意:绝对确定自行回答您自己的问题.请仅将其发布为真实答案,但在问题或评论中.作为真实答案发布有助于使未答复"列表更加清晰(避免使其他人浪费时间).

Note: It's absolutely OK to self-answer your own question. Please just post it as an real answer, but not in a question or comment. Posting as real answer helps to keep the "Unanswered" list more clear (avoids making other people wasting their time).