0

I have two variations in my website color and size. I have added it to my "Default Attribute Set" and updated respective color and size for each product.

But now i need to display the color and size option in a drop down box, and when user selects it and adds the product to cart. It should appear in the shopping cart along with product information and in the entire checkout process.

is there any option in backend to enable this? or should i do this by modifying the code?

if i should do it by modify the code, how do i do it?

(I learnt ways to show the attribtues in drop down in product page through the link is it possible to show custom attributes of associated products under a grouped product in front end? (Magento), but not sure with showing them in cart page)

please suggest.

Thanks,

Balan

4
  • Are you looking to just show selected attribute or you want to edit in shopping cart page.
    – Gowri
    Mar 15, 2012 at 8:33
  • i want to show the selected attributes of a product in shopping cart..
    – balanv
    Mar 15, 2012 at 8:47
  • This will normally work with Magento default.What product type you are using
    – Gowri
    Mar 15, 2012 at 9:34
  • I am using only simple products. In my case, i just need the color and size drop down to appear in the product page and based on the selection it should appear in shopping cart.. i know i could use Custom options under each simple product.. but not sure if thats correct.. so i am trying to add color and size to attribute set.. and show it in product page.. (Note : There will be no price change when user selects any of the option)
    – balanv
    Mar 15, 2012 at 10:02

2 Answers 2

0

Add below code in your catalog/product/view.phtml page.That will bring the custom options to your product page.

   if ($_product->isSaleable() && $this->hasOptions()):
        echo $this->getChildChildHtml('container1', '', true, true) 
   endif;       

    if ($_product->isSaleable() && $this->hasOptions()):
      echo $this->getChildChildHtml('container2', '', true, true) 
    endif;

Shopping cart

check you checkout.xml for addItemRender methods are added or not in checkout.cart block.

 <checkout_cart_index translate="label">
  <reference name="content">
     <block type="checkout/cart" name="checkout.cart">
....
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/item/default.phtml</template></action>
                <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/item/default.phtml</template></action>
...
     </block>
  </reference>

and check template files is it called correctly or not.

Check with magento default is your blocks are called correctly in cart.phtml and other pages

3
  • actually i achieved bringing custom options to product page... but stuck with showing selected attribute in the shopping cart and entire checkout process.. do i have to customize it fully to do this?
    – balanv
    Mar 16, 2012 at 6:35
  • the code added in view.phtml throws an error like Parse error: syntax error, unexpected $end in /home/content/16/8165716/html/dev/app/design/frontend/default/boho/template/catalog/product/view.phtml on line 223
    – balanv
    Mar 16, 2012 at 9:46
  • Check your opening and closing tags
    – Gowri
    Mar 16, 2012 at 9:55
0

balanv, Use "Configurable" products. It will provide you dropdown with colors on product page And will display selected colors in checkout cart. Read magento wiki for more details ;)

1
  • Welcome to magento logic. Anyway its much easier then customizing existing logic.
    – Sergey
    Mar 17, 2012 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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