-1

So I receive this message when on my category pages:

Notice : Undefined index: text in /home/thespace/public_html/vqmod/vqcache/vq2-catalog_view_theme_spacec_template_product_category.tpl on line 13 » Meteorite Jewellery

Though I can't see the problem in that particular line of code:

<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>" itemprop="url"><span itemprop="title"><?php echo $breadcrumb['text']; ?></span></a>

Am I missing something here?

  • I don't see anything wrong with that line. If it's not on that line, most likely it would be one of the lines above. Perhaps you forgot a ; or a {} in your code somewhere. It's always the little things in coding... – Haymaker Jan 05 '16 at 17:24

1 Answers1

0

The message is pretty clear: "Undefined index: text", you don't have the index "text" in your variable. In that case $breadcrumb['text'] does not exists.

You can try a var_dump($breadcrumb) to debug this variable.

As you can see the doc, this function will print in the page the parameter given. I suggested to you to use it, just so you could see that the "text" was indeed missing. Now you must see why this index no longer exist or if it even existed before. We can't help you with the current info, though.

Clyff
  • 4,046
  • 2
  • 17
  • 32
  • Thank you for the assistance, but how do I add the above debug variable exactly? I should mention I know nothing of code and what I've done so far to fix the problems I have been having is a result of around 7 hours of online research! – Richard Garner Jan 05 '16 at 17:49
  • Simply `` – Clyff Jan 05 '16 at 17:53
  • Thank you - sorry to be dumb here, but where exactly in the code do I paste it? I've added it in a few places but it doesn't seem to work. – Richard Garner Jan 05 '16 at 18:03
  • Updated the answer. You can use that function anywhere you like. It will print the `$breadcrumb`. – Clyff Jan 05 '16 at 18:16
  • It just throws this text out: array(3) { ["text"]=> string(4) "Home" ["href"]=> string(30) "http://thespacecollective.com/" ["separator"]=> bool(false) } » array(2) { ["http://thespacecollective.com/products"]=> string(14) "Space Products" ["separator"]=> string(9) " » " } » array(2) { ["http://thespacecollective.com/products/astronaut-autographs"]=> string(20) "Astronaut Autographs" ["separator"]=> string(9) " » " } » array(3) { ["text"]=> string(17) "Autographed Books" ["href"]=> string(77) "http://thespacecollective.com/products/astronaut-autographs/autographed-books" ["separator"]=> – Richard Garner Jan 05 '16 at 18:22
  • This is all I get, unfortunately. – Richard Garner Jan 05 '16 at 18:23