Skip to content

Instantly share code, notes, and snippets.

@Werninator
Created March 12, 2018 10:15
Show Gist options
  • Select an option

  • Save Werninator/b18b2ae1b1d236cb31dc978c59714959 to your computer and use it in GitHub Desktop.

Select an option

Save Werninator/b18b2ae1b1d236cb31dc978c59714959 to your computer and use it in GitHub Desktop.
How to get 'WooCommerce Dynamic Pricing' values / rules programmatically

How to get 'WooCommerce Dynamic Pricing' values / rules programmatically

After searching a bit (and not finding anything about it), here's a little documentation on how to get your pricing rules of the WooCommerce Dynamic Pricing Plugin programmatically.

<?php
// Some template file
global $product;
// apparently the rules are saved in the post-meta with the key '_pricing_rules'
$pricingRules = get_post_meta($product->get_id(), '_pricing_rules');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment