WooCommerce Product URL re-writing

This should work:

add_action( 'init', 'wpse33551_rewrites_init' );

function wpse33551_rewrites_init(){
    add_rewrite_rule(
        'product/.+\-([0-9]+)?$',
        'index.php?post_type=product&p=$matches[1]',
        'top' );
}

The filter function is changing the permalink to like product/my-product-name-88. You just need to tweak the regex in the second function to deal with that pattern.

The regex is:

product/ – matches the literal string product/

.+ – matches one or more other characters

\- – matches a hyphen (the backslash escapes it, so the regex engine doesn’t think it’s a special regex operator, like in the next bit)

([0-9]+)?$ – matches and captures one or more numbers at the end of the URL

As @gregory says, after making this change you need to click the save button on your permalink page wp-admin/options-permalink.php to flush the rewrite cache.