Jump to content

A PHP Error was encountered


colleyboy

Recommended Posts

I am getting this error on my sales cart page.  I am editting a PHP Point of sale program.

 

Cant work out why this is not working.  It should display the amount of points the item is worth. 

 

Help please :D

 

Heres the error im getting:

 

A PHP Error was encountered

Severity: Notice

 

Message: Undefined index: points

 

Filename: sales/register.php

 

Line Number: 69

 

 

Heres the code:

 

<div class='warning_message' style='padding:7px;'><?php echo $this->lang->line('sales_no_items_in_cart'); ?></div>
</tr></tr>
<?php
}
else
{
foreach($cart as $item_id=>$item)
{
	echo form_open("sales/edit_item/$item_id");
?>
	<tr>
	<td><?php echo anchor("sales/delete_item/$item_id",'['.$this->lang->line('common_delete').']');?></td>
	<td><?php echo $item['name']; ?></td>
!!!THIS IS LINE 69 !!!	<td><?php echo $item['points']; ?></td>
	<?php if ($items_module_allowed)
	{
	?>
		<td><?php echo form_input(array('name'=>'price','value'=>$item['price'],'size'=>'6'));?></td>
	<?php
	}
	else
	{
	?>
		<td><?php echo $item['price']; ?></td>
		<?php echo form_hidden('price',$item['price']); ?>
	<?php
	}
	?>
	<td><?php echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2'));?></td>
	<td><?php echo form_input(array('name'=>'discount','value'=>$item['discount'],'size'=>'3'));?></td>
	<td><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>

	<td><?php echo form_submit("edit_item", $this->lang->line('sales_edit_item'));?></td>
	</tr>
	</form>

 

Any ideas?

Link to comment
Share on other sites

If you find that it's not a bug at all and you just want to get rid of that message, you can do this:

 

error_reporting(E_ALL ^ E_NOTICE);

 

Make sure you are 100% sure it's not a bug first though, by doing what MatthewJ said.  Otherwise you'll just be hiding the problem instead of fixing it.  That message is a "notice" rather than an "error", meaning php is telling you about it, but the script can still continue to run anyway.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.