VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: millennium on December 22, 2011, 17:50:45 PM

Title: Child products display under main product
Post by: millennium on December 22, 2011, 17:50:45 PM
Hi,

wanted to know is the a possibility to show children products as somekind of table as it was in virtuemart 1.1.9 (under main product), and under them related products.
Title: Re: Child products display under main product
Post by: PRO on December 22, 2011, 18:00:58 PM
I dont use child products, but the layout looks like it can be constomized  in productdetails/tmpl/default.php

<?php foreach ($this->product->customsChilds as $field)
Title: Re: Child products display under main product
Post by: millennium on December 22, 2011, 18:27:48 PM
thank you for an answer, i'm not very skilled in php but i'll give it a try,
i just don't understand the way i should use custom fields what i want to achieve a view in product detail:

main product
and under it
child products in sunch a table
<table width="90%" border="1">
  <tr>
    <td width="30%">SKU number</td>
    <td width="37%">Description</td>
    <td width="33%">Ad to cart</td>
  </tr>
  <tr>
    <td>123</td>
    <td>Description about product 123</td>
    <td>Add to cart button</td>
  </tr>
  <tr>
    <td>124</td>
    <td>Description about product 124</td>
    <td>Add to cart button</td>
  </tr>
  <tr>
    <td>125</td>
    <td>Description about product 124</td>
    <td>Add to cart button</td>
  </tr>
</table>

 


and under this table i would like to see related products to this?

Do you think it's possible?
Title: Re: Child products display under main product
Post by: PRO on December 22, 2011, 18:41:42 PM
ok 1st, do the child products show up at all now?

what does it look like?
Title: Re: Child products display under main product
Post by: millennium on December 22, 2011, 19:07:47 PM
Hi

i get Warning: Invalid argument supplied for foreach() in ....html\com_virtuemart\productdetails\default.php on line 627 when i put "<?php foreach ($this->product->customsChilds as $field)?>" at the end of default.php
Title: Re: Child products display under main product
Post by: PRO on December 22, 2011, 19:13:58 PM
thats because the code is already in the page right under the add to cart.

ARe the child products showing now? 
Title: Re: Child products display under main product
Post by: millennium on December 22, 2011, 19:15:50 PM
no, they are not. :(

forgot to mention


Notice: Undefined property: stdClass::$customsChilds in ...\html\com_virtuemart\productdetails\default.php on line 627

Warning: Invalid argument supplied for foreach() in ...\html\com_virtuemart\productdetails\default.php on line 627
Title: Re: Child products display under main product
Post by: PRO on December 22, 2011, 19:33:52 PM
because u need to take out the code you added.

Its already in the product page
Title: Re: Child products display under main product
Post by: millennium on December 22, 2011, 19:48:47 PM
Can you give a hint for a next step?
Title: Re: Child products display under main product
Post by: PRO on December 22, 2011, 20:20:19 PM
i do not know because i dont use child products.

many other do, im sure they will chime in
Title: Re: Child products display under main product
Post by: millennium on December 22, 2011, 20:28:05 PM
Thanks for your help
I surely hope somebody will help, this feature could help to have a clean looking list table style of child products.
Title: Re: Child products display under main product
Post by: millennium on December 27, 2011, 17:00:48 PM
Hi everybody,

maybe someone knows how to achieve that?

Mod edit: further bump message removed.   http://forum.virtuemart.net/index.php?topic=68489.0