Ok! This is my solution, and (so far) it works:
function return_custom_price($price, $product) {
$myPrice = 15;
global $current_user;
$price = $myPrice;
$post_id = $post->ID;
return $price;
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);
It does target every single product in the store, but as the site only has one product, this works fine.
Related Posts:
- How to add a new endpoint in woocommerce
- Slow Loading Attribute Select – WooCommerce Backend
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- Use Hooks to Limit One Comment Per User Per Post – Hide Form if Already Commented
- Display Categories Assigned to a WooCommerce Product
- Get current WooCommerce endpoint not working
- Changing Woocommerce price display [closed]
- Which WooCommerce hook do I need to use to place the coupon field after the checkout sidebar
- WooCommerce Cart – Group Products By Category
- Set a default quantity input value for a variable product category in WooCommerce
- WooCommerce product sorting VERY slow
- WooCommerce change price in cart [closed]
- Categories not shown in admin after adding woocommerce products via wp wc cli
- Woocommerce – Move product without price a the end
- Enabling autosave when plugin disabled
- WooCommerce email text based on category && shipping zone && payment method [closed]
- woocommerce – get_image_size() deprecated [closed]
- Extra row / text field to a product page (WooCommerce)
- woocommerce_email_attachments filter arguments [closed]
- Problem with cURL and rest API
- How to add a user custom field into Woocommerce emails?
- WooCommerce subscription, give option to prorate or not to prorate to user while switching subscription
- How to handle Woocommerce API credentials
- Woocommerce Shipping label just hangs
- Add custom CSS class to product images
- Get product variation attribute titles – WooCommerce
- user password reset e-mail
- Extending the woocommerce product export functionality
- Woo Related Products How to override the plugin script?
- Line break on Product details [closed]
- How to display Woocommerce variations prices and descriptions
- Adding Transaction-Specific Conversion Tracking from Adwords into WooCommerce
- New field on checkout is shown but it’s not saved on the order details [closed]
- Changing a text label into an image
- Custom Price for WooCommerce [closed]
- Woocommerce altered my homepage, and I can’t figure out how to revert it [closed]
- Woocommerce – Problem sorting and filtering products with different tax rates by price [closed]
- Why does my loop breaks the css below?
- Absolute search against wordpress api
- Is it possible to remove editor from a custom product type?
- Show password while you are typing it on the “my account” login page
- /page/ is not working with a custom permalink structure (WooCommerce)
- WooCommerce Bookings Plugin Not Saving Order ID
- Where is this text in a wordpress email coming from? Want to change/remove
- Add starts rating in woocommerce product comment from backend
- Trying to run Javascript on AJAX call
- Rewrite rules for sub category (child product categry & grand-child)
- Woocommerce show field in product if product-tag is “VET” else hide
- How to make a “subtitle” for each Woocommerce product
- Create Product with Woocommerce API, but Variations are not linked
- How to reduce checkout loading time of `?wc-ajax=checkout`
- Google Analytics gtag code messes up woocommerce cart & login
- Woocommerce API security concerns
- How to add a wrapper element on image for products page
- Dynamic subdomains for woocommerce affiliate sales but NO multisite. Is that possible?
- Woocommerce posts and products links works only once and then get 404 error
- I wan redirect link post search to search product woocommerce?
- Limit image resolution on upload file for specific field
- Woocommerce pagination problem- page/2 = 404 solution
- Woocommerce , how to set billing_address via JS?
- Using admin email in billing address
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- Enable Payment gateway if ACF checkbox in user profile is checked
- How do you reactive related products on WooCommerce when it has been disabled?
- Woocommerce section name? [closed]
- how to change value return by _stock_status
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- How can I locate where the actions are defined? [duplicate]
- Shortcodes in billing fields doesn’t work
- Update a user meta key based on WooCommerce product purchase
- show multiple product photos on WooCommerce single page
- deactivate product-page image slider on mobile
- WooCommerce widget “WooCommerce Products” template [closed]
- How to get _POST variable on WooCommerce product page (form on homepage)
- Woocommerce woocommerce_breadcrumb_defaults filter [closed]
- Some Admin disappeared
- Sort by promo code used woocommerce admin panel [closed]
- Search box missing Woocommerce Product Bundle Extension
- How to display India country first in country selection drop down list in WordPress
- DatePicker in Woocommerce (My Account) Registration [closed]
- problems with an object product wooCommerce [closed]
- registration_errors not working
- How to dublicate WC Product title to shortdescription field? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- How do I remove the recurring total from thank you for your order email?
- Translate Woocommerce tab
- Woocommerce -> gallery images per variation without a plugin? [closed]
- Why is my WordPress admin not working
- Create bookings after subscription renewal
- Change variants URL
- Use a woocommerce hook to create a table and populate it with a query
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page
- 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