Plugin Directory

Changeset 1803652


Ignore:
Timestamp:
01/16/2018 09:19:12 AM (8 years ago)
Author:
tresrl
Message:

V 1.0.1 - 16/01/2018 - Added transaction history for collecting points

Location:
hq60-fidelity-card
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • hq60-fidelity-card/trunk/hq60fidelitycard.php

    r1801667 r1803652  
    77Author: TRe Technology And Research S.r.l
    88Author URI: http://www.tresrl.it
    9 Version: 1.0
     9Version: 1.0.1
    1010License: GPL-2.0+
    1111*/
  • hq60-fidelity-card/trunk/readme.txt

    r1801667 r1803652  
    33Tags:
    44Requires at least: 4.8.2
    5 Tested up to: 4.8.2
    6 Stable tag: 1.0
     5Tested up to: 4.9.1
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
    99
    10 With this plugin you can display balance of fidelity cards present on your software.
     10Con questo plugin puoi permettere ai tuoi Clienti di mostrare il saldo della loro tessera. E' necessaria una licenza attiva con il nostro software fidelity card. Maggiori informazioni su www.nicecard.it
    1111
    1212
    1313== Description ==
    1414
    15 With this plugin you can display balance of fidelity cards present on your software.
     15Con questo plugin puoi permettere ai tuoi Clienti di mostrare il saldo della loro tessera. Attenzione! E' necessaria una licenza attiva con il nostro software fidelity card! Maggiori informazioni su www.nicecard.it.
     16I tuoi Clienti possono registrarsi, scegliere una password personale, verificare il saldo e prossimamente richiedere anche i premi online!
    1617
    1718== Installation ==
     
    2122== Usage ==
    2223
    23 1. Get a token and insert into settings
     241. Con una licenza attiva e funzionante di NiceCard inserisci il tuo token
    2425
    2526
    2627== Changelog ==
    2728
     29= 1.0.1 =
     30* Aggiunto elenco transazioni per raccolta punti
     31
    2832= 1.0 =
    2933* First relase
  • hq60-fidelity-card/trunk/src/Hq60/Hq60.php

    r1801667 r1803652  
    5757    }
    5858   
     59    /**
     60     * Get transaction
     61     *
     62     * @param int the id of member_card
     63     * @param int the id campaign
     64     *
     65     * @since 1.0
     66     *
     67     * @return object if campaign is found or false if nothing found
     68     */
     69    public function get_transaction ( $id_member_card , $id_campaign ) {
     70       
     71        $url = $this->get_base_api_url().'transaction/'.$id_member_card.'?id_campaign='.$id_campaign.'&token='.$this->get_token();
     72       
     73        $response = $this->perform_get_request( $url );
     74       
     75        if ( is_object( $response ) ) {
     76               
     77            if ( isset ( $response->code ) ) {
     78               
     79                return false;
     80               
     81            } else {
     82               
     83                return $response;
     84               
     85            }
     86        }
     87       
     88    }
     89   
    5990   
    6091    /**
  • hq60-fidelity-card/trunk/src/Hq60fidelitycard/Frontend/Frontend.php

    r1801667 r1803652  
    306306                        $title = $single_campaign->campaign[0]->name;
    307307                        $balance = $hq60->get_balance ( $id_member_card , $id_campaign );
     308                        $transaction = $hq60->get_transaction ( $id_member_card , $id_campaign );
    308309                       
    309310                    } else {
  • hq60-fidelity-card/trunk/views/frontend/user-balance.php

    r1801667 r1803652  
    7979           
    8080        } //if ( $campaign_type == 'points' ) {
     81                   
     82        if ( $campaign_type == 'points' ) {
     83           
     84            if ( isset ( $transaction->transaction ) ) {
     85                   
     86                $decimals = 0;
     87                ?>
     88               
     89                <table class="table table-transaction">
     90                   
     91                    <thead>
     92                        <tr>
     93                            <th><?php _e( 'Punti' , $this->get_language_domain() )?></th>
     94                            <th><?php _e( 'Dettaglio' , $this->get_language_domain() )?></th>
     95                            <th><?php _e( 'Data' , $this->get_language_domain() )?></th>
     96                        </tr>
     97                    </thead>
     98                    <tbody>
     99               
     100                <?php
     101                foreach ( $transaction->transaction as $t ) {
     102                   
     103                    $class = 'positive-number';
     104                   
     105                    if ( $t->amount_final < 0 ) {
     106                       
     107                        $class = 'negative-number';
     108                       
     109                    }
     110                   
     111                    $amount = number_format_i18n( $t->amount_final, $decimals );
     112                    $date =  date_i18n( 'd/m/Y', strtotime( $t->date ) );
     113                   
     114                    echo '<tr>';
     115                        echo '<td class="'.$class.'">';
     116                            echo $amount;
     117                        echo '</td>';
     118                        echo '<td>';
     119                            echo $t->description;
     120                        echo '</td>';
     121                        echo '<td>';
     122                            echo $date;
     123                        echo '</td>';
     124                    echo '</tr>';
     125                   
     126                }
     127                ?>
     128               
     129                    </tbody>
     130               
     131                </table>
     132                <?php
     133               
     134            }
     135           
     136        }           
    81137           
    82138       
Note: See TracChangeset for help on using the changeset viewer.