Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Get the last piece of the URL
- // E.g. for yoursite.com/food/bread, then $item_type would be "bread"
- $item_type = pods_url_variable('last');
- if ('bread' == $item_type) {
- $item_type = 'Bread';
- }
- elseif ('milk' == $item_type) {
- $item_type = 'Milk';
- }
- $products->findRecords('name ASC', 10, "category.name = '$item_type'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement