Magento 1.9.1.0
I am new to magento. i want to display data in table after product detail. I have created table in database. I can add data from backend/admin panel side. now i want to display this data in product detail page after product. Below is attached image with data that i want to display.
if you are working with user defined module, then in frontend layout xml, you can write code like ...
<catalog_product_view>
<update handle="content"/>
<reference name="content">
<block type="tabledata/tabledata" after="-" name="tabledata" template="tabledata/tabledata.phtml" />
</reference>
</catalog_product_view>
If not using module, then go to catalog layout and override the layout file, and add the above content's section code.
you will need to create a phtml file for template, that 'll show the data. and xml used where to show the data.
Related
I'm using the following stackoverflow answer to create tags and add products to them.
https://stackoverflow.com/a/12570913/4419217
Unfortunately, the tags are just appearing in the tags tab of the product (in the backend).
They are not on the frontend product page (even after emptying all caches and reindexing) and if I "open a tag" in the backend, there are no assigned products.
How can that happen?
EDIT: I forgot to mention that I changed the code behind that link that the status is right away approved instead of pending.
You are using the RWD theme which does not include Product Tags by default. Here's how to add them to the RWD theme:
Step 1:
Copy the tags template files to your theme
Go to app/design/frontend/base/default/template/tag
Copy the entire /tag folder to:
-app/design/frontend/rwd/default/template
Note that you may have a custom package instead of 'rwd' and you should have a custom theme name instead of 'default'
Step 2:
Add the XML call to your layout
open app/design/frontend/rwd/default/layout/tag.xml change the following code from:
<!-- Remove all tags functionality from theme layout -->
to:
<catalog_product_view translate="label">
<label>Catalog Product View</label>
<!-- Mage_Tag -->
<reference name="product.info.additional">
<block type="tag/product_list" name="product_tag_list" before="-" template="tag/list.phtml">
<block type="page/html_wrapper" name="product.tag.list.list.before" as="list_before"
translate="label">
<label>Tags List Before</label>
<action method="setMayBeInvisible"><value>1</value></action>
</block>
</block>
</reference>
</catalog_product_view>
Note that you may have a custom package instead of 'rwd' and you should have a custom theme name instead of 'default'
If you don't know which package/theme you are using you can check in the admin under System->Configuration->Design(left column)->Package(tab) & Theme(tab).
You may need to flush you Magento caches to see the changes. In the admin go to System->Cache Management and flush all Magento caches. Now refresh your website and you should see the tags show up near the bottom of the page below the Upsell Products.
I have created a custom module for Magento to change some custom attributes for products.
I have added a store switcher in the page.
My problem is its coming above the header text 'custom module', i want it to be shown below that.
in my layout file, i have written this to add store switcher.
<layout>
<adminhtml_custommodule_index>
<reference name="content">
<block type="adminhtml/store_switcher" name="store_switcher"></block>
</reference>
</adminhtml_custommodule_index>
</layout>
I have not used any .phtml files.
Please help.
I've successfully installed the Fishpig module and am able to display associations between products and posts / and vice-verse.
However, I am unable to display / output the associated products with the Blog Categories.
By default they did not show. So I've added the following code to /frontend/default/theme/layout/wordpress.xml:
<wordpress_post_category_view>
<reference name="content">
<block type="wordpress/category_view" name="wordpress_category" template="wordpress/category/view.phtml">
<block type="wordpress/post_associated_products" name="wordpress_associated_products" as="associated_products" template="wordpress/post/associated/products.phtml" />
<block type="wordpress/post_list" name="wordpress_post_list" as="post_list" template="wordpress/post/list.phtml">
<block type="wordpress/post_list_pager" name="wordpress_post_list_pager" as="pager"/>
</block>
</block>
</reference>
</wordpress_post_category_view>
and I'm trying to call the block via the /frontend/default/theme/template/wordpress/category/view.phtml
<?php echo $this->getChildHtml('associated_products'); ?>
This same technique works for the Blog Posts pages, but it doesn't seem to work for Blog Categories. Any ideas ?
It isn't possible to show associations on a category page. The associations are stored in the database so you could achieve this using some custom code but by default, these associations are used to quickly associate all entities in the category.
As an example, if you associate a blog post with a Magento category, you are actually associating the blog post with all products in the Magento category.
I made my own product list page based on Mage_Catalog_Block_Product_List:
app/code/local/Mage/Catalog/Block/Product/Special.php:
class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List
{
/* Original contents */
/* Here I call addAttributeToFilter on product collection, and then... */
return $this->_productCollection;
}
I include this in a CMS page on the center column:
<reference name="content">
<block type="catalog/product_special" template="catalog/product/list.phtml" />
</reference>
The problem is: The product list shows up just fine, but I get no layered navigation in my left column.
This is quite strange, since I am using exactly the same template as normal listings.
A couple of things I have checked:
Mage_Catalog_Block_Product_Special just being a proxy class. This doesn't work. Even if I use block type "catalog/product_list" on my CMS page I will not get a layered navigation.
There are no extensions that are overriding crucial core classes.
I have also tried to create my own module and list it under for example 'mycatalog'. This results in exactly the same problem.
I have a feeling this has to do with trying to include a product listing on a CMS page but I have not been able to track down the exact problem.
Any help on this would be very much appreciated.
You need to add the Block that renders the Layers into the left column.
If you look in catalog.xml, you will see that the catalog_category_layered node includes the following:
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
...
</reference>
So, add that into your CMS xml layout update and that should display the Layer block on your CMS page.
If you have issues with the product list not being filtered when you click one of the filterable attributes, that is probably because the links rendered by the Layer_View Block assume that they are going to post back to a CategoryController, not a CmsController which will be rendering your CMS page. That may or may not be an issue, so report back here if it doesn't work and we can try to work through it.
Personally I would have a hidden category with all products in it and use a script to keep that updated to be all products. The script can be done with the API, slow yes, but it will work in a timely fashion for a certain level of SKU count.
layer navigation is include in category view.
You should include the part of navigation used by category, so try to insert
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
before
<reference name="content">
I'm not sure but if it's doesn't works it should help you to understand the problem anyway
check the following pages ( they came across the same problem )
http://www.exploremagento.com/magento/some-custom-blocks-to-help-you-show-products.php
http://www.chilipepperdesign.com/2009/03/23/magento-how-to-list-all-the-products-in-a-single-category-in-a-sidebar-block
I want the grid in admin to be displayed in frontend.
The grid that shows the list of products in admin-> catalog->manage products.
I want to show this on the frontend for each category?
What would be ideal approach to get this done?
Extending admin block classes in your module and copy widgets template files from adminhtml allowing adminhtml display in frontend, but you need to load required javascripts and CSS to allow grid works and you'd be pay attention to conflicts.
Probably it's more easy to using a thirdy part ajax grid in frontend.
You need to rewrite blocks
Mage_Adminhtml_Block_Catalog_Product_Grid
Mage_Adminhtml_Block_Widget_Container
to your own, because in this classes we have logic for editing, adding products.
also you need to redefine
adminhtml/default/default/template/catalog/product.phtml
adminhtml/default/default/template/widget/grid.phtml
and add templates to the frontend scope with your customizations.
add to the frontend catalog.xml blocks declaration for catalog_category_default node
it might be like this:
<catalog_category_default>
<reference name="content">
<block name="module_name/catalog_product_grid" template="module_name/catalog_product_grid.phtml" output="toHtml />
</reference>
</catalog_category_default>
I agree with emalstyle.
You can get the data from a collection, convert collection data to js object and implement a widget like:
https://plugins.jquery.com/tag/datagrid/