1

I am importing a product list CSV from a wholesalers website and one of the categories for items is "Baseball Caps" - I have renamed this category to "Hats" but now every time i re-import the product list I have to go rename the category "Hats" back to "Baseball Caps" - run the import - then rename it back, otherwise it will create the new category and all the products to that one instead of the one I would like

Is there a function I could write in wpallimports function editor so that when category == "Baseball Caps" it saves it as "Hats" with slug "Hats" as well ?

thank you

4

4 回答 4

1

映射时,在“分类、类别、标签”部分下,启用“产品类别”,您将看到一个选项“为产品类别启用映射”

在“分类、类别、标签”部分下的 WP All Import 中,启用“产品类别”。

启用“为产品类别启用映射”选项。

在“In Your File”字段中输入“Baseball Caps”,在相应的“Translated To”字段中输入“Hats”。

单击“添加其他规则”以添加更多类别映射。

于 2018-02-16T23:54:38.100 回答
0

这是否可以仅替换该字符串并保留所有其他字符串?因为有多个类别用逗号分隔。抱歉 - 自从很久以前在 MUD 上编写丁丁脚本后就没有编写过脚本

[str_replace("Baseball Caps", "Hats", {categories[1]})]
于 2017-12-05T18:19:19.833 回答
0

WPAllImport 有一个可视化界面或使用一个函数:wpai_util_map。请参阅下面页面的映射章节

导入类别、分类法或自定义字段时,您可以使用可视界面指定映射选项。在其他任何地方,您都可以使用 wpai_util_map PHP 函数。

http://www.wpallimport.com/tour/advanced-features/

于 2020-02-05T08:34:11.257 回答
-1
[str_replace("Baseball Caps", "Hats", {name[1]})]  

是否可以使用此代码更改更多字符串?

例子:

[str_replace(array("Baseball Caps", "Hats"),array("Second Caps", "Shoes"), {name[1]})]  

导入前需要更改更多字符串,但我的代码不适用于 WP ALLimport。

于 2019-07-17T10:27:27.620 回答