No able to change some word in English version of my site - view

I've an e-commerce site in Magento 1.9 with two version: English and French. I've to change some words in both English version and in the French. For example, in the English version, I've to change word "BAG" in the homepage menu.
I've to replace "BAG" with "SHOPPING BAG" but, inserting string "BAG", "SHOPPING BAG" (or "bag","shopping bag", or "Bag", "Shopping bag") into translate.csv of the theme (in the English folder) any change is shown in the frontend. Activating path hints for the English version I notice that the phtml file that builds the block that contains this menu is the following:
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle()?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
if (preg_match('/^https/', $currentUrl)) {
$currentUrl = str_replace('https://', 'http://', $currentUrl);
}
$exclusions = array(
'checkout/',
'customer/account/'
);
$regexUrl = '/^' . str_replace(array('/', '.'), array('\\/', '\\.'), Mage::getBaseUrl() . '(?:(?:' . implode(')|(?:', $exclusions) . '))') . '/';
if (!preg_match($regexUrl, $currentUrl)) {
echo '<link rel="canonical" href="' . $currentUrl . '" />';
}
?>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->getIncludes() ?>
I think that there are some function (may be getHtmlChild()) that overwrites my translation because other words are translated adding new strings into traslate.csv.
Which file or function I've to change to see "shopping bag" in the frontend of my site? Why some words are changed with translate.csv and others not? Can you help me, please? Thank you very much!

First, all strings in the translation files are casesensitive.
When I look for a word to translate for example "add to my cart" then I usually do like this:
Open a terminal and go to the root of your magento shop and run:
cd app
git grep "add to my cart" | grep csv
This gets all the hits from all your translation files in your entire project.
My result looks like this:
design/frontend/fortis/eke/locale/sv_SE/translate.csv:1:"Add to Cart","add to my cart"
locale/sv_SE/Mage_Catalog.csv:33:"Add to Cart","add to my cart"
In the result, first you se the path to the file and then the translation.
In my example the string was already translated. But now you know exactly what the base string is. Use this in you own translation file.
If you don´t get a hit in the translation files then the word or sentence might come from a cms-block or cms-page. To search for it there you have to connect to your SQL server and run some querys like this (one at the time):
select * from cms_block where content like '%add to my cart%';
select * from cms_page where content like '%add to my cart%';
From the result you can see what the block or page with the string is named. Go the backend and edit it.

Related

When I share post viva whatsapp share button in codeigniter postted image not showing like thumlin and we image fetch form database

When I share post viva whatsapp share button in codeigniter postted image not showing like thumlin and we image fetch form database
and also I see view source to image name showing proparlly
View Source
<meta property="og:image:secure_url" content="htttp://statenews.co.in/images/product_images/1000raj.jpg" />
View
Head Meta tag
<meta name="description" content="The Fatest News Channel">
<meta property="og:title" content="StateNews ! Hosla Sach Karne Ka..">
<meta property="og:type" content="article">
<meta property="og:site_name" content="News">
<meta property="og:url" content="<?php echo base_url(); ?>" />
<?php $file=base_url()."homeassets/images/".$product_images->image;
if(file_exists($file)){
?>
<meta property="og:image" content="<?php echo base_url(); ?>images/product_images/<?php echo $product_images->image; ?>" />
<?php
}else{
?>
<meta property="og:image" content="<?php echo base_url(); ?>images/product_images/<?php echo $product_images->image; ?>" />
<?php
}
?>
Whatsapp Button
<li style="background: #71b733;">
<a href="https://api.whatsapp.com/send?text=<?php echo base_url() . $_SERVER['REQUEST_URI']; ?>" data-link="<?php echo base_url() . $_SERVER['REQUEST_URI']; ?>" target="_blank" style="color:inherit;">
<i class="fa fa-whatsapp"></i>
</a>
</li>
Controller
$data['products'] = $this->User_model->get_all_data_by2('products','product_images','product_id','master','Common',base_url(),'added_at','DESC',10);
$this->load->view('include/header',$data);
$this->load->view('home',$data);
$this->load->view('include/footer',$data);
Model
function get_all_data_by2($table1='',$table2='',$colum1='',$colum='',$value='',$value2='',$color='',$ord='',$limit=''){
if((!empty($value)) && (!empty($colum))) {
$this->db->where($colum, $value);
}
if(!empty($value2)){
$this->db->or_where($colum, $value2);
}
if((!empty($ord)) && (!empty($color))){
$this->db->order_by($color,$ord);
}
if(!empty($limit)){
$this->db->limit($limit);
}
$query = $this->db->select('*')
->from($table1)
->join($table2, "$table2.$colum1 = $table1.$colum1")
->get();
return $query->result();
}

Why the header and footer comes after body when rendered? (Processwire)

Why the header and footer comes after body when rendered? (Planets Tutorial). The planets who are using the planet.php template are children of a page Planets which is based on basic-page.php template. The About page children pages works fine though.
site/templates/planet.php
<html>
<head>
<title><?php echo $page->title; ?></title>
</head>
<body>
<h1><?php echo $page->title; ?></h1>
<h2>
Type: <?php echo $page->planet_type; ?>,
Age: <?php echo $page->planet_age; ?> years
</h2>
<p><?php echo $page->planet_summary; ?></p>
</body>
</html>
Doing a manual intermediate install solved it.

Enable Demographics and Interests reports in Universal Analytics - Magento missing code

I am trying too Enable Demographics and Interests reports in Universal Analytics in my Magento site.
I have read through the already existing question on this and it does not answer my problem: Enable Demographics and Interests reports in Universal Analytics
I already have Universal Analytics set for my Magento site, which was done by simply entering my Google Analytics Account Number in the Magento Backend. It has been working fine for the last few months but I now want to Enable Demographics and Interests reports.
Google Analytics tells me "Your Demographics and Interest Reports have been enabled, but your Analytics tracking code does not include the necessary support to show them", and directs me to the following information page: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
It tells me to simply add the following code into the existing tracking code:
ga('require', 'displayfeatures');
I found out that this code should be located at:
app/design/frontend/default/YOURTHEME/template/page/html/head.phtml
However when I open this file, the only code in it is as follows:
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle() ?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<?php if(Mage::getStoreConfig('milanoconfig/generaloptions/responsive') == 1): ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php endif; ?>
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
From what I have read, this file should also include the following Google Analytics code, but it doesn't:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXX-XX', 'example.com');
ga('send', 'pageview');
</script>
Does anyone know why this code isn't currently in this file even though my Google Analytics appears to be working fine, after simply adding the Google Analytics Account Number in the Magento Backend?
Does anyone also know what I should now do to Enable the Demographics and Interests reports. Should I simply add this code manually, or is there a reason why this code isn't already in place, maybe Magento is set up differently these days? I use Magento version 1.7.0.2.
Thanks

My Nestedsortable is not working, because of cannot call the javascript file

Iam using CI version 2.1.2
iam following course by tutplus training
this problem is a when i call the javascript file that's not working properly
iam very counfused day to day iam thingking how make it solved, buat iam cannot
here the script of my page_head file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo $meta_title; ?></title>
<!-- Bootstrap -->
<link href="<?php echo site_url('css/bootstrap.min.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('css/admin.css'); ?>" rel="stylesheet">
<link href="<?php echo site_url('css/datepicker.css'); ?>" rel="stylesheet">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="<?php echo site_url('js/bootstrap.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo site_url('js/bootstrap-datepicker.js'); ?>"></script>
<?php if(isset($sortable) && $sortable === TRUE): ?>
<script src="<?php echo site_url('js/jquery-ui-1.9.1.custom.min.js'); ?>"></script>
<script src="<?php echo site_url('js/jquery.mjs.nestedSortable.js'); ?>"></script>
<?php endif; ?>
Please Somebody help me, please make it file .js working
Use base_url instead of site_url.
For example, replace this...
<script src="<?php echo site_url('js/bootstrap.min.js'); ?>"></script>
...with this...
<script src="<?php echo base_url('js/bootstrap.min.js'); ?>"></script>
Do this for all link and script tag declarations in your head.
From the Codeigniter documentation:
site_url(): Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, and the url_suffix as set in your config file.
base_url(): Returns your site base URL, as specified in your config file. (...) This function returns the same thing as site_url, without the index_page or url_suffix being appended.

Wordpress header imgage won't display in IE

Image in header displays in Safari, FFX and Opera, but not in IE (on 9, btw).
Not sure if this matters, but when using IE's developer tools, it shows "Empty Text Node" all over the place.
I don't even know what other code to attach to this post...let me know.
site url: http://glassinfusion.accountsupport.com/
Header Code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<?php if (is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for ""); echo '" - '; }
elseif (is_archive()) {
wp_title(''); echo ' Archive - '; }
elseif (is_search()) {
echo 'Search for "'.wp_specialchars($s).'" - '; }
elseif (!(is_404()) && (is_single()) || (is_page())) {
wp_title(''); echo ' - '; }
elseif (is_404()) {
echo 'Not Found - '; }
if (is_home()) {
bloginfo('name'); echo ' - '; bloginfo('description'); }
else {
bloginfo('name'); }
if ($paged>1) {
echo ' - page '. $paged; }
?>
</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<link rel="icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />
<?php if ( is_singular() ) wp_enqueue_script('comment-reply'); ?>
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="header">
<!-- start logo -->
<h1><a href="<?php echo get_option('home'); ?>/"><span><?php bloginfo('name'); ?></span>
<img src="<?php bloginfo('template_directory'); ?>/images/logo3.jpg" width="" height=""alt="<?php bloginfo('name'); ?>"/>
</a></h1>
<!-- End Logo -->
<?php
/* A sidebar on top of the content? Yep. You can can customize
* your top with three columns of widgets.
*/
get_sidebar('navigation');
?>
</div><!--end header -->
<!-- start middle -->
<div id="middle">
Try with different format image like gif instead of jpg in the case of those images which are not displaying.

Resources