In my Magento admin I want to modify the display of ordered items in an order.
I found that the table is in design/adminhtml/default/default/template/sales/order/view/items.phtml
and the data in design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml
I need to add some data in the first column : product.
I found that this following code build the HTML : (line 68 of default.phtml in Magento 1.4)
<?php echo $this->getColumnHtml($_item, 'name') ?>
I searched a lot to find where the html is build but I can't find.
Found it :
app/design/adminhtml/default/default/template/sales/items/column/name.phtml
Cheers.
Related
I need some tips to use product list functionality in my cms pages.
like in my cms page named "manufacture = apple" should show all products of apple manufacture .
same for other attribute like color, size etc .....
Thanks.
You need to create small module. I can't share complete code here, but sharing you a helpful link which I have earlier used and working fine.
Link:https://www.atwix.com/magento/products-list-cms/
Hope it will helpful!
create a template (test.phtml) under yourtheme/catalog/product and add the following code to your test.phtml
<?php
$arrParams = array_slice($this->getRequest()->getParams(),1);
$attribute = each($arrParams);
$collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter($attribute[0],$attribute[1]);
echo '<pre>';
print_r($collection->getData());
exit;
?>
than call this template to your cms page. Add the code below in content area of your cms page.
{{block type="catalog/product" template="catalog/product/test.phtml"}}
once you have the array of product than display it as per your requirement.
I add an attribute type Yes/No is_special to product.
(I want to just logged user can see special products.)
Then, I open some products and set to Yes But when I show it on front end, All is No.
I clear cache and reindex before. But It still No
Please help me guys. I am very grateful to You...!!
Thanks In Advance...!!
When attributes are added, they are added to the database and magento caches the calls to certain databases. Try deleting your cache folder in var/cache and see if that helps.
When you create a new product attribute, you have a lot of options, a few changing the loading bahavious "Show in product listing" sets the collection to load this on the category pages, "Visible on Product View Page on Front-end" loads the attribute on the product view page.
First you need to add featured/special product attribute to magento. Please refer my tutorial which explains how to add yes/no attribute.
http://www.pearlbells.co.uk/adding-custom-product-attributes-in-magento/
Then you filter the featured products using the code in phtml.
<?php
$featuredProducts = Mage::getModel('catalog/category')->load($category_id)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('featured_product', 1)
->addAttributeToFilter('status', 1);
?>
I want to remove product from wishlist in product listing page(default/template/wishlist/item/column/image.php).
I have seen the remove url function in wishlist page $this->getItemRemoveUrl($item) . but it doesn’t work in image.php.
Even i tried,
echo Mage::helper(‘wishlist’)->getRemoveUrl($_product)
it gives URL but not showing parameters.
eg:-
domain.com/wishlist/index/remove (not working)
domain.com/wishlist/index/remove/item/3 (actual)
So how can i solve this
this function should work for you
Mage::helper('wishlist')->getRemoveUrl($_product)
Please compare your xml file with the magento default xml file
May be there is any function missing or commented
Also there is another possibility or error
in
helper('wishlist')->getRemoveUrl($_product)
may be $_product contains additional white spaces or symbols
please check it
Using the getModel you can delete the wishlist product
as below
Mage::getModel('wishlist/item')->load($id)->delete();
On the customers side the wishlist only displays 3 products, is there a way to display all of their products in their wishlist like in the admin? We are using Magento 1.6.
I assume you're referring to the sidebar wishlist, as the wishlist on the customer dashboard doesn't appear to have a limit.
On line 46 of app/code/core/Mage/Wishlist/Block/Sidebar.php you'll see the following line:
->setPageSize(3)
If you want to remove the limit entirely, comment out this line. Otherwise change the number on this line to whatever you'd like the new limit to be.
Note: I strongly recommend not changing the core file if you intend upgrading Magento in future. You can override the core version of the block by copying it to app/code/local/Mage/Wishlist/Block/Sidebar.php. Another, more future-proof alternative would be to create a block that inherits from this class in a custom extension and alter the layout files accordingly.
Go to wishlist/sidebar.phtml and add 'setPageSize(20)'
<?php foreach ($this->getWishlistItems()->setPageSize(20) as $_item): ?>
I am trying to display each products description in the category list view like this:
<?php echo $_product->getDescription(); ?>
However, it just displays nothing. Since this works perfectly on the product page I am not quite sure where the problem is. How do I do this?
Try this
Go to backend
Catalog->Attributes->Manage Attributes
Search for "short description" -> set "Used in Product Listing" to "Yes"
Refresh cache and Reindex
I did this for a custom attribute and I see no reason why this should not work for description/short description
Update the description attribute's use_in_product_listing value (see catalog_eav_attribute table), either in the admin under Catalog > Manage Attributes or use an upgrade script.
The upgrade script would need to use the correct setup resource and call the following:
$installer->updateAttribute('catalog_product','description','use_in_product_listing',1);
Try this,i have used this
<?php echo $_product->_data['short_description']; ?>