Thanks to @mmm and his comment defining $endpointsub before $endpoint it worked. Not sure why that is but that solved it.
So change the order of endpoints:
$endpointsub = 'my-new-endpoint/new-subendpoint';
$endpoint="my-new-endpoint";
add_rewrite_endpoint( self::$endpointsub, EP_ROOT | EP_PAGES );
add_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );
add_query_vars( $vars ) {
$vars[] = self::$endpointsub;
$vars[] = self::$endpoint;
return $vars;
}
Related Posts:
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- Woocommerce Customs Endpoint
- Custom account page that accepts a query parameter
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- Getting the gallery images from products in woocommerce?
- add_filter to modify woocommerce_cart_item_name hyperlink
- Get product details by url key in WordPress woocommerce
- How to get rid of the hover zoom in WooCommerce single products
- How do I display certain products via their category on a section of a page using PHP?
- Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?
- pre_get_posts with WooCommerce Shortcode Query
- Reverse engineering of WooCommerce Storefront filters
- Use WooCommerce function in other WordPress plugin
- WooCommerce – update order item price and recalculate totals
- Add product description (content) to WooCommerce customer processing order email
- woocommerce – get_image_size() deprecated [closed]
- Adding product SKU before cart item name in WooCommerce
- Woocommerce: How to remove page title from storefront theme homepage
- Remove checkout fields with Woocommerce depending on one of several shipping methods
- Replace one coupon to another after coupon added
- WooCommerce Multi-Currency shortcode not working
- Filter WooCommerce Orders query with user meta data
- How to change a column width on WooCommerce orders page (Admin)
- WooCommerce Shop Orders by Date
- Show list of woo commerce orders where particular zip code exists using pre_get_posts?
- display first sale product in shop
- adding a script with type=”module” to woocommerce admin area
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Featured image for product listings, but another image as the product image?
- How to add custom data to cart for a specific product which I have shown on a page programmatically and with a separate anchor adding it to cart?
- How to select from two different tables to display orders list with custom column from other table
- Keep getting Notice: Trying to get property of non-object in …\wp-includes\post.php on line 4153 when generating woocommerce coupon
- How to subscribe free subscription on user registration in woocommerce subscription plugin?
- Woocommerce how to alter shipping tax before checkout
- Woocommerce cart page – Add “Free” to the shipping label when shipping is 0
- Change product in cart when billing country is changed
- Calculate tax on sales price excluding discount [closed]
- WooCommerce add class name in the list [closed]
- How to override the title tag for woocommerce endpoints?
- WooCommerce – Global $product is returning value null
- How to rewrite product permalinks in Woocommerce to use category slugs
- How to re-arrange this hooked content?
- Pre filter woocommerce products to remove a certain category of products
- WooCommerce Stripe Plugin not showing up in settings [closed]
- How to add order status class to the body tag?
- Woocommerce – Change the template?
- Wooocommerce disable check_cart_item_stock if cart item has specific meta
- Force meta data on specific product type
- WooCommerce plaintext mail doesn’t display currency symbol
- Woocommerce, finding the ordinal number of a purchase for a certain product
- WooCommerce order refund get qty refunded
- WP/WooCommerce multisite with polylang, product duplication between websites [closed]
- WooCommerce add_to_cart
- WooCommerce Simple Product Options List
- Add custom body tag if product is out of stock
- Functions.php change for Woocommerce not working
- Woocommerce replace product page image with product tabs [closed]
- Woocommerce Register Error
- Need to check if user has completed a woo commerce payment
- How to get all customers cart from woocommerce API?
- WooCommerce login redirect based on cart
- unable to customize query to get filtered products by meta_key
- Woocommerce + Google Analytics (Conversion Rate Not Working)
- send order detail to swiftpos
- WordPress Woocommerce REST API JSON Error
- data-value for custom woocommerce field showing in code but not visable on page load
- Update user meta when customer update their first name
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- How can we find a WooCommerce shop bottleneck? (only when cart is full)
- Conditional for product attribute page
- Setting Page Visibility for WooCommerce Default Page Doesn’t Work
- Deleted products from woocommerce are still in the database
- Remove cart functionality from WooCommerce so it doesn’t remember the products [closed]
- Apply CSS to certain product thumbnails only
- Overriding Plugin function in your child theme
- Files names changed (with strange characters) after being uploaded to cpanel
- woocommerce_add_to_cart custom function called several times
- Order Woocommerce Products by On Sale and Alphabetically
- Display product variations in shop page
- Customer Email Address
- How to echo woocomerce attributes values in dropdown box
- How to fix spacing in address tab in my account page
- Adding time of order to Admin email for new order
- Uninitialised Parameters using woocommerce_checkout_update_order_meta hook
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- Hide add to cart when product variation has no price or is unavailable
- How to get the WooCommercer product variation image
- how add css class to product boxes li, for img, add cart button, decs, price… [closed]
- How can I hide the entire “Shipping Details” block on the admin side of Woocommerce? [closed]
- How do I put woocommerce cart page to my checkout page? [closed]
- Decrease stock quantity when a variation is sold using Woocommerce
- WooCommerce show decimals in totals [closed]
- CSS url rules not relative to css path in account endpoint areas. IE. subscriptions
- registration_errors not working
- How do I remove the recurring total from thank you for your order email?
- I want to Display custom woocomerce meta box in orders list
- Detect Product Type with code
- Verify if woocommerce supports this design [closed]
- Hook for Woocommerce checkout fields