bbeer Posted April 2, 2014 Share Posted April 2, 2014 Hi I have a template product in which I have 6 field In need the value in another template with $p = $pages->find("template=product|field=prod_calc_a1|field=prod_calc_a2"); we just get the id of the products, but not the values. with foreach ($p as $key=>$value) { echo "$key - $value<br />"; } I just get the ID's. How can I get the value of the six fields prod_calc_a Your help is much appreciated Link to comment Share on other sites More sharing options...
Raymond Geerts Posted April 2, 2014 Share Posted April 2, 2014 Should'nt the selector be somthing like this? $p = $pages->find("template=product,field=prod_calc_a1|prod_calc_a2"); And then foreach ($p as $i) { echo "{$i->id} - {$i->field}<br />"; } But i'm not entirely sure what you want to achieve Link to comment Share on other sites More sharing options...
adrian Posted April 2, 2014 Share Posted April 2, 2014 Yeah, I don't understand that selector. Maybe it's just too early here, but you can't use "field" in a selector like that. I might well be not understanding, but is this what you are looking for: foreach($pages->find("template=product") as $p){ echo $p->prod_calc_a1; echo $p->prod_calc_a2; echo $p->prod_calc_a3; echo $p->prod_calc_a4; echo $p->prod_calc_a5; echo $p->prod_calc_a6; } or are you trying to limit the find to specific values for each of these fields? Link to comment Share on other sites More sharing options...
bbeer Posted April 2, 2014 Author Share Posted April 2, 2014 thanks for your help! the problem was really in the selector. Thats it! Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now