Page 1 of 1

Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Tue Dec 23, 2014 4:51 pm
by eccolo
Hi there,

I just upgraded my Opencart and I goe an error, everything works fine in my back-end but when I try to go on my website I got this error:

Code: Select all

Notice: Undefined property: Loader::$config in /home/uw34wni0/domains/iritis.joomlafree.it/public_html/catalog/view/theme/lexus_superstore/template/common/footer.tpl on line 10
this is my footer.tpl

Code: Select all

<?php 
	/******************************************************
	 * @package Pav Megamenu module for Opencart 1.5.x
	 * @version 1.1
	 * @author http://www.pavothemes.com
	 * @copyright	Copyright (C) Feb 2013 PavoThemes.com <@emai:pavothemes@gmail.com>.All rights reserved.
	 * @license		GNU General Public License version 2
	*******************************************************/

	require_once( DIR_TEMPLATE.$this->config->get('config_template')."/development/libs/framework.php" );
	$themeConfig = (array)$this->config->get('themecontrol');
	$themeName =  $this->config->get('config_template');
	$helper = ThemeControlHelper::getInstance( $this->registry, $themeName );
	$LANGUAGE_ID = $this->config->get( 'config_language_id' );  
?>
</section>





<?php
/**
 * Promotion modules
 * $ospans allow overrides width of columns base on thiers indexs. format array( 1=> 3 )[value from 1->12]
 */
$modules = $helper->getModulesByPosition( 'promotion' ); 
$ospans = array(1=>6,2=>6);

if( count($modules) ){
$cols = isset($config['block_promotion'])&& $config['block_promotion']?(int)$config['block_promotion']:count($modules);	
$class = $helper->calculateSpans( $ospans, $cols );
?>
<section class="pav-promotion" id="pav-promotion">
	<div class="container">
		<?php $j=1;foreach ($modules as $i =>  $module) {?>
		<?php if( $i++%$cols == 0 || count($modules)==1 ){  $j=1;?><div class="row"><?php } ?>	
		<div class="<?php echo $class[$j];?>"><?php echo $module; ?></div>
		<?php if( $i%$cols == 0 || $i==count($modules) ){ ?></div><?php } ?>	
		<?php  $j++;  } ?>
	</div>	
</section>
<?php } ?>





<?php
	/**
	 * Footer Top Position
	 * $ospans allow overrides width of columns base on thiers indexs. format array( 1=> 3 )[value from 1->12]
	 */
	$modules = $helper->getModulesByPosition( 'mass_bottom' ); 
	$ospans = array();
	$cols   = 1;
	if( count($modules) ) { 
?>
<section id="pav-mass-bottom">
	<div class="container">
		<?php $j=1;foreach ($modules as $i =>  $module) {   ?>
			<?php if( $i++%$cols == 0 || count($modules)==1 ){  $j=1;?><div class="row"><?php } ?>	
			<div class="col-lg-<?php echo floor(12/$cols);?> col-sm-<?php echo floor(12/$cols);?> col-md-12 col-xs-12"><?php echo $module; ?></div>
			<?php if( $i%$cols == 0 || $i==count($modules) ){ ?></div><?php } ?>	
		<?php  $j++;  } ?>
	</div>	
</section>
<?php } ?>




<footer id="footer">
	<?php
	/**
	 * Footer Top Position
	 * $ospans allow overrides width of columns base on thiers indexs. format array( 1=> 3 )[value from 1->12]
	 */
	$modules = $helper->getModulesByPosition( 'footer_top' ); 
	$ospans = array(1=>8,2=>4);
	
	if( count($modules) ){
	$cols = isset($themeConfig['block_footer_top'])&& $themeConfig['block_footer_top']?(int)$themeConfig['block_footer_top']:count($modules);
	//if( $cols < count($modules) ){ $cols = count($modules); }
	$class = $helper->calculateSpans( $ospans, $cols );
	?>
	<div class="footer-top">			
		<div class="container">
			<div class="custom">
				<?php $j=1;foreach ($modules as $i =>  $module) {   ?>
					<?php if( $i++%$cols == 0 || count($modules)==1 ){  $j=1;?><div class="row"><?php } ?>	
					<div class="<?php echo $class[$j];?> col-sm-12 col-xs-12"><?php echo $module; ?></div>
					<?php if( $i%$cols == 0 || $i==count($modules) ){ ?></div><?php } ?>	
				<?php  $j++;  } ?>
			</div>
		</div>		
	</div>
	<?php } ?>
	<?php
	/**
	 * Footer Center Position
	 * $ospans allow overrides width of columns base on thiers indexs. format array( 1=> 3 )[value from 1->12]
	 */
	$modules = $helper->getModulesByPosition( 'footer_center' ); 
	$ospans = array(1=>3,2=>3,3=>3,4=>3,5=>3);
	
	if( count($modules) ){
	$cols = isset($themeConfig['block_footer_center'])&& $themeConfig['block_footer_center']?(int)$themeConfig['block_footer_center']:count($modules);
	$class = $helper->calculateSpans( $ospans, $cols );
	?>
	<div class="footer-center">
		<div class="container">
		<?php $j=1;foreach ($modules as $i =>  $module) {  ?>
				<?php if( $i++%$cols == 0 || count($modules)==1 ){  $j=1;?><div class="row"><?php } ?>	
				<div class="<?php echo $class[$j];?> col-sm-6 col-xs-12"><?php echo $module; ?></div>
				<?php if( $i%$cols == 0 || $i==count($modules) ){ ?></div><?php } ?>	
		<?php  $j++;  } ?>	
		</div>
	</div>
<?php } elseif((isset($themeConfig['enable_footer_center'])&&$themeConfig['enable_footer_center'])) { ?>
<div class="footer-center">
		<div class="container">
			<div class="row">			
					
			<?php if ($informations) { ?>
			<div class="column col-xs-12 col-sm-6 col-lg-3 col-md-3">
				<div class="box info">
					<div class="box-heading"><span><?php echo $text_information; ?></span></div>
					<div class="box-content">
						<ul class="list">
						  <?php foreach ($informations as $information) { ?>
						  <li><a href="<?php echo $information['href']; ?>"><i class="fa fa-stop"></i><?php echo $information['title']; ?></a></li>
						  <?php } ?>
						</ul>
					</div>					
				</div>
			</div>
			<?php } ?>				
		  
			<div class="column col-xs-12 col-sm-6 col-lg-3 col-md-3">
				<div class="box extra">
					<div class="box-heading"><span></i><?php echo $text_extra; ?></span></div>
					<div class="box-content">
						<ul class="list">							
							<li><a href="<?php echo $manufacturer; ?>"><i class="fa fa-stop"></i><?php echo $text_manufacturer; ?></a></li>
							<li><a href="<?php echo $voucher; ?>"><i class="fa fa-stop"></i><?php echo $text_voucher; ?></a></li>
							<li><a href="<?php echo $affiliate; ?>"><i class="fa fa-stop"></i><?php echo $text_affiliate; ?></a></li>
							<li><a href="<?php echo $special; ?>"><i class="fa fa-stop"></i><?php echo $text_special; ?></a></li>
						</ul>
					</div>			
				</div>
			</div>

			<div class="column col-xs-12 col-sm-6 col-lg-3 col-md-3">
				<div class="box">
					<div class="box-heading"><span><?php echo $text_account; ?></span></div>
					<div class="box-content">
						<ul class="list">						  
							<li><a href="<?php echo $account; ?>"><i class="fa fa-stop"></i><?php echo $text_account; ?></a></li>
							<li><a href="<?php echo $order; ?>"><i class="fa fa-stop"></i><?php echo $text_order; ?></a></li>
							<li><a href="<?php echo $wishlist; ?>"><i class="fa fa-stop"></i><?php echo $text_wishlist; ?></a></li>
							<li><a href="<?php echo $newsletter; ?>"><i class="fa fa-stop"></i><?php echo $text_newsletter; ?></a></li>
						</ul>
					</div>
				</div>
			</div>

			<div class="column col-xs-12 col-sm-6 col-lg-3 col-md-3">
				<div class="box customer-service">
					<div class="box-heading"><span><?php echo $text_service; ?></span></div>
					<div class="box-content">
						<ul class="list">						  
							<li><a href="<?php echo $contact; ?>"><i class="fa fa-stop"></i><?php echo $text_contact; ?></a></li>
							<li><a href="<?php echo $return; ?>"><i class="fa fa-stop"></i><?php echo $text_return; ?></a></li>
							<li><a href="<?php echo $sitemap; ?>"><i class="fa fa-stop"></i><?php echo $text_sitemap; ?></a></li>
						</ul>
					</div>	
				</div>
			</div>
		 </div> 
	</div></div>
<?php  } ?>	


<?php
/**
 * Footer Bottom
 * $ospans allow overrides width of columns base on thiers indexs. format array( 1=> 3 )[value from 1->12]
 */
$modules = $helper->getModulesByPosition( 'footer_bottom' ); 
$ospans = array();

if( count($modules) ){
$cols = isset($themeConfig['block_footer_bottom'])&& $themeConfig['block_footer_bottom']?(int)$themeConfig['block_footer_bottom']:count($modules);	
$class = $helper->calculateSpans( $ospans, $cols );
?>
<div class="footer-bottom">
	<?php $j=1;foreach ($modules as $i =>  $module) {  ?>
	<?php if( $i++%$cols == 0 || count($modules)==1 ){  $j=1;?><div class="row"><?php } ?>	
	<div class="<?php echo $class[$j];?>"><?php echo $module; ?></div>
	<?php if( $i%$cols == 0 || $i==count($modules) ){ ?></div><?php } ?>	
	<?php  $j++;  } ?>	
</div>
<?php } ?>
	

<!--
OpenCart is open source software and you are free to remove the powered by OpenCart if you want, but its generally accepted practise to make a small donation.
Please donate via PayPal to donate@opencart.com
//-->
<div id="powered">
	<div class="container">
		<div id="top"><a class="scrollup" href="#"><i class="fa fa-angle-up"></i>Top</a></div>
		<div class="copyright pull-left">
		<?php if( isset($themeConfig['enable_custom_copyright']) && $themeConfig['enable_custom_copyright'] ) { ?>
			<?php echo $themeConfig['copyright'];?>
		<?php } else { ?>
			<?php echo $powered; ?>. 
		<?php } ?>
		Designed by <a href="http://www.themelexus.com" title="themelexus - opencart themes clubs" target="_blank">ThemeLexus</a>
		</div>	
		<?php if( isset($themeConfig['widget_paypal_data'][$LANGUAGE_ID]) ) {?>
			<div class="paypal pull-right">
				<?php echo html_entity_decode( $themeConfig['widget_paypal_data'][$LANGUAGE_ID], ENT_QUOTES, 'UTF-8' ); ?>
		</div>
		 <?php } ?>
	</div>
</div>

</footer>










<!--
OpenCart is open source software and you are free to remove the powered by OpenCart if you want, but its generally accepted practise to make a small donation.
Please donate via PayPal to donate@opencart.com
//-->
<?php if( isset($themeConfig['enable_paneltool']) && $themeConfig['enable_paneltool'] ){  ?>
	<?php  echo $helper->renderAddon( 'panel' );?>
<?php } ?>

<script type="text/javascript">
	$(document).ready(function() {
		$("li:first-child").addClass('first');
		$("li:last-child").addClass('last');	
		$(".box-product .row:last-child").addClass('last');				
		$("#image-additional a:last-child").addClass('last');
		$(".product-items:last-child").addClass('last');
		$('.product-cols:last-child').addClass('last');	
		$(".product-cols:first-child").addClass('first');		
		$(".product-grid div[class^='col-']:last-child").addClass('last');
		$(".product-grid .row:last-child").addClass('last');
		$(function(){
			$('#header .links li').last().addClass('last');
			$('.breadcrumb a').last().addClass('last');
			$('.cart tr').eq(0).addClass('first');																									  
		});								
	});
</script>
</section> 
</body></html>

Any ideas??

Many thanks!!! :)

Re: Upgrade from 1.5.6.4 to 2.0.1.1 "Undefined property" iss

Posted: Tue Dec 23, 2014 9:55 pm
by eccolo
Hi guys,

I fixed that issue, but now I'm getting a lot...really a huge log errors in all my modules :-\
I need to change all my
$this->data
to:
$this->request->data

tell me that there is a way to do this...please! :)

Many thanks!

Re: Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Wed Dec 24, 2014 3:20 am
by ocmta
Templates in 2.x don't have access to any $this, neither $this->data, nor $this->request. Anything you want to pass to the template should be added to $data in controller, unless you modify system/engine/loader . And almost any text editor or IDE has some batch string replace function for multiple files at once.

Re: Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Wed Jul 22, 2015 5:55 pm
by bagde
Hi,

I am also facing the same issue. How you solved this issue. Please tell me. I am stuck.

Re: Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Thu Jun 16, 2016 12:49 am
by imashiine
bump, would need help for this aswell.

Running OC 2.1.0.2 (Upgrade)

Re: Upgrade from 1.5.6.4 to 2.0.1.1 "Undefined property" iss

Posted: Thu Jun 16, 2016 7:04 am
by IP_CAM
eccolo wrote:$this->data to: $this->request->data
tell me that there is a way to do this...please!
It's easy, just search the entire 'local' OC-Shop-Copy Content, to bulk-find all files, where such a routine exists. It's placed in about 300 individual Files, depending on Mod's, mostly located in the CONTROLLER/... Sections, also in some VqMods, and in a few Theme/... Files, and it exists about 14'500 times. By Use of NOTEPAD++, you could bulk-open all files, and then bulk-edit and bulk-save all of them at once.

That's the Good News! :D
The Bad News is, that if would not help anyway, because it is not possible, by DEFAULT Tools,
to UPGRADE a V.1.5.x Version to OC-2 ! :o It has never been published by OC, anywhere, as well, to be possible!

After reading below linked Topics, you all will know, how it has to be done. Or better, some Some of you,
possibly, how it should have been done, in the first place. For them, now, it will be much more complicated,
and, if no full backup 1.5.x DB exists, possibly a real PRO Job. And so, possibly costly as well :'(

http://forum.opencart.com/viewtopic.php ... &start=160
http://forum.opencart.com/viewtopic.php?f=181&t=163546
http://forum.opencart.com/viewtopic.php?f=190&t=163178
http://www.randemsystems.com/support/opencart/

Good Luck ;)
Ernie
PS, I don't do such, so, please, no PM's on such! 8)

Re: Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Thu Jun 16, 2016 3:27 pm
by i2Paq
Ask Qphoria, he can do it for you.

Re: Upgrade from 1.5.6.4 to 2.0.1.1 $data issue

Posted: Thu Jun 16, 2016 10:09 pm
by pm-netti
bagde wrote:Hi,

I am also facing the same issue. How you solved this issue. Please tell me. I am stuck.
What mean 'same issue'......?
Simple help:
your must changed theme and extensions to Opencart version 2.x