Forums › Forums › Search & Filter Pro › Rewrite Issue
- This topic has 16 replies, 2 voices, and was last updated 3 years, 9 months ago by Ross.
-
Anonymous(Private) November 10, 2017 at 11:49 pm #141361
I have a custom taxonomy with a hierarchal rewrite rule. The taxonomy is set to a hierarchical dropdown and include child terms. When I select a child term, the form submits and the child term slug is replaced with the previous parent terms child from the dropdown. Example:
Select List:
Blood Pressure
–Massage Oils
Blood Sugar
— Glucose MonitorsSelecting Blood Sugar
– https://shop.lifespa.com/health-topic/blood-sugar/
Selecting Blood Sugar/Glucose Monitors
– https://shop.lifespa.com/health-topic/blood-sugar/%5B0%5D-massage-oils/Its a very odd behavior, I also see the index value in the html li element
li class=”sf-field-taxonomy-health-topic” data-sf-field-name=”_sft_health-topic” data-sf-field-type=”taxonomy” data-sf-field-input-type=”select” data-sf-combobox=”1″ data-sf-term-rewrite=”["https:\/\/shop.lifespa.com\/health-topic\/[0]\/","https:\/\/shop.lifespa.com\/health-topic\/[0]\/[0]-massage-oils\/"]” data-sf-taxonomy-archive=”1″Anonymous(Private) November 22, 2017 at 1:13 am #143126The custom taxonomy is written in a custom plugin/
//* Add custom taxonomies //* Define Constants define( 'PT_WOO', 'product' ); if ( ! function_exists( 'gum_woo_register_tax_product_health_topic' ) ) { // Register Custom Custom_Taxonomy function gum_woo_register_tax_product_health_topic() { $ctax_name = 'Health Topic'; $ctax_plural = 'Health Topics'; $labels = array( 'name' => _x( $ctax_plural, 'gumtheme' ), 'singular_name' => _x( $ctax_name, 'gumtheme' ), 'menu_name' => __( $ctax_plural, 'gumtheme' ), 'all_items' => __( 'All '.$ctax_plural, 'gumtheme' ), 'parent_item' => __( 'Parent '.$ctax_name, 'gumtheme' ), 'parent_item_colon' => __( 'Parent '.$ctax_name.':', 'gumtheme' ), 'new_item_name' => __( 'New '.$ctax_name, 'gumtheme' ), 'add_new_item' => __( 'Add New '.$ctax_name, 'gumtheme' ), 'edit_item' => __( 'Edit '.$ctax_name, 'gumtheme' ), 'update_item' => __( 'Update '.$ctax_name, 'gumtheme' ), 'separate_items_with_commas' => __( 'Separate '.$ctax_plural.' with commas', 'gumtheme' ), 'search_items' => __( 'Search '.$ctax_plural, 'gumtheme' ), 'add_or_remove_items' => __( 'Add or remove '.$ctax_plural, 'gumtheme' ), 'choose_from_most_used' => __( 'Choose from the most used '.$ctax_plural, 'gumtheme' ), 'not_found' => __( 'No '.$ctax_name.' Found', 'gumtheme' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false, //'has_archive' => true, //'exclude_from_search' => false, //'publicly_queryable' => true, 'rewrite' => array( 'slug' => 'health-topic', 'with_front' => false, 'hierarchical' => true // to display taxonomy/term ), ); register_taxonomy( 'health-topic', PT_WOO, $args ); } // Hook into the 'init' action add_action( 'init', 'gum_woo_register_tax_product_health_topic', 1 ); } //end if
Anonymous(Private) November 22, 2017 at 1:25 am #143128The issue seems to be definite rewrite issue in the
<li>
datadata-sf-term-rewrite="["https:\/\/staging.store.lifespa.com\/health-topic\/[0]\/","https:\/\/staging.store.lifespa.com\/health-topic\/[0]\/[0]-massage-oils\/"]"
Where
[0]-massage-oils
should be[1]
Also, may be related?
If I use the Woo Shop Page for results vs the Post Type Archive, I get the following Undefined variable: enable_taxonomy_archives in ..wp-content/plugins/search-filter-pro/public/includes/class-search-filter-query.php on line 1257
Ross Moderator(Private) November 24, 2017 at 5:14 pm #143835This reply has been marked as private.Ross Moderator(Private) November 29, 2017 at 11:48 pm #144691This reply has been marked as private. -
AuthorPosts