Support » Plugin: Permalink Manager Lite » Dokan Copy Link Problem

  • Resolved kabiahmet

    (@kabiahmet)


    Hello,

    how to generate a URL like this: fiyati/%postname%/?store=%store%

    And When I was a vendor I want to sell another seller’s product and click this button: https://prnt.sc/1b998cx and redirect to the vendor’s new product page. And I save the product. The URL like this: https://prnt.sc/1b9acz0 . Again What am I missing? 🙁

Viewing 1 replies (of 1 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @kabiahmet,

    Generally, I no longer provide any extra customization service for functionalities directly related to 3rd party plugins.

    To rewrite the product permalinks like this, you will need a different snippet (you do not need to use the old one you mentioned in the previous post):

    function pm_adjust_product_permalinks($permalink, $post, $old_permalink) {
    	if(!empty($post->post_type) && $post->post_type == 'product') {
    		$store_name = get_user_meta($post->post_author, 'dokan_store_name', true);
    
    		if(!empty($store_name)) {
    			$permalink = add_query_arg('store', sanitize_title($store_name), $permalink);
    		}
    	}
    	
    	return $permalink;
    }
    add_filter('permalink_manager_filter_final_post_permalink', 'pm_adjust_product_permalinks', 999, 3);

    You will also need to change your product permastructures to:
    fiyati/%postname%

    As regards the second part of the problem – WordPress normally does not allow to use the same slug for more than one post (product):
    https://permalinkmanager.pro/docs/faq/native-slug-in-wordpress-permalinks/

    That is why (“copy” suffix is appended to the URL). However, you can make my plugin use the actual product titles instead:
    https://permalinkmanager.pro/docs/plugin-settings/slugs-mode/#use-actual-titles-as-slugs

    In the end do not forget to use “regenerate/reset” tool again 😉 Please also do not open another support thread – this would help other users to find the needed information here 😉

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.