Post by amplifywebdesign » Sat Sep 05, 2009 12:47 am

I get this error on the checkout page, I know it isn't a crucial error but I would appreciate it if anyone has found a fix for this.

Code: Select all

Notice: Undefined index: discount in /home/fhlinux/g/xxxxxxxx.co.uk/user/htdocs/catalog/view/theme/BlueHarvest/template/checkout/confirm.tpl
Thanks for any help!!

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by amplifywebdesign » Sat Sep 05, 2009 4:09 am

Running OpenCart 1.3.2 and PHP Version 5.2.6

Thanks for the reply.

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by JNeuhoff » Sun Sep 06, 2009 1:14 am

In the default /catalog/view/theme/default/template/checkout/confirm.tpl OpenCart 1.3.2 doesn't use the $discount variable in that file. My guess is you must have changed the confirm.tpl and use the $discount variable in there, but you haven't set it in the corresponding controller /catalog/controller/checkout/confirm.php.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by MikeH » Mon Sep 07, 2009 10:07 pm

Here is the offending code:

Code: Select all

        <td align="right" valign="top"><?php if (!$product['discount']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <u style="color: #F00; text-decoration: line-through;"><?php echo $product['price']; ?></u><br />
          <?php echo $product['discount']; ?>
          <?php } ?></td>
Would it be safe to delete this section if the cart doesn't use $discount variable? I removed it and the script seems to work fine, no errors, but I'm just not sure.

Newbie

Posts

Joined
Thu Aug 06, 2009 11:24 pm

Post by JNeuhoff » Mon Sep 07, 2009 10:40 pm

Just replace your offending code with this:

Code: Select all

        <td align="right" valign="top"><?php if ((!isset($product['discount'])) || (!$product['discount'])) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <u style="color: #F00; text-decoration: line-through;"><?php echo $product['price']; ?></u><br />
          <?php echo $product['discount']; ?>
          <?php } ?></td>

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by MikeH » Mon Sep 07, 2009 10:48 pm

Very nice. Works great! Thanks for the speedy response.

Newbie

Posts

Joined
Thu Aug 06, 2009 11:24 pm

Post by MikeH » Tue Sep 08, 2009 9:32 am

Update in case anyone else runs into this problem.

I get the same error when viewing the invoice (invoice.tpl). BUT, I can cut and replace the exact same code the same way and it's all good.

Newbie

Posts

Joined
Thu Aug 06, 2009 11:24 pm

Post by amplifywebdesign » Tue Sep 08, 2009 7:12 pm

Great thanks for the help guys ;D

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by tharrison » Tue Sep 15, 2009 1:26 am

Hi there. I have had the same problem, followed the insructions here..which are great by the way!

I am now getting various 'black diamond' shapes with a question mark in it??

Any suggestions?!

many thanks

New member

Posts

Joined
Wed Sep 09, 2009 7:41 pm

Post by tharrison » Tue Sep 15, 2009 1:27 am

� � � � ....Like this!

many thanks

New member

Posts

Joined
Wed Sep 09, 2009 7:41 pm

Post by jolinya1 » Fri Sep 18, 2009 9:31 am

thanks a lot, it works

Jolinya Ornament Company Limited


Newbie

Posts

Joined
Fri Sep 18, 2009 9:25 am
Who is online

Users browsing this forum: No registered users and 7 guests