Home Forums Theme Support Dokan Is Dokan compatible with WPML

This topic is: not resolved

This topic contains 3 replies, has 4 voices, and was last updated by  Federica Canton 4 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32023

    Timothy
    Member
    Post count: 3

    Hi,

    I am wondering if Dokan is compatible with WPML. I have purchased and downloaded Dokan but we were hoping to have multiple languages for our store.

    If so I am wondering since WPML has a duplicate custom post type which is similar to duplicating product can we on insert:
    add_action(‘wp_insert_post', ‘duplicate_master_post', 10, 3);

    create a function to use the following code?

    function duplicate_master_post($post_id, $post, $update){
        global $sitepress, $iclTranslationManagement;
         
         
        $only_cpt   = array();
        $only_cpt[] = 'products';
         
        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
            return;
        }
        // don't save for revisions
        if ( isset( $post->post_type ) && $post->post_type == 'revision' ) {
            return;
        }
        // only duplicate when publishing
        if ($post->post_status != 'publish') {
            return;
        }
        // avoid recursion
        remove_action('wp_insert_post', 'duplicate_master_post', 10);
     
        if ( !isset( $iclTranslationManagement ) ) {
            $iclTranslationManagement = new TranslationManagement;
        }
            
        $post_type = get_post_type( $post_id );
        if ( $sitepress->is_translated_post_type( $post_type ) && in_array( $post_type, $only_cpt ) ) {
            $iclTranslationManagement->make_duplicates_all( $post_id );
        }
    }
    add_action('wp_insert_post', 'duplicate_master_post', 10, 3);

    So the product will be duplicated on multiple languages?

    #32238

    Sekander Badsha
    Member
    Post count: 2067

    Hello Timothy,

    Dokan is not WPML compatible. And I am not that good with codes :p
    So I am forwarding your topic to the developer team and check if they can help you with it

    Thank you for having patience ๐Ÿ™‚

    #32673

    Tor B
    Member
    Post count: 100

    +1 on WPML compatibility; it would be a very, very good thing to have, as WooCommerce is WPML compatible. What is missing?

    #32876

    Federica Canton
    Member
    Post count: 10

    Hello, there are ant news? I'm interesting to use WPML with Dokan. Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Is Dokan compatible with WPML’ is closed to new replies.