wordpress - 在woocommerce表单内的下拉列表中显示所有产品
问题描述
我是 wordpress 和 woocommerce 的新手,如何在表单内的下拉列表中列出网上商店中的所有产品?我正在为 Contact Form 7 插件使用联系表格 7 和智能网格布局设计,但无法弄清楚。
这是我用于动态下拉列表的代码。我刚刚为“帖子来源”选择了所有产品类别,但列表中没有产品:
[dynamic_select* dropdown-product-list id:dropdownProductList
"source:post:product" "taxonomy:product_cat:nekategorizirane"
"taxonomy:product_cat:dom" "taxonomy:product_cat:elektronika"
"taxonomy:product_cat:fitness" "taxonomy:product_cat:dodaci-prehrani"
"taxonomy:product_cat:fitness-pomagala-i-sprave"
"taxonomy:product_cat:kutak-za-klince" "taxonomy:product_cat:igracke"
"taxonomy:product_cat:ljubimci" "taxonomy:product_cat:lov-i-ribolov"
"taxonomy:product_cat:muskarci" "taxonomy:product_cat:libido"
"taxonomy:product_cat:ljepota-i-njega" "taxonomy:product_cat:zdravlje"
"taxonomy:product_cat:pokloni" "taxonomy:product_cat:poslovni-pokloni"
"taxonomy:product_cat:program-za-mrsavljenje"
"taxonomy:product_cat:zene" "taxonomy:product_cat:ljepota-i-njega-zene"
"taxonomy:product_cat:odjeca" "taxonomy:product_cat:zdravlje-zene"]
解决方案
如果您的网上商店中有一些产品,那么您可以为每个产品创建页面并根据您的选择命名它们。现在,创建一个下拉菜单并选择所有页面(其中包含产品)。
推荐阅读
- c# - 处理电脑显示器[扩展]
- html - 是否有替代已弃用的 HTML 标记来获得相同的输出,以便将页面划分为所需的列数?
- c# - IOException on Directory.Move 使用该目录的进程后
- forms - 表单验证如何排除输入字段?
- javascript - 类型错误:无效的 URL
- server - 服务器无法处理请求。---> 客户端发现响应内容类型为“text/html”,但预期为“text/xml”
- spring-boot - 找不到类型的字段所需的 bean。错误 springboot API 部署到 ubuntu
- ios - 无法在我的 iOS 应用程序中访问我的可可框架的 .json 文件
- c# - 如何在插入数据库时将类属性的值设置为另一个类的生成 id 值?
- asp.net-mvc - 将 Google Drive API 托管到 IIS 后上传失败。将错误显示为无法启动浏览器