duanjiong2021 2015-04-26 06:58
浏览 21

WP Woocommerce - 创建一个包含用户uploadform属性的选择下拉列表。

I have a site where users can uploa dproducts themself to woocommerce. Im using Meta keys in the uploader to set size, gender and other choices for the products. However, most filer plugins uses attributes and taxomonys to filter product, and Im looking for a way to add Woo Attributes trough the uploader via dropdowns and checkboxes. Would this be possible?

Two example im using - dropdown for categories and one textfield input field with a metakey.

Categories:

case 'post_categories':
                $options = userpro_publish_categories($args);
                $res .= "<select name='".$key.'-'.$i.'[]'."' multiple='multiple' class='chosen-select' data-custom-error='".__('Please choose a category at least','userpro')."' data-required='".$args['require_category']."' data-placeholder='".$placeholder."'>";
                foreach($options as $k=>$v) {
                    if (strstr($k, 'optgroup_b')) {
                        $res .= "<optgroup label='$v'>";
                    } elseif (strstr($k, 'optgroup_e')) {
                        $res .= "</optgroup>";
                    } else {
                        $res .= "<option value='$k'>$v</option>";
                    }
                }
                $res .= "</select>";
                break;

Text with meta key:

case '_bank_details':
                $res .= "<input data-required='".$args['require_'.$key]."' type='text' name='$key-$i' id='$key-$i' value='".$user_bank."' placeholder='".$placeholder."' />";
                break;

How do I create somethings similar, but for Woo attributes?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 MATLAB中streamslice问题
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序