Plugin Directory

Changeset 1189768


Ignore:
Timestamp:
06/29/2015 05:52:57 PM (11 years ago)
Author:
chuckmac
Message:

Compatibility with jVectorMap 2.0.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-sales-by-location-report/trunk/classes/class-wc-report-sales-by-location.php

    r1189764 r1189768  
    146146        $this->location_data = $country_data;
    147147        wp_localize_script('jvectormap', 'map_data', $this->location_data);
     148
    148149
    149150        //If we are using price, then create another set of data with the price set (map does not like adding with price)
     
    362363        <div class="jvectormap jvectormap-mill" id="world-map" style="height: 500px;">
    363364        <script type="text/javascript">
    364             jQuery(function($){
    365                 $('#world-map').vectorMap( {
    366                     map: 'world_mill_en',
    367                     backgroundColor: "transparent",
    368                     regionStyle: {
    369                         initial:  { fill: "#d2d2d2"}
     365            jQuery(function($){
     366                $('#world-map').vectorMap( {
     367                    map: 'world_mill_en',
     368                    backgroundColor: "transparent",
     369                    regionStyle: {
     370                        initial:  { fill: "#d2d2d2"}
    370371                    },
    371                     onRegionLabelShow: function(e, el, code) {
    372                         <?php
    373                         if ( isset($_REQUEST['report_by']) && 'order-total' == $_REQUEST['report_by'] ) { // show formatted price for order totals ?>
    374                             el.html('<strong>'+(map_price_data[code] ? map_price_data[code] : 0)+' <?php _e('orders', 'woocommerce-location-report'); ?> - '+'</strong> '+el.html());
    375                         <?php
    376                         } else { ?>
    377                             el.html('<strong>'+(map_data[code] ? map_data[code] : 0)+' <?php _e('orders', 'woocommerce-location-report'); ?> - '+'</strong> '+el.html());
    378                         <?php
    379                         } ?>
    380                     },
    381                     series: {
    382                       regions: [{
    383                         values: map_data,
    384                         scale: ['#F0C7E8', '#A46497'],
    385                         normalizeFunction: 'polynomial'
    386                       }]
    387                     },
    388                 });
    389             });
     372                    onRegionTipShow: function(e, el, code) {
     373                        <?php
     374                        if ( isset($_REQUEST['report_by']) && 'order-total' == $_REQUEST['report_by'] ) { // show formatted price for order totals ?>
     375                            el.html('<strong>'+(map_price_data[code] ? map_price_data[code] : 0)+' - </strong> '+el.html());
     376                        <?php
     377                        } else { ?>
     378                            el.html('<strong>'+(map_data[code] ? map_data[code] : 0)+' <?php _e('orders', 'woocommerce-location-report'); ?> - '+'</strong> '+el.html());
     379                        <?php
     380                        } ?>
     381                    },
     382                        series: {
     383                          regions: [{
     384                        values: map_data,
     385                        scale: ['#F0C7E8', '#A46497'],
     386                        normalizeFunction: 'polynomial'
     387                          }]
     388                        },
     389                });
     390            });
    390391        </script>
    391392
Note: See TracChangeset for help on using the changeset viewer.