Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2013
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. add_action('woocommerce_after_add_to_cart_button', 'display_bulk_discount_table', 29);
  2.  
  3. function display_bulk_discount_table() {
  4. global $post, $product;
  5. $array_rule_sets = get_post_meta($post->ID, '_pricing_rules', true);
  6. if ($array_rule_sets && is_array($array_rule_sets) && sizeof($array_rule_sets) > 0){
  7. $tempstring .= '<table cellspacing="0" class="group_table">';
  8. $tempstring .= '<thead>
  9. <tr>
  10. <th colspan="2"><a href="#" class="my_bulk_table">Purchase more? Click here to see ... </a></th>
  11. </tr>
  12. <tr class="bulk_row" style="display:none">
  13. <th scope="col" id="">Quantity</th>
  14. <th scope="col" id="">Price</th>
  15. </tr>
  16. </thead><tbody>';
  17. foreach($array_rule_sets as $pricing_rule_sets)
  18. {
  19. foreach ( $pricing_rule_sets['rules'] as $key => $value ) {
  20. $tempstring .= '<tr class="bulk_row" style="display:none">';
  21. $tempstring .= '<td class="tdqty">'.$pricing_rule_sets['rules'][$key]['from']."- ".$pricing_rule_sets['rules'][$key]['to']."</td>";
  22. $tempstring .= '<td class="price"><span class="amount">$'.$pricing_rule_sets['rules'][$key]['amount']."</span></td>";
  23. $tempstring .= '</tr>';
  24. }
  25. }
  26. $tempstring .= "</tbody></table>";
  27. echo $tempstring;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement