Magento product overview and detail separated view - magento

I want to handle the product overivew separataly to the product detail view. I want to add additional text right behind the price in the product deatil view.
I tried to edit the view.phtml in path app/design/frontend/mytheme/default/template/catalog/product/view.phtml, refreshed caches and so on, but nothing changed.
In catalog.xml view.phtml will be load. So its seems correct.
But even when I try to echo "test" it doesnt show anything.
<?php if ($_product->getShortDescription()):?>
<div class="short-description">
<div class="std"><h2><?php echo $this->__('Details:') ?></h2>
</div>
</div>
<?php echo "test";
endif;?>
Do you have any hint?
Regards
Matt

You should enable template path hints in the backend to check which template file is used to render product page. Make sure that the cache is also disabled.

Related

Magenot Remove Sort by and Show per page from toolbar

How to remove completely Sort By and Show per page from toolbar on product listing with grid view in Magento 1.9.1.0. I have only a few products on my shop so now I don't need sorting and showing functions. What file should I edit and how to change code in this file.
If you want to completely remove the toolbar from the product listing page, you can go to the list.phtml file located at below location :
app/design/frontend/rwd/default/template/catalog/product/list.phtml and comment the below lines
1) <?php //echo $this->getToolbarHtml() ?>
2) <?php /*<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ?>
</div> */ ?>
My advice would be to copy the list.phtml into your local.

How to add custom text in front of price in the cart page?

I want to add some custom text in front of the price in the Magento cart page as shown in the image.
I found the following lines in the app\design\frontend\mydesign\default\template\checkout\cart.phtml
There is following code
<tbody>
<?php foreach($this->getItems() as $_item): ?>
<?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>
</tbody>
But how to edit this and in which file I am not getting.
Please help.
$this->getItemHtml($_item) actually loads the template file app\design\frontend\base\default\template\checkout\cart\item\default.phtml. So just copy it from base theme folder to your theme folder and modify it. The text "AUD" can be added to the <td> cell that displays the product price.
If you want to add "AUD" everywhere a price is displayed, you can go to admin and change currency symbols under System -> Manage Currency -> Symbols
when you are beginner of magento and active theme package is "rwd"
than you find product details of "<'tbody'>" on shopping cart page is below path:
C:\wamp\www\magento\app\design\frontend\rwd\default\template\checkout\cart\item\default.phtml

How do I manually theme Views in Drupal 7?

I am new to drupal and I am trying to figure out how to theme Views. I currently have a content type called Category with the following fields:Title, Image and Body. I created a view for the above mentioned content type so that I would list view of all the categories I have created.
To custom theme the view I created a folder called views in my theme folder, and created the following view files:
views-view-fields--plugin-categories.tpl.php
views-view--plugin-categories.tpl.php
views-view-unformatted--plugin-categories.tpl.php
This is what I currently have in my first file:
<div class="<?php print $classes; ?>">
<?php if ($rows): ?>
<div class="view-content">
<?php print $rows; ?>
</div>
<?php elseif ($empty): ?>
<div class="view-empty">
<?php print $empty; ?>
</div>
<?php endif; ?>
<?php if ($more): ?>
<?php print $more; ?>
<?php endif; ?>
</div><?php /* class view */ ?>
Instead of $rows, I tired to use print $field['image'] and print $field['body'] but this method does seem to work. Could you kindly advise on how I could theme the three fields, within categories, displayed using view?
You should name your template like this
views-view-fields--<machine-name-of-your-view>.tpl.php
So I'm assuming from the above that your view is called 'plugin-categories'. An easy way to check is to go to edit the view and look at the URL while you're on the edit page. It should have the format /admin/structure/views/view/YOUR-VIEW'S-MACHINE-NAME/edit, so you can get it from there.
Once you're sure it has the right name, clear your cache to make sure Drupal is picking up your new template. You just need the one above, not all three to modify the output of the three fields in question.
Once you've cleared cache, Drupal should be picking up the new template. You didn't mention exactly what isn't working, just that it's not working, so I wanted to cover the naming and caching, just in case. Now, to output particular fields in this view template, call them like this:
$fields['your-field-machine-name']
So $fields['body'] (I think you're missing an 's')
You should have nothing about $rows in this template! If you have anything about $rows, you haven't copied and pasted from the correct views template. Simply output the fields as you want them to appear in your view, in whatever order you want with the syntax above and put in whatever css classes, etc you want.
Let us know if that works!

How to echo out Magento meta tags in theme files

I have a client that is requesting independent H1 tags which can be different to the auto generated page titles in Magento, i.e usually these would be category names, page titles, product titles etc.
As there is no field for this in Magento backend I thought the best way to overide would be if the user puts the custom H1 in the meta tags field and then I pull that data in the theme files if it exists or show standard title if not.
So for instance in:
/app/design/frontend/base/default/template/catalog/category/view.phtml
We have:
<h1><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1>
My idea was to use the default meta keyword head tags and have something like this:
If this is not empty show it
<?php echo htmlspecialchars($this->getKeywords()) ?>
else show default title
<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>
Problem is the <?php echo htmlspecialchars($this->getKeywords()) ?> does not show anything when placed outside of its defult head.phtml template.
Anyone have any ideas how to get the meta keywords in any theme file in Magneto?
Magento ver. 1.4.1.1
Thanks!
Try using the following:
$keyWords = Mage::getStoreConfig('design/head/default_keywords')
This will ensure that the keywords are loaded. If you review app/code/core/Mage/Page/Block/Html/Head.php, you'll find that the function getKeywords() renders the same result (be it with caching the keywords).

Where can we modify the default links of the footer in Magento?

I want to get rid of the links in the footer of my website, someone started the dev of that website and left, now I can't modify it, because when I'm in the footer.phtml i can see that code :
<!-- Footer -->
<div id="footer">
<ul>
<li><?php echo $this->getCopyright(); ?></li>
</ul>
<?php echo Mage::getModel('core/variable')->loadByCode('footer_navigation')->getValue('html'); ?>
<div class="cl"> </div>
</div>
<!-- /Footer -->
I can't find the place where that class is looking for the links Mage::getModel('core/variable')->loadByCode('footer_navigation')->getValue('html')
I've been looking in catalog.xml where I found <reference name="footer_links"> but if I delet the code inside, nothing happen, it doesn't seem to be linked in any way with that.
I got the same problem in my menu where I see that class I don't understand : $categories = $this->renderCategoriesMenuHtmlCustom2(0, 'level-top'); Where does that refer too ?
Thanks :)
Login to your admin panel and go to System->Custom Variables. You should find the footer links there. You can remove the links through here (by deleting the HTML and plain-text fields), or by taking out the piece of code that loads the footer links variable (the line that calls loadByCode('footer_navigation')).
You can also delete the variable through the admin panel, but if you do this, you should also remove the code that calls it; it won't crash, but it can lead to confusion down the road.

Resources