Skip to content

Instantly share code, notes, and snippets.

@tasz
Created July 12, 2013 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tasz/5982399 to your computer and use it in GitHub Desktop.
Save tasz/5982399 to your computer and use it in GitHub Desktop.
<?php
global $post, $product;
$pricing_rule_sets = get_post_meta($post->ID, '_pricing_rules', true);
$pricing_rule_sets = array_shift($pricing_rule_sets);
if ($pricing_rule_sets && is_array($pricing_rule_sets) && sizeof($pricing_rule_sets) > 0){
?>
<div>
<div>
Qty
</div>
<div>
Amount
</div>
</div>
<?php
foreach ( $pricing_rule_sets['rules'] as $key => $value ) {
echo "<div class=\"float_l\">";
echo "<div class=\"qt1\">".$pricing_rule_sets['rules'][$key]['from']."-".$pricing_rule_sets['rules'][$key]['to']."</div>";
echo "<div class=\"amt1\">$".$pricing_rule_sets['rules'][$key]['amount']."</div>";
echo "</div>";
}
} ?>
@Salexan
Copy link

Salexan commented Sep 23, 2013

Hi Tasz, this works great when you have only one variation.
Do you have an idea what to do when you have more than one variation on a product.

Then it should show the bulk prices for the different variants, but I did not succeed in doing that.

Thanks en regards,
Floris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment