Hi out there! =)
I’m Panne from germany and very new to Magento and it’s community - of course, I hope to become an expert in a pretty short time…
But at this point, I have a big problem implementing some features in a Magento modul:
I have to get some attributes to be shown in the product list, and also in the shopping cart. I spend much time searching for a proper solution here in this forum, and found many threads about how to add attributes to the product list, but that’s all different from my own problem…
Most information I found in this thread, and showing the (also custom) attributes from the database seems to be no problem. So I tried to get things work with the same scheme, but in the shopping cart - adding to app/design/frontend/myshop/default/layout/checkout.xml the following lines:
<block type="checkout/cart" name="checkout.cart">
<!-- edit panne: more attributes to the cart -->
<!-- end edit panne -->
But, the data for my_attribute isn’t in the database, it’s filled in by a customer while he’s searching my shop.
For an example let’s use the T-shirt shop:
say, the customer can type in some text on my shop to print on a shirt, can choose font, fontcolor, color of shirt and so on.
Adding colors and fonts as configurable products should be no problem, but: how could I get a free text field working best, and take it’s data through the whole shopping process with my customer to the cart?
And how to add these attributes to the cart, to be shown with the product?
I also edited the app/design/frontend/myshop/default/template/checkout/cart.phtml, to change the cart table of products to get new columns, for example I added the following line after line 65 (same code, just other text to be shown):
<th rowspan="<?php echo $mergedCells; ?>"><?php echo $this->__('T-Shirt Text') ?></th>
This adds the new table header column - but how do i add the table data?
Do I have to change (or overload) the getItems() and/or the getItemsHtml($_item) methods, and if so, where do I find them?
Or is something wrong with my configs in the .../layout/checkout.xml? (and when these are corrected, should the data be shown without more changes?)
I want to do this within Magento’s rules of programming - but I’m not sure, how it’s the right way… =/
(And also I’m not sure, if all my changes are the correct ones!)
Which more files do I have to edit (and what functions or configs are required there)?
Would be happy about any hints, links to read more information, and of course I’ll be very happy about exact instructions to do this.
thanx a lot for any help!