Support » Plugin: Permalink Manager Lite » Force Permalink not work when quick edit

  • Resolved calyweb

    (@calyweb)


    Hi

    I’m using the setting to force the permalink update when the title change

    It’s working when i update a product on the admin, but when i quick edit a product, change the title, and update, the permalink is not changed and stay with the old one

    Thanks for your help

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter calyweb

    (@calyweb)

    No it’s for product, it’s native from woocommerce and we don’t use any plugins …

    Plugin Author Maciej Bis

    (@mbis)

    Ok, I see the problem now. The patch will be included in the next version of plugin. Before this happens, could you try to manually replace the code of woocommerce_generate_permalinks_after_duplicate() function in
    includes/integrations/permalink-manager-woocommerce.php file:

    function woocommerce_generate_permalinks_after_duplicate( $new_product, $old_product ) {
    		if ( ! empty( $new_product ) ) {
    			$product_id = $new_product->get_id();
    
    			// Ignore variations
    			if ( $new_product->get_type() !== 'variation' ) {
    				$custom_uri = Permalink_Manager_URI_Functions_Post::get_default_post_uri( $product_id, false, true );
    
    				Permalink_Manager_URI_Functions::save_single_uri( $product_id, $custom_uri, false, true );
    			}
    		}
    	}

    with:

    function woocommerce_generate_permalinks_after_duplicate( $new_product, $old_product ) {
    		if ( ! empty( $new_product ) ) {
    			$product_id = $new_product->get_id();
    
    			// Ignore variations
    			if ( $new_product->get_type() === 'variation' || Permalink_Manager_Helper_Functions::is_post_excluded( $product_id, true ) ) {
    				return;
    			}
    
    			$custom_uri = Permalink_Manager_URI_Functions_Post::get_default_post_uri( $product_id, false, true );
    			Permalink_Manager_URI_Functions::save_single_uri( $product_id, $custom_uri, false, true );
    		}
    	}

    https://github.com/maciejbis/Permalink-Manager/blob/master/includes/integrations/permalink-manager-woocommerce.php#L128

    This specific file is identical in both Lite & Pro versions.

    Thread Starter calyweb

    (@calyweb)

    That’s great many thanks !

Viewing 3 replies - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.