Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2. // Get the last piece of the URL
  3. // E.g. for yoursite.com/food/bread, then $item_type would be "bread"
  4. $item_type = pods_url_variable('last');
  5.  
  6. if ('bread' == $item_type) {
  7.     $item_type = 'Bread';
  8. }
  9. elseif ('milk' == $item_type) {
  10.     $item_type = 'Milk';
  11. }
  12. $products->findRecords('name ASC', 10, "category.name = '$item_type'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement