Jump to content

Recommended Posts

Posted

I was following the examples given in Diogo's answer here - However, I am either making a mistake or not getting it.

$products = $pages->find("parent=/products/");
foreach ($products as $product) {
	//Database queries and while loops to give me the width, depth, height and seat_height variable values. They echo out fine.
	echo "<p><strong>The next dims are: " . $width . ", " . $depth . ", " . $height . (isset($sh)?", " . $sh:"") . "</strong></p><br />";
	
	$product->of(false);
	$product->width = $width;
	$product->depth = $depth;
	$product->height = $height;
	if(isset($sh)){
		$product->seat_height;
	}
	$product->save;
	//print_r($product);
	if(isset($sh)){
		unset($sh);
	}
}

The script completed without errors, but nothing appeared in the forms for the individual product pages in admin. However, the values do appear in the array if I print out the $product array, for example:

Array ( [title] => 111 Spindle Side Chair 
 => 111 [width] => 490 [depth] => 530 [height] => 830 [seat_height] => 465 ) 

Bit confused. Any help appreciated.

Posted

Thanks a bunch, Wanze. I love your image. Seems like you just casually knock off a quick answer one handed whilst relaxing :-)

So the answer was. It's a mistake!!

Thanks once again and for the speed of response.

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
×
×
  • Create New...