tribulant

Product Categories in invoice.php file

Nov 11th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php if (!empty($item -> product -> categories)) : ?>
  2.     <?php $c = 1; ?>
  3.     <?php foreach ($item -> product -> categories as $category_id) : ?>
  4.         <?php $wpcoDb -> model = $Category -> model; ?>
  5.         <?php if ($category = $wpcoDb -> find(array('id' => $category_id))) : ?>
  6.             <a href="<?php echo get_permalink($category -> post_id); ?>" title="<?php echo $category -> title; ?>"><?php echo $category -> title; ?></a>
  7.             <?php echo ($c < count($item -> product -> categories)) ? ', ' : ''; ?>
  8.         <?php endif; ?>
  9.         <?php $c++; ?>
  10.     <?php endforeach; ?>
  11. <?php endif; ?>
  12.  
Advertisement
Add Comment
Please, Sign In to add comment