FliP1992's Profile User Rating: -----

Reputation: 14 Tradesman
Group:
Active Members
Active Posts:
197 (0.07 per day)
Joined:
14-June 07
Profile Views:
6,669
Last Active:
User is offline Jun 11 2013 03:46 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Honda
Dream Kudos:
0

Latest Visitors

Icon   FliP1992 has not set their status

Posts I've Made

  1. In Topic: OpenCart Module Development

    Posted 9 Oct 2012

    I found the solution to this problem quote easy. You just need to follow the OpenCart MVC pattern. What i was actually looking for was to create a "Order Totals" Module instead of a standard one. These are processed when the cart/checkout total is loaded.

    The code below is just the model class for the "Order Totals" processing part. To use it you will need to create a module as usual. If you don't know who to do this there are loads of tutorials you can follow online.

    The only problem i faced using it was that the code was being run 4 times. Two of the times it was being passed blank cart data. To get around this problem i just checked how many times the code was being run and returned null if it was more than once.

    File: /catalog/model/total/ModuleName.php
    <?php
    class ModelTotalModuleName extends Model {
        public function getTotal(&$total_data, &$total, &$taxes) {
            
            $discount_total = 0.00;
            $discount_title = '20% off';
            $status = true;
        
            if($status){
                $total_data[] = array( 
                    'code'       => 'ModuleName',
                    'title'      => $discount_title,
                    'text'       => $this->currency->format($discount_total),
                    'value'      => $discount_total,
                    'sort_order' => 0
                );
            }
            $total += $discount_total;
        }
    }
    ?>
    
    

    I will write an expanded tutorial if enough people are intrested.

    Hope this helps,
    Tom

    Edit Reason: I accidently deleted the post the first time.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Preston, UK

Contact Information

E-mail:
Click here to e-mail me

Friends

FliP1992 hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    jesicalbaby Icon

    16 Sep 2013 - 14:38
    Hello
    My name is Miss jesical,
    i saw your profile today
    and,i fill more interest to contact you ,
    i will like you to please send me
    an email via (jesicalduncan22@yahoo.com)
    for me to send you my picture
    jesicalduncan22@yahoo.com
  2. Photo

    pwz2000 Icon

    26 Mar 2011 - 19:26
    I am not looking to interview 20 different people, I found about four people from here I would be interested in developing site, otherwise I will post elsewhere. If not interested just let me know.
  3. Photo

    pwz2000 Icon

    25 Mar 2011 - 07:14
    What is your email address? I would like to speak with you about a freelance project
Page 1 of 1