Jump to content

Undefined index errors from product-list.tpl


mipapage

Recommended Posts

I have updated CategoryController.php in order to add some smarty variables, and use these vars in product-list.tpl. This works great on category pages, but on the homepage I get undefined index errors for these fields in the 'New', 'Popular', 'Best Seller' areas. It would seem that these vars are not created for a request to the homepage.

 

Do I need to update some other controller somewhere for these? If so, please tell me which one as I have not been able to sort this out. Thanks in advance!

 

(We're on 1.6)

Edited by mipapage (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Hi

It's easy to solve this problem, you just have to edit global.js inside your theme folder:

/themes/your-theme/js/global.js

 

Look for:

html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>';

Replace it with:

html += '<h3 itemprop="name">'+ $(element).find('h3').html() + '</h3>';

This is because your using h3 for your product list product titles and global.js is trying to find h5 titles. Just have to unify them.

For example, if you want to use h2 just replace it in global.js with h2 and in product-list.tpl replace the following:

<h3 itemprop="name">
{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
<a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" >
{$product.name|truncate:60:'...'|escape:'html':'UTF-8'}
</a>
</h3>

The key is to keep in both files the same h3, h5 or wathever. Then the javascript will work fine.

 

Thanks

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

hii to all,

 

There is problem when I am click payment option in prestrshop. Its shows below error

 

Notice: Undefined index: objOrder in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 207

Notice: Trying to get property of non-object in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 207

Notice: Undefined index: objOrder in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 209

Notice: Trying to get property of non-object in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 209

 

Please help me what is actually problem 

please check full code

payu.php

Link to comment
Share on other sites

  • 3 months later...

 

Hi

It's easy to solve this problem, you just have to edit global.js inside your theme folder:

/themes/your-theme/js/global.js

 

Look for:

html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>';

Replace it with:

html += '<h3 itemprop="name">'+ $(element).find('h3').html() + '</h3>';

This is because your using h3 for your product list product titles and global.js is trying to find h5 titles. Just have to unify them.

For example, if you want to use h2 just replace it in global.js with h2 and in product-list.tpl replace the following:

<h3 itemprop="name">
{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
<a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" >
{$product.name|truncate:60:'...'|escape:'html':'UTF-8'}
</a>
</h3>

The key is to keep in both files the same h3, h5 or wathever. Then the javascript will work fine.

 

Thanks

 

 

nice. thank you

Link to comment
Share on other sites

  • 5 months later...

hii to all,

 

There is problem when I am click payment option in prestrshop. Its shows below error

 

Notice: Undefined index: objOrder in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 207

 

Notice: Trying to get property of non-object in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 207

 

Notice: Undefined index: objOrder in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 209

 

Notice: Trying to get property of non-object in /home3/emscgpl/public_html/how2brich.com/modules/payu/payu.php on line 209

 

Please help me what is actually problem 

 

 

HI @ganesh suthar, How did you solve this problem? I am getting the same errors.

Edited by abdukannur (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...