Post by thisisworldwide » Fri Dec 09, 2011 10:31 pm

what does this mean? how do i fix it?
2011-06-05 0:33:59 - PHP Notice: Undefined index: product_option_discount in /var/www/vhosts/memorymats.ca/httpdocs/store/catalog/controller/product/product.php on line 255
2011-06-05 0:33:59 - PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/memorymats.ca/httpdocs/store/catalog/controller/product/product.php on line 255
2011-06-05 0:33:59 - PHP Notice: Undefined index: product_option_discount in /var/www/vhosts/memorymats.ca/httpdocs/store/catalog/controller/product/product.php on line 255
2011-06-05 0:33:59 - PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/memorymats.ca/httpdocs/store/catalog/controller/product/product.php on line 255

its from the error log. it keeps coming up.
here is what line 255 of product.php looks like.. its BLANK...

http://www.end-era.com/ss2.jpg
Image

New member

Posts

Joined
Thu Jun 02, 2011 1:57 am

Post by wernerrenrew » Sat Dec 10, 2011 12:58 am

Hi,

You are not giving very much information version or mod you just installed.

I can tell you that these lines shouldn't be there 238-254 but they are there getProductDiscount is a non native function but it is not giving you an error so some extention created this function.

you are already inside the $product_info if statement setting $this->data['product_info'] = $product_info; here is crazy
Am i wrong in assuming that you are trying to mess with the code yourself?

If you want to find out if this product has discounts and if so set the price to the discount price do this

Remove everything you coded and use this on line 66 after this loop foreach ($discounts as $discount) {

Code: Select all

if (sizeof($this->data['discounts']) > 0) {
     $this->data['price'] = $this->data['discounts'][0]['price'];
     $this->data['special'] = false;
}
Regards Werner

User avatar
Active Member

Posts

Joined
Thu Oct 27, 2011 9:48 pm
Location - Netherlands

Post by thisisworldwide » Sat Dec 10, 2011 7:53 am

i removed the file and replaced it with the original product.php but it didnt fix anything it gave me an error. ah. i guess ill try to uninstall the extension that i used which was product option discount and then ill try again

i know nothing about php thats the way the file was but i didnt notice till now that there was a problem

ill remove all the files for the extension and replace with the original and see if it works

New member

Posts

Joined
Thu Jun 02, 2011 1:57 am

Post by straightlight » Sat Dec 10, 2011 10:10 am

Would it be possible to post between line 250 and 260 ? I will take a look at it. Sounds like another isset is missing.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Amazon [Bot] and 70 guests