Plugin Directory

Changeset 498347


Ignore:
Timestamp:
02/01/2012 05:46:22 AM (14 years ago)
Author:
beshkin
Message:

tagging version 0.3

Location:
e-commerce-multi-currency-support
Files:
3 edited
8 copied

Legend:

Unmodified
Added
Removed
  • e-commerce-multi-currency-support/tags/0.3/readme.txt

    r490468 r498347  
    1717
    1818== Changelog ==
     19= 0.3 =
     20- Base currency is selected by default in drop-down currency selector
    1921= 0.2 =
    2022- currency code can appear now in the selector drop-down
  • e-commerce-multi-currency-support/tags/0.3/widgets/currency_chooser_widget.php

    r490468 r498347  
    2323        //Display Currency Info:
    2424        $sql ="SELECT * FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `visible`='1' ORDER BY `country` ASC";
    25         //echo $sql;
     25        //echo $_SESSION['wpsc_base_currency_code'];
    2626        $countries = $wpdb->get_results($sql, ARRAY_A);
    2727        $output .= '<form method="post" action="" id="wpsc-mcs-widget-form">';
    2828        $output .='<select name="currency_option" style="width:200px;">';
     29        if (!isset($_SESSION['wpsc_base_currency_code']))
     30        {
     31            $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);
     32            $local_currency_code = $currency_code[0]['code'];
     33        }else{
     34            $local_currency_code=$_SESSION['wpsc_base_currency_code'];
     35        }
    2936            foreach($countries as $country){
    3037                $country_code = '';
    3138                if ($instance['show_code'] == 1) $country_code =" (".$country['code'].")";
     39                $selected_code = '';
    3240                if($_SESSION['wpsc_currency_code'] == $country['id']){
    33                     $output .="<option selected='selected' value=".$country['id'].">".$country['country'].$country_code."</option>";
    34                 }else{
    35                     $output .="<option value=".$country['id'].">".$country['country'].$country_code."</option>";
    36                 }
     41                    $selected_code = "selected='selected'";
     42                }else {
     43                    if ( $local_currency_code == $country['code'])
     44                        $selected_code = "selected='selected'";
     45                }
     46                $output .="<option ".$selected_code." value=".$country['id'].">".$country['country'].$country_code."</option>";
     47
    3748            }
    3849        $output .="</select><br />";
  • e-commerce-multi-currency-support/tags/0.3/wpsc-currency-changer.php

    r490468 r498347  
    44Plugin URI: http://misha.beshkin.lv
    55Description: A plugin that provides a currency converter tool integrated into the WordPress Shopping Cart. This is trunk from wp-e-commerce-multi-currency-magic plugin.
    6 Version: 0.2
     6Version: 0.3
    77Author: Misha Beshkin
    88Author URI: http://misha.beshkin.lv
  • e-commerce-multi-currency-support/trunk/readme.txt

    r490468 r498347  
    1717
    1818== Changelog ==
     19= 0.3 =
     20- Base currency is selected by default in drop-down currency selector
    1921= 0.2 =
    2022- currency code can appear now in the selector drop-down
  • e-commerce-multi-currency-support/trunk/widgets/currency_chooser_widget.php

    r490468 r498347  
    2323        //Display Currency Info:
    2424        $sql ="SELECT * FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `visible`='1' ORDER BY `country` ASC";
    25         //echo $sql;
     25        //echo $_SESSION['wpsc_base_currency_code'];
    2626        $countries = $wpdb->get_results($sql, ARRAY_A);
    2727        $output .= '<form method="post" action="" id="wpsc-mcs-widget-form">';
    2828        $output .='<select name="currency_option" style="width:200px;">';
     29        if (!isset($_SESSION['wpsc_base_currency_code']))
     30        {
     31            $currency_code = $wpdb->get_results("SELECT `code` FROM `".WPSC_TABLE_CURRENCY_LIST."` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);
     32            $local_currency_code = $currency_code[0]['code'];
     33        }else{
     34            $local_currency_code=$_SESSION['wpsc_base_currency_code'];
     35        }
    2936            foreach($countries as $country){
    3037                $country_code = '';
    3138                if ($instance['show_code'] == 1) $country_code =" (".$country['code'].")";
     39                $selected_code = '';
    3240                if($_SESSION['wpsc_currency_code'] == $country['id']){
    33                     $output .="<option selected='selected' value=".$country['id'].">".$country['country'].$country_code."</option>";
    34                 }else{
    35                     $output .="<option value=".$country['id'].">".$country['country'].$country_code."</option>";
    36                 }
     41                    $selected_code = "selected='selected'";
     42                }else {
     43                    if ( $local_currency_code == $country['code'])
     44                        $selected_code = "selected='selected'";
     45                }
     46                $output .="<option ".$selected_code." value=".$country['id'].">".$country['country'].$country_code."</option>";
     47
    3748            }
    3849        $output .="</select><br />";
  • e-commerce-multi-currency-support/trunk/wpsc-currency-changer.php

    r490468 r498347  
    44Plugin URI: http://misha.beshkin.lv
    55Description: A plugin that provides a currency converter tool integrated into the WordPress Shopping Cart. This is trunk from wp-e-commerce-multi-currency-magic plugin.
    6 Version: 0.2
     6Version: 0.3
    77Author: Misha Beshkin
    88Author URI: http://misha.beshkin.lv
Note: See TracChangeset for help on using the changeset viewer.