Thanks to a colleague at codeable I was able to solve this by saving the product after setting the sale price:
$editedProduct->save();
Simple as that. If only I’d known that 6 hours ago!
Related Posts:
- Remove an action by extending class and replacing it
- Plugin Form Submission Best Practice
- PHP error with shortcode handler from a class
- Using a plugin class inside a template
- How to create a flexible abstraction for WP_Query?
- What is the correct way to build a widget using OOP
- How to make method from plugin available in theme?
- Using OOP plugin’s methods throughout the website
- Single Responsibility Principle and WP Classes
- How Can I Add a Filter to Class Instance Only?
- The ideal place for storing persistent PHP objects
- WooCommerce get Shipping Class of product from either the product id or the order after order is completed
- Plugin Architecture/Design Pattern – is better to use a private Observer/Mediator Pattern for plugin subclasses or WP add_action?
- How to iterate through custom posts and add the title to an array
- product-attribute-slug-is-too-long-28-characters-max
- get all products of one category
- Woocommerce add custom button to backend order table
- Plugin vs Settings load order (woocommerce dependency)
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- Using a front controller in a WordPress plugin, any suggestions?
- Add multiple shipping rates from add_rate function with custom ID
- Woocommerce – Hide a Column in Cart Table
- Print value of an array or variable in a payment plugin
- How to get orders with used coupon in WooCommerce
- How to update total price of completed order in woocommerce? [closed]
- Plugin development: get_post_meta is not working [closed]
- WordPress Ajax callback function from plugin – OOP
- How do you render_callback for register_block_type to a method in another class?
- $wpdb -> Batch insert from XML File?
- How do I change the initial quantity of a product in woocommerce?
- Order properties should not be accessed directly
- How to check if Woocommerce Order number equals to post ID?
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- How do I add custom column to woocommerce cart?
- How plugins_loaded works?
- Registering and using actions which return results in a Plugin class
- Advice on plugin structure
- Applying OO patterns and principles to plugin development
- WooCommerce Conditional Tag inside plugin
- Custom attribute type not displaying terms in edit product – WooCommerce
- Creating a shortcode, but getting tied up with OOP and Classes?
- WooCommerce registration password field not displaying
- Show special field when correct shipping is chosen
- update woocommere total value on checkout based on selected payment method
- how to add custom functionality after woocommerce place order button
- WooCommerce Admin Reports : Get custom product report based on date range
- Adding a brand column to WooCommerce Products
- Woocommerce checkout update totals with datepicker
- Strange issue saving custom field data for a WooCommerce order
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- Woocommerce – Convert Delivery method into a custom field
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- Woocommerce extend tax report with custom column
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Plugin Architecture Question: How to avoid using transients
- Show disclaimer with accept button before redirecting to the payment gateway website
- How do I apply a custom discount to individual product total prices depending on their categories on the cart and checkout pages of WooCommerce? [closed]
- In woocommerce cart item we can add custom text but how can i add custom link? [closed]
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Can’t get woocommerce_get_price_html to work [closed]
- What is the proper method of using global $post?
- How to restrict access to image folder depending on whether product is purchased or not?
- How to extend WooCommerce API to show bookable product availability rules?
- Customize WooCommerce my account dashboard through plugin
- woocommerce_checkout_order_processed hook executing function twice
- Is there a way in which I can compare product id with the order id to display content on front end before placing the order? [closed]
- Woocommerce Composite Products – Add a composite product to cart programmatically via ajax [closed]
- Dynamically creating classes for Widget API
- WordPress class, using add_action to call member function does not work
- Change WooCommerce Email Header using custom plugin
- UWooCommerce – add cart discount programmatically?
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Woocommerce order empty items array
- Using OOP inside a Plugin – Is it allowed?
- How to get all product in the woo-commerce? [closed]
- A question about add_action()
- WordPress plugin development OOP style
- Woocommerce inventory [closed]
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Can woocommerse be used dynamically for billing from another plugin for payment processing?
- Sending an SMS on new order placed – WooCommerce
- Can we use a library under MIT license in a WooCommerce plugin?
- Set _regular_price 0 if empty in woocommerce product
- WooCommerce Endpoints content
- How remove trashed WooCommerce orders from wc_get_orders() result?
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- Duplicate shipping method logic to another shipping method [closed]
- Custom Plugin Options Won’t Update
- Hide one specific woocoomerce product
- Woocommerce – Provide Associated Category Link for Product List Plugin [closed]
- get_shipping_methods() return empty rate
- OOP plugin not working
- Remove Products From Category
- want to show CMB2 metabox on woocommerce product data tab
- wp_schedule_single_event is set correctly but sometimes not fired
- Dynamic page generation upon purchase of a product
- Customise Grouped Product display in Woocommerce with custom column
- Change reminder email date to 14 days before
- Make a php array load faster