Magento missing translation - magento

This is a very simple question: What do I need to change in order to translate this?? Is it hard-coded somewhere? Inside database?
The code bellow creates this tabs and can be found at this file app\design\frontend\rwd\default\template\catalog\product\view.phtml#175:
<div class="product-collateral toggle-content tabs">
<?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<dl id="collateral-tabs" class="collateral-tabs">
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
<dd class="tab-container">
<div class="tab-content"><?php echo $html ?></div>
</dd>
<?php endforeach;?>
</dl>
<?php endif; ?>
</div>
It does not follow the $this->__('Recurring Profile') pattern. My app/locale/pt_BR/Mage_Sales.csv already have the key/value "Recurring Profiles","Perfis Recorrentes".
This is the page of a recurring profile product running in a Magento 1.9 instance.

Look up to
app/locale/pt_BR/Mage_Sales.csv
There would be something like
"Recurring Profiles","Perfiles Repetitivos"
If the file doesnt exists, copy the one from app/locale/en_US/Mage_Sales.csv and replace with your desired translations.

Thanks #scrowler. Magento is missing the proper localization method call. The code at app\design\frontend\rwd\default\template\catalog\product\view.phtml#175 should be changed to:
<div class="product-collateral toggle-content tabs">
<?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<dl id="collateral-tabs" class="collateral-tabs">
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<dt class="tab"><span><?php echo $this->escapeHtml($this->__( $this->getChildData($alias, 'title'))) ?></span></dt>
<dd class="tab-container">
<div class="tab-content"><?php echo $html ?></div>
</dd>
<?php endforeach;?>
</dl>
<?php endif; ?>
</div>
Just added the $this->__(...) and check for proper localization in .csv files.

Related

Magento removing item options in checkout order review section

In my website i have enable one page checkout.Also there are only downloadable products.
I need to remove Item options in Checkout Order Review section (Please refer below image. I need to remove highlighted parts.)
Can anyone let me know how to do this please.
Thank You.
I think you want to remove custom option in checkout.
The custom options are displayed in the default template (in \app\design\frontend\base\default\template\checkout\cart\item\default.phtml) with the following snippet:
<?php if ($_options = $this->getOptionList()):?>
<dl class="item-options">
<?php foreach ($_options as $_option) : ?>
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
<?php if (isset($_formatedOptionValue['full_view'])): ?>
<div class="truncated_full_value">
<dl class="item-options">
<dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
<dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
</dl>
</div>
<?php endif; ?>
</dd>
<?php endforeach; ?>
</dl>
<?php endif;?>
So, you comment this or remove as per your convenience.
But in your case you are using onepage checkout So, you have to check this code in extensions phtml file.
You need to go in app\design\frontend\rwd\default\template\downloadable\checkout\onepage\review\item.phtml
Open item.phtml file
And in this file here is code what is displaying that
<?php if ($links = $this->getLinks()): ?>
<dl class="item-options">
<dt><?php echo $this->getLinksTitle() ?></dt>
<?php foreach ($links as $link): ?>
<dd><?php echo $this->escapeHtml($link->getTitle()); ?></dd>
<?php endforeach; ?>
</dl>
<?php endif; ?>
So you can remove or just comment this <!--<dl>...</dl>--> and you will get you want.
And yes go to your theme folder if your is not rwd.

Why my add a review/be the first one to review is not showing in product/view.phtml page in magento?

<div class="product-collateral toggle-content tabs">
<?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<dl id="collateral-tabs" class="collateral-tabs">
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<dt class="tab"><span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span></dt>
<dd class="tab-container">
<div class="tab-content"><?php echo $html ?></div>
</dd>
<?php endforeach;?>
</dl>
<?php endif; ?>
</div>
I have used the bellow code in the default theme then its showing but in my theme its not... can't find out why ?
<?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<?php echo count($detailedInfoGroup); ?>
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<?php endforeach;?>
<span><?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?></span>
<?php echo $html ?>
<?php endif; ?>
for the above code the last one that is reviews is showing...but not in my theme.
Its working fine on base theme ('default') .... but when my theme is activated Its showing fatal error on the same link.
Go to your admin section then under catalog => Review and rating => Manage ratings
Then select store id for every record then it will show on your product page.

Adding Short Description to Long Description Tab in Magento 1.9

I currently have my short description being called in view.phtml
<?php if ($_product->getShortDescription()):?>
<div class="short-description">
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
</div>
<?php endif;?>
I'd like to add this to my long description (which is currently being called by description.phtml).
I've tried adding this bit of code to the description.phtml
<?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
However, when I do that the tabs disappear altogether. Is there a way to possibly merge the short and long description in Magento, or just a way to add the short description into the description tab without it breaking?
You need to add the following code to get short_description value in description.phtml
<?php $_short_description = $this->getProduct()->getShortDescription();?>
Then add this
<?php if ($_short_description): ?>
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_short_description, 'short_description') ?>
</div>
<?php endif; ?>
copy core file form this url app/design/frontend/base/default/template/catalog/product/view/description.phtml to app/design/frontend/yourtheme/default/template/catalog/product/view/description.phtml
if you want to combine short and log description togather then try below code
<?php $_description = $this->getProduct()->getDescription(); ?>
<?php $_short_description = $this->getProduct()->getShortDescription(); ?>
<?php if ($_description && $_short_description): ?>
<h2><?php echo $this->__('Details') ?></h2>
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description')." ".$this->helper('catalog/output')->productAttribute($this->getProduct(), $_short_description, 'shortDescription') ?>
</div>
<?php elseif($_description) : ?>
<h2><?php echo $this->__('Details') ?></h2>
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description');?>
</div>
<?php endif; ?>
if you just want to place short then remove long description code from above
Hope this will help you out
Thanks

magento show tab if content exists

i'm using the tab.phtml from the modern theme to create product tabs, however i've switched this to using jquery and jquery-ui as i needed to link to a tab directly.
So in a nut shell the code is pretty much the same as the one found in the modern theme.
<div id="tabs">
<ul>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<li class="<?php echo !$_index?' active first':(($_index==count($this->getTabs())-1)?' last':'')?>"><?php echo $_tab['title']?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clearer"></div>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<div class="product-tabs-content" id="<?php echo $_tab['alias'] ?>"><?php echo $this->getChildHtml($_tab['alias']) ?></div>
<?php endif; ?>
<?php endforeach; ?>
</div>
and i'm adding the custom tabs using the same method under catalog.xml:
<action method="addTab" translate="title" module="catalog"><alias>how-to-use</alias><title>How to Use</title><block>catalog/product_view</block><template>catalog/product/view/how-to-use.phtml</template></action>
however i've noticed that the tab 'upsells' only appears when there are upsell products assigned. I'm wanting to use this same functionality to display a custom product attribute if there is content to display.
So what i'm asking is how does the upsell detect that there are no products assigned so no tab is displayed so i can do this for my custom tab. my custom tab phtml file looks like this:
<?php $_howtouse = $this->getProduct()->getHowToUse(); ?>
<?php if ($_howtouse): ?>
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_howtouse, 'howtouse') ?>
</div>
any help greaty received thanks :)
The first line of code in upsell.phtml controls the appearance:
<?php if(count($this->getItemCollection()->getItems())): ?>
I am speculating your code is simply evaluating to true and always showing that section. What is your output from $this->getProduct()->getHowToUse() ?
It turned out i had 1 line above my:
<?php $_howtouse = $this->getProduct()->getHowToUse(); ?>
which meant it registered as there being some content all be it white space.
got rid of the whitespace it now works.

Magento Add url link to open a specific product tab

Magento 1.7.0.0
ok i'm using the product tabs that are available in the modern theme. I've added a custom tab to add reviews as a tab [sucess].
Now where it says:
'Be the first to review this product'
i want this link to go to the tab on that page and not go off to the reviews page.
i realise i need to some javascript but it's just i can't work out how to call a tab.
any ideas?
thanks.
Andy.
if you already using jQuery... you could just simply "hack" it out like this
jQuery(document).ready(function($){
$("#addreview").attr("href", "#review-form");
$("#addreview").click(function(){
$(".product-tabs").children("li").removeClass("active");
$("#product_tabs_reviews").addClass("active");
$(".product-tabs-content").css("display", "none");
$("#product_tabs_reviews_contents").css("display", "block");
});
});
be aware to change the selector according to your own markup
My code looks like this in tabs.phtml:
<div id="tabs">
<ul>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<li class="<?php echo !$_index?' active first':(($_index==count($this->getTabs())-1)?' last':'')?>"><?php echo $_tab['title']?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clearer"></div>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
<?php if($this->getChildHtml($_tab['alias'])): ?>
<div class="product-tabs-content" id="<?php echo $_tab['alias'] ?>"><?php echo $this->getChildHtml($_tab['alias']) ?></div>
<?php endif; ?>
<?php endforeach; ?>
</div>
and then adding:
jquery-ui-tabs.js and the relevant .css

Resources