Thanks straightlight. I cant believe how much time Im spending on this one thing... but its so important. As for the number_format I first tried the round option... but it gave back non complete numbers. For example:
after the multiplication of the discount code if the real number was .8001 it would give back 0.8 not 0.80 which I did not understand. If the number was .8201 I would get 0.82 which would be correct. but for some reason... if the second digit after the decimal was a zero it would take trim the zero... and the number could be confusing to the customer. So I tried number_format and it worked.
$0.8
$0.80
The top one looks like 8 cents when looking quick... some may see it that way... and its not the proper way to show the number.
As for the reason to not use number_format... Im using paypal and square for payment processing. Shipping I do manually using stamps.com and the number format is being used on a number that is not related to the sales data at all... just sort of a promotion... so hopefully that will not be a big deal.
More importantly I have to figure out how to get this all done in the twig template which is so friggen frustrating. This is my first experience with twig. Any exposure I got to PHP is a result of working with opencart 1.5.6 so I know a few minor things... but I dont know twig at all and it seems so much more limited than PHP.
Oh yea... as far as my PHP that you converted to PHP to be included in the controller file... when I added it... it took some trial and error to get it to even show me any results on the front end and when it did... it only showed "0" as the answer. I was unable to get it to work and give me a real number. I was doing this at like 2am... so maybe i messed something up and will try again in a bit.
As for journal... for the top selling theme for opencart... you would think someone ran into a problem with cache on the controller files. Its funny how it only seems to affect those files tho. And I sent them a message describing my steps in great detail. For them to say its not a problem with the theme or it may be my server... and then to get another server from a totally different hosting company and still have the problem... but it works fine without the theme... thats a theme problem. But to be sure... today I will do a 3rd install using a totally different theme. and see if that works.
Thank you for all your help and feedback.
If anyone knows how I can do this:
Code: Select all
'after_discount' => number_format((($discount['price']) * 0.80), 2)
In the actual product.twig file... please advise.
Angelina