Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...