Merge pull request #18905 from woocommerce/fix/18891

Use verbose page rules when shop is in the URL, including shop base with category
This commit is contained in:
Claudiu Lodromanean 2018-02-12 08:46:41 -08:00 committed by GitHub
commit 3fd4c365b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ class WC_Admin_Permalink_Settings {
$shop_page_id = wc_get_page_id( 'shop' );
$shop_permalink = ( $shop_page_id > 0 && get_post( $shop_page_id ) ) ? get_page_uri( $shop_page_id ) : _x( 'shop', 'default-slug', 'woocommerce' );
if ( $shop_page_id && trim( $permalinks['product_base'], '/' ) === $shop_permalink ) {
if ( $shop_page_id && stristr( trim( $permalinks['product_base'], '/' ), $shop_permalink ) ) {
$permalinks['use_verbose_page_rules'] = true;
}

View File

@ -99,7 +99,7 @@ function wc_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) {
} else {
$query_string = '';
}
$url = trailingslashit( $permalink ) . $endpoint . '/' . $value . $query_string;
$url = trailingslashit( $permalink ) . $endpoint . '/' . $value . '/' . $query_string;
} else {
$url = add_query_arg( $endpoint, $value, $permalink );
}