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:
commit
3fd4c365b1
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue