By pepito3eb on
Hi everyone,
I'm trying to print certain attributes created from EC Live Subproducts. These belong to a content type I created called "products".
I have used
<pre>
<?php print_r($node); ?>
</pre>
and under the [content] array I see:
[subproduct-attributes] => Array
(
[#weight] => 1
[#value] =>
Length
Size
Price: $15.00
[#printed] => 1
)
and under Length & Size there appears a drop down list of my different variations.
I have tried using
print $node->content['subproduct-attributes']['value'];
in my node-products.tpl.php but nothing happens. Could anyone please point me in the right direction? Thank you very much!
Comments
Is there anyone who can help
Is there anyone who can help me out? I'm trying really hard to get this to work...
I'm also really needing to
I'm also really needing to get this working. I'm working on this for a site tonight, so if I find anything I will post back and let you know. In the mean time, does anyone know a solution?
figured it out
pepito3eb and anyone else needing to know how to do this,
My mistake was quite dumb. Make sure you actually have sub attributes checked off for the product otherwise you won't get anything returning. But once you do you should be able to very easily add print out the form for choosing the options:
And if you want to theme what is returned you can add the following function to your template.php file:
Note: I commented out the fourth line because I actually didnt want the module's css loaded.
Hope that helps anyone who gets stuck on this.
--
Drupal Web Development by ImageX Media