• Resolved gabryah69

    (@gabryah69)


    hello all im make this code to put in my edit products but i dont know why the taxonomy dont saved in my post y share you my code i put all hooks and nothing change :
    
    i put in products/variation product seccion becose i need to show in attributes seccion.....
    
    
    <label for="brand" class="form-label"><?php esc_html_e( 'Brand', 'dokan-lite' ); ?> <i class="fas fa-question-circle tips" aria-hidden="true" data-title="<?php esc_html_e( 'Select the brand for your watch', 'dokan-lite' ); ?>"></i></label>
    <?php
    require_once DOKAN_LIB_DIR.'/class.taxonomy-walker.php';
    $term = wp_get_post_terms( $post_id, 'brand', array( 'fields' => 'all') );
    $selected = ( $term ) ? $term : array();
    $drop_down_brand = wp_dropdown_categories( array(
    'pro' => true,
    'thepostid' => $post_id,
    'show_option_none' => __( 'Select brand', 'dokan' ),
    'hierarchical' => 1,
    'hide_empty' => 0,
    'name' => 'brand[]',
    'id' => 'brand',
    'taxonomy' => 'brand',
    'title_li' => '',
    'class' => 'product_tags dokan-form-control dokan-select2',
    'exclude' => '',
    'selected' => $selected,
    'echo' => 0,
    
    
    ) );
    
    echo str_replace( '<select', '<select data-placeholder="'.__( 'Select brand', 'dokan' ).'" single="single" ', $drop_down_brand );
    // validate acf fields before save
    add_action('dokan_process_product_meta',$drop_down_brand, $post, $post_id, 10 );
    
    // save custom field data in product meta.
    add_action( 'dokan_new_product_added', $drop_down_brand, $post, $post_id, 10, 2 );
    add_action( 'dokan_product_updated', $drop_down_brand, $post, $post_id, 10, 2 );
    
    add_action( 'dokan_product_edit_after_product_tags', $drop_down_brand, $post, $post_id );?> please can see or help me if i need another hook or something thanks for all
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Tanvir Hasan

    (@tanvirh)

    Hi @gabryah69

    Thank you for sharing the custom codes that you have created to add custom taxonomy on the edit product page. Please note that according to our?support policy, we are unable to provide further assistance regarding this custom work. We recommend hiring a professional WordPress developer who can help you with the necessary customization.

    I hope this explains the scenario.

    Thanks!

    Plugin Support Tanvir Hasan

    (@tanvirh)

    Hi @gabryah69

    As we haven’t heard back from you for a while, we’ll consider this topic resolved. If you encounter any further issues, please don’t hesitate to open a new topic.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘my custom fields not save in my edit product’ is closed to new replies.