diff --git a/admin/settings/settings-init.php b/admin/settings/settings-init.php index f03e8c42030..2ead80f5046 100644 --- a/admin/settings/settings-init.php +++ b/admin/settings/settings-init.php @@ -385,6 +385,34 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra array( 'name' => __( 'Permalinks', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'permalink_options' ), + array( + 'name' => __( 'Product base category', 'woocommerce' ), + 'desc' => __( 'Prepend product permalinks with product category', 'woocommerce' ), + 'id' => 'woocommerce_prepend_category_to_products', + 'std' => 'no', + 'type' => 'checkbox', + 'checkboxgroup' => 'start' + ), + + array( + 'name' => __( 'Product base page', 'woocommerce' ), + 'desc' => sprintf(__( 'Prepend product permalinks with shop base page (%s)', 'woocommerce' ), $base_slug) . $woocommerce_prepend_shop_page_to_products_warning, + 'id' => 'woocommerce_prepend_shop_page_to_products', + 'std' => 'yes', + 'type' => 'checkbox', + 'checkboxgroup' => 'end' + ), + + array( + 'name' => __( 'Product slug', 'woocommerce' ), + 'desc' => __( 'Shows in the single product URLs. Leave blank to use the default slug. Can only be used if shop base page isn\'t prepended.', 'woocommerce' ), + 'id' => 'woocommerce_product_slug', + 'type' => 'text', + 'css' => 'min-width:300px;', + 'std' => '', + 'desc_tip' => true, + ), + array( 'name' => __( 'Taxonomy base page', 'woocommerce' ), 'desc' => sprintf(__( 'Prepend shop categories/tags with shop base page (%s)', 'woocommerce' ), $base_slug), @@ -413,24 +441,6 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra 'desc_tip' => true, ), - array( - 'name' => __( 'Product base page', 'woocommerce' ), - 'desc' => sprintf(__( 'Prepend product permalinks with shop base page (%s)', 'woocommerce' ), $base_slug) . $woocommerce_prepend_shop_page_to_products_warning, - 'id' => 'woocommerce_prepend_shop_page_to_products', - 'std' => 'yes', - 'type' => 'checkbox', - 'checkboxgroup' => 'start' - ), - - array( - 'name' => __( 'Product base category', 'woocommerce' ), - 'desc' => __( 'Prepend product permalinks with product category', 'woocommerce' ), - 'id' => 'woocommerce_prepend_category_to_products', - 'std' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'end' - ), - array( 'type' => 'sectionend', 'id' => 'permalink_options' ), array( 'name' => __( 'Shop Pages', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following pages need selecting so that WooCommerce knows where they are. These pages should have been created upon installation of the plugin, if not you will need to create them.', 'woocommerce' ) ), diff --git a/readme.txt b/readme.txt index 4debe66c714..89885c870f8 100644 --- a/readme.txt +++ b/readme.txt @@ -169,6 +169,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Feature - Schedule sales for variations. * Feature - Expanded bulk edit for prices. Change to, increase by, decrease by. * Feature - Set attribute order (globally, per attribute). +* Feature - Allow setting the product post type slug to a static (non-translatable) text, mainly to be used for translating and WPML setups. * Templating - email-order-items.php change get_downloadable_file_url() to get_downloadable_file_urls() to support multiple files. * Templating - loop-end and start for product loops, allow changing the UL's used by default to something else. diff --git a/woocommerce.php b/woocommerce.php index b2d232de3ff..8ff63ef1e7d 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -631,7 +631,15 @@ class Woocommerce { $tag_slug = ( get_option('woocommerce_product_tag_slug') ) ? get_option('woocommerce_product_tag_slug') : _x('product-tag', 'slug', 'woocommerce'); - $product_base = ( get_option('woocommerce_prepend_shop_page_to_products') == 'yes' ) ? trailingslashit($base_slug) : trailingslashit(_x('product', 'slug', 'woocommerce')); + if ( 'yes' == get_option('woocommerce_prepend_shop_page_to_products') ) { + $product_base = trailingslashit( $base_slug ); + } else { + if ( ( $product_slug = get_option('woocommerce_product_slug') ) !== false && ! empty( $product_slug ) ) { + $product_base = trailingslashit( $product_slug ); + } else { + $product_base = trailingslashit( _x('product', 'slug', 'woocommerce') ); + } + } if ( get_option('woocommerce_prepend_category_to_products') == 'yes' ) $product_base .= trailingslashit('%product_cat%');