Arrrgh… help, please!
-
Been stuck on this over two hours. Please, someone help!!!
1) First problem: I created a pod “products” as a “Custom Post Type”. Has a field “product_price” that is “Currency” (field type). When I “order by”, it behaves like text, ordering like: $0.00, $1000, $200, $300, $5.
$products = pods('products', array( 'page' => 1, 'limit' => 10, 'orderby' => 'product_price ASC', 'where' => "post_status = 'publish'" ));2) Second problem: I get error when searching by keywords. I have another field called “product_gender”, it’s a “Relationship” (field type) as “Simple Custom Defined List” (options are: Unknown, Male, Female). When I add “where clause”, SQL throws error: “Unknown column ‘product_gender’ in ‘where clause’. How am I supposed to do this correctly?
$products = pods('products', array( 'page' => 1, 'limit' => 10, 'orderby' => 'ID ASC', 'where' => "post_status = 'publish' AND (post_title like '%male%' AND product_gender like '%male%')" ));
The topic ‘Arrrgh… help, please!’ is closed to new replies.