When calling parent::__construct() from WC_Widget_Product_Departments the constructor of WC_Widget_Product_Categories immediately overwrites the class properties (especially the widget_id), see here at GitHub. So you have to extend WC_Widget to create a new widget and then you can copy anything what you need in your widget from WC_Widget_Product_Categories to WC_Widget_Product_Departments.
Related Posts:
- Use wc_enqueue_js only on specific pages – nested add_action
- OOP Plugin Development. Including external object
- woocommerce subscriptions – get expiration date [closed]
- Automated Cart Update With Alert Box Each Time
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to auto fetch customer details in Woocommerce in checkout page
- I want to add custom add to cart link [closed]
- Undefined method class::construct() when creating a plugin
- Usage of call back function of add_meta_box()
- Change product_base programmatically
- Can a plugin redirect product page based on IF condition?
- Cant register rest routs from class instance
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- custom post type with role Vendor
- Woocommerce custom Plugin in wordpress [closed]
- Add a custom WooCommerce settings tab with sections
- Payment field disappears on custom Paypal plugin
- Call to “admin_notices” hook from a static method
- I am having errors with checkout on wordpress
- product_type_options get saved value [closed]
- Use PHP Class in WordPress functions
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Looping through and combining calls to Woocommerce REST API
- How to import woocommerce custom fields data into another site?
- How do I remove an action hook inside a class that is called by another class?
- PHP calling function within a class
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Issues separating my Plugin pages into different files
- How keep woocommerce users separeted in multisite install and keep admins on network
- Custom field fetch error on woocommerce pdf invoice
- Woocommerce Convert existing order to the cart
- How to change product SKU’s in bulk with a plugin
- Woocommerce change prices for a certain country [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- How to use html inside a functions.php code?
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- Remove an action by extending class and replacing it
- Single Quotes in .php file doesn’t load website
- Is it save to use eval for a jQuery callback method coming from the database?
- Need oop for wordpress theme? [duplicate]
- Scheduling an event inside plugin class is not working
- How to upload WP user avatar on woocommerce account page [closed]
- How to Change CSS Colors from Custom Plugin Settings Page
- How to relocate paypal button gateway on checkout page in woocommerce
- Passing the name of selected color from the custom component to `render_callback`
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Only show size attributes in product box woocommerce when available
- wordpress frontend editor to add extra css to website
- How do I run code every 24 hours?
- Woocommerce Product_cat for current category page
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- Class property seems to lose scope, attached to save_post action?
- PHP: How to access db the right way in plugin?
- select a single val though a table in wordpress
- WordPress – Get Posts with Category data
- How to use wp_send_json() and output the value with ajax?
- Woocommerce. Get a list of products in the current category on the archive page and product page
- How can I enter on the Thank you page in woocommerce the discount code I assigned to the product category?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Woocommerce append shipping method form
- How to Create custom block for displaying information in content section which act like shortcode
- How to detect and handle the time difference between server and user in WordPress?
- How to setup the Email piping in WordPress plugin?
- Reliable way to add nonce to HTTP Header in WordPress?
- Getting an error when my plugin is updated, but the files update correctly
- Creating a POP Alert
- How do I check if a product is in two categories?
- php code for outputting a custom page in my account
- ssl redirect function is not working
- Remove span tags from WooCommerce Downloads page
- WordPress Plugin Development – get_option error
- how to add new PHP page in WordPress plugin
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- Exclude category from woocommerce product category list
- Edit woocommerce_product_archive_description using hook
- Constant expression contains invalid operations plugin class properties visibility
- Gutenberg blocks shortcodes compatibility
- Save custom field on WP_List_Table
- How to empty price of simple and variable product when product changed into out off stock
- Load script and styles using an array of resources
- How to create loop inside wordpress function?
- How to add typehints to function in functions.php when argument is an object?
- Input field duplicates on form submit by jQuery
- How to echo a PHP code into WooCommerce variation product?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- Woocommerce custom attributes list help
- Change pricing in Woocommerce based on Category and Product [closed]
- Global filter not working
- WooCommerce remove_action and add_action [closed]
- Unable to pass variable to database
- Gravity Forms Marketo Plugin Feed [closed]
- Add custom filter to register data in array
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- MySQL update text field with ‘
- How to add margin underneath woocommerce total price amount -> productpages
- How to find the value of the user password in wordpress and send it to another server via rest api
- Change Checkout “Place Order” text if cart has a specific product
- display php code in header using wp_head()