0

I have a following problem:

I wrote a script related products for Opencart. This script select products based on minimum price and on maximum price that are prewritten by administrator. Also administrator must enter categories of those related products. For example if you chose a motherboard you will see hard drives, cooling systems ets. When I am trying to save those settings in my admin page I get the following:

Notice: Undefined index: related_kv4nt_id_3 in /home/eplus/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php on line 145

Notice: Undefined index: related_kv4nt_id_4 in /home/eplus/public_html/vqmod/vqcache/vq2-admin_model_catalog_product.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/eplus/public_html/admin/index.php:83) in /home/eplus/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/eplus/public_html/admin/index.php:83) in /home/eplus/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 29

related_kv4nt_id_3 is the number of product category that will be showen. For example related_kv4nt_id_1 is block that shows motherboards related_kv4nt_id_2 shows hard drives ets. There are 4 of them. What can solve this problem?

When you trying to save the settings there is only category gets saved.

Chetan Paliwal
  • 1,620
  • 2
  • 15
  • 24

1 Answers1

0

The undefined index errors happen when you try to use an array index which you have not created.

So if you have an array with the key foo and then called the array key bar you would get an index notice because you have not defined bar in your array.

So in this case it could be your data array does not have id_3 and id_4 of your custom variables.

The header information warnings occur because you cannot have any output to the page before the headers are sent. In your case the header notifications come up because of the notices. Fix the notices and the header warnings will solve themselves.

Andy
  • 631
  • 1
  • 6
  • 13