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 Payment Method Change
- $wpdb->insert writes a record twice for some reason, when my custom developed plugin calls my class function once
- Using OOP in WordPress Plugin Development
- What does $wpdb->get_row return?
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- Use object in template part
- How do I display a user’s previous orders as a select box option on a product?
- How do you add customer capability after Woocommerce purchase?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Change sign up fee in cart for subscription products WooCommerce
- How can I use wp_query to show all product data using just the products ID?
- WP add_action factory
- wp_loaded hook block script enquequing
- write custom woocommerce templates and forms
- combine Code 1 with Code 2
- WooCommerce – Reset quantity input field when variation changes
- WP nonce invalid
- get current product name in functions.php
- Get stock by custom meta field on all Woocommerce variable products
- Make the first item as default on Woocommerce product category items list
- Custom Text in WooCommerce Order Processing Email Based on Products
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- Set a condition based on WooCommerce checkout city field while placing order
- Get WooCommerce product details and transfer them to a custom DB table
- Same log message keeps on printing to debug.log file thousand of times
- tracking number field in Woocommerce order [closed]
- database interactions using OOP
- WooCommerce Related Products by Attribute
- Adding Default Settings to Theme My Login plugin
- Image as Sales Badge
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- WooCommerce – Email admin with new user details
- Plugin CSS not enqueing
- Customizer – Prefix Class Extension
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Automatically remove a canceled order in Woocommerce
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- Call global variable array() in woocommerce child/template
- Remove price from Woocommerce variable product dropdown menu
- Extending the WP_Widget_Text class
- How to access global variable $menu inside a class function
- Adding nofollow to a PHP generated Nav
- Trying to get property of non-object “ wordpress ”
- Hide categories that are not used in the post type
- How can I remove a function that has been added to wordpress with add_filter?
- Two Different Links for Same Product – WooCommerce [closed]
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- Issue adding sub category programmatically
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- How to prevent XSS alter custom global javascript object & methods in WordPress
- dividing sub-categories by parent category – WordPress
- Show prices with tax in Woocommerce Mini Cart [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- Custom user login page by creating a plugin
- Woocommerce product variation backorder
- Status 400 for AJAX POST Request with admin-ajax.php
- Singelton class does not work, multiple initialization on page reload