0

I want to create grouped products. I will explain my need with examples.

Grouped product 1

Productname  length height price
2             2      2      2

Grouped product 2

Productname  length height width price
2               2    2      2     2

I can create Grouped product 1 and Grouped product 2 by creating attributes "length, height, width " and by creating 2 themes.

Theme 1 => grouped1.phtml => LENGTH , HEIGHT
Theme 2 => grouped2.phtml => LENGTH , HEIGHT, WIDTH

Is it possible to Create both Grouped Products with only one theme.

Let me know if you need any clarifications.

please help me to find solution.

thanks in advance.

  • why do you need to create theme for it? just create two attribute sets... – Dexter Sep 1 '14 at 5:03
  • hi, please see below 2 comments. – Baby in Magento Sep 1 '14 at 5:32
  • to create different grouped products, diff attribute sets are enough. How to display in frontend.? visit this: pastebin.com/SSYSWh77 check the line number 116 117 136 137, I can create Grouped product 1 using above code & assigning product to theme 1. – Baby in Magento Sep 1 '14 at 5:33
  • I can create Grouped product 2 by using another attribute set [length , height, width ] But If i want to display grouped product 2 with length , height, width by selcting theme 1, its not possible, because check the 116 117 136 137 in above link. If I add Width on 118, Than in Width will also display in grouped product 1. but I need width only in grouped product 2. let me know if you need any clarifications. thanks in advance. – Baby in Magento Sep 1 '14 at 5:33
1

try this solution: use

<div class="Cell" id="forlength" style="display:none"><?php echo $this->__('LENGTH') ?></div>
<div class="Cell" id="forheight" style="display:none"><?php echo $this->__('HEIGHT') ?></div> 
<div class="Cell" id="forwidth" style="display:none"><?php echo $this->__('WIDTH') ?></div>


on line 118 while on line 138 use :

<?php if($_item->getData('length')): ?><script>$('forlength').show();</script><div class="Cell"><?php echo $this->htmlEscape($_item->getData('length')) ?></div><?php endif; ?>
<?php if($_item->getData('height')): ?><script>$('forheight').show();</script><div class="Cell"><?php echo $this->htmlEscape($_item->getData('height')) ?></div><?php endif; ?>
<?php if($_item->getData('width')): ?><script>$('forwidth').show();</script><div class="Cell"><?php echo $this->htmlEscape($_item->getData('width')) ?></div><?php endif; ?>
|improve this answer|||||
  • hi, unfortunately that did't woked for me. In both Grouped product 1 and also in Grouped product 2 , "WIDTH" is displaying. I want to display "WIDTH" and its attribute values only in GROUPED PRODUCT 2. But It's displaying also in "GROUPED PRODUCT 1". is i have to do something else? thanks in advance. – Baby in Magento Sep 1 '14 at 6:41
  • well the condition i suggested is to check, if it has value for width, then it will show the width. does it also show any value of width on group product 1 or just the heading? – MTM Sep 1 '14 at 7:45
  • firstly, sorry for delayed reply. hi, that's awesome, you just done a great job. Attribute code related issue is solved. Now only Length and height values are displying. If i have Length and Height, only Length and Height is displaying. If i have Length and Height and width, only Length and Height and width is displaying. but one small problem is there. For some grouped products, I want to display " Length and height" for another grouped product, I want to display " Depth and Width on frontend. Is there anything we can do for this. thanks in advance. – Baby in Magento Sep 2 '14 at 13:21
  • you can just use the same condition for all attributes. It will print them only if it will get the values for them – MTM Sep 2 '14 at 13:22
  • attributes are just fine, I am telling about line 116 and 117 . I want Length and height" for one grouped product, I want to display " Depth and Width" for another grouped product. how i can do this? – Baby in Magento Sep 2 '14 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.