Plugin Directory

Changeset 3237345


Ignore:
Timestamp:
02/09/2025 01:17:07 PM (13 months ago)
Author:
Arfa__
Message:

2.12.13

Added geographic search filters for items within a radius of a pickup postal code

Location:
fast-ebay-listings/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • fast-ebay-listings/trunk/apicall_browse_search.php

    r3221111 r3237345  
    3131  protected $searchInDesc = false;
    3232  protected $searchLocation = fuItemLocation::Internationally;
     33  protected $pickupPostcode = "";
     34  protected $pickupRadius = 0;
    3335
    3436  public $minPrice = -1;
     
    7678        $this->searchLocation = fuItemLocation::Internationally;
    7779    }
     80  }
     81
     82  public function setPickupOptions(string $postcode, string $radius)
     83  {
     84    $this->pickupPostcode = $postcode;
     85    $this->pickupRadius = intval($radius);
    7886  }
    7987
     
    289297    if (!empty($this->searchLocation))
    290298      $queryParams["searchLocation"] = $this->searchLocation;
     299
     300    if (!empty($this->pickupPostcode) && $this->pickupRadius > 0)
     301    {
     302      $queryParams["pickupPostcode"] = $this->pickupPostcode;
     303      $queryParams["pickupRadius"] = $this->pickupRadius;
     304    }
     305
    291306    if (!empty($this->buyingOptions))
    292307      $queryParams["buyingOptions"] = $this->buyingOptions;
     
    434449      'fu_ebay_searchInDesc' => $this->searchInDesc ? 1 : 0,
    435450      'fu_ebay_searchLocation' => $this->searchLocation,
     451      'fu_ebay_pickupPostcode' => $this->pickupPostcode,
     452      'fu_ebay_pickupRadius' => $this->pickupRadius,
    436453      'fu_ebay_sort' => $this->sortOrder,
    437454      'fu_ebay_categoryIds' => implode(',', $this->categoryIds),
     
    476493      $apicall->setSearchLocation(fu_inc_sanitize_text_in_dict_keys($_POST['fu_ebay_searchLocation'], fuEbayItemLocation::$Labels, ""));
    477494
     495    if (isset($_POST['fu_ebay_pickupPostcode']) && isset($_POST['fu_ebay_pickupRadius']))
     496      $apicall->setPickupOptions(sanitize_text_field($_POST['fu_ebay_pickupPostcode']), intval($_POST['fu_ebay_pickupRadius']));
     497     
    478498    if (isset($_POST['fu_ebay_sort']))
    479499      $apicall->setSortOrder(fu_inc_sanitize_text_in_dict_keys($_POST['fu_ebay_sort'], fuEbaySortOrder::$Labels, ""));
  • fast-ebay-listings/trunk/blocks/search/block.json

    r3221111 r3237345  
    2929    },
    3030    "searchlocation": {
     31      "type": "string"
     32    },
     33    "pickuppostcode": {
     34      "type": "string"
     35    },
     36    "pickupradius": {
    3137      "type": "string"
    3238    },
  • fast-ebay-listings/trunk/blocks/search/search.js

    r3221111 r3237345  
    9696                fu_ebay_searchInDesc : refAttributes.current.searchindesc ? "1" : "0",
    9797                fu_ebay_searchLocation : refAttributes.current.searchlocation ?? '',
     98                fu_ebay_pickupPostcode : refAttributes.current.pickuppostcode ?? '',
     99                fu_ebay_pickupRadius : refAttributes.current.pickupradius ?? 0,
    98100                fu_ebay_sort : refAttributes.current.sort ?? '',
    99101                fu_ebay_categoryIds : refAttributes.current.category,
     
    210212                                }
    211213                            ),
     214             
     215              el('div',
     216                { className: 'fu_ebay_label_editor' },
     217                                __( 'Buying Options', 'fast-ebay-listings' ),
     218                            ), 
     219              el(CheckboxControl,
     220                                {
     221                                    label: __( 'Fixed Price', 'fast-ebay-listings' ),
     222                                    checked: buyingOptionFixedPrice,
     223                                    onChange: onBuyingOptionsCheckChange.bind( "FIXED_PRICE" ),
     224                  className: 'fu_ebay_checkbox_editor',
     225                                }
     226                            ), 
     227              el(CheckboxControl,
     228                                {
     229                                    label: __( 'Auction', 'fast-ebay-listings' ),
     230                                    checked: buyingOptionAuction,
     231                                    onChange: onBuyingOptionsCheckChange.bind( "AUCTION" ),
     232                  className: 'fu_ebay_checkbox_editor',
     233                                }
     234                            ), 
     235              el(CheckboxControl,
     236                                {
     237                                    label: __( 'Best Offer', 'fast-ebay-listings' ),
     238                                    checked: buyingOptionBestOffer,
     239                                    onChange: onBuyingOptionsCheckChange.bind( "BEST_OFFER" ),
     240                                }
     241                            ),
     242
     243              el('div',
     244                { className: 'fu_ebay_label_editor' },
     245                                __( 'Condition', 'fast-ebay-listings' ),
     246                            ), 
     247              el(CheckboxControl,
     248                                {
     249                                    label: __( 'New', 'fast-ebay-listings' ),
     250                                    checked: conditionOptionNew,
     251                                    onChange: onConditionOptionsCheckChange.bind( "NEW" ),
     252                  className: 'fu_ebay_checkbox_editor',
     253                                }
     254                            ), 
     255              el(CheckboxControl,
     256                                {
     257                                    label: __( 'Refurbished', 'fast-ebay-listings' ),
     258                                    checked: conditionOptionRefurb,
     259                                    onChange: onConditionOptionsCheckChange.bind( "REFURB" ),
     260                  className: 'fu_ebay_checkbox_editor',
     261                                }
     262                            ), 
     263              el(CheckboxControl,
     264                                {
     265                                    label: __( 'Used', 'fast-ebay-listings' ),
     266                                    checked: conditionOptionUsed,
     267                                    onChange: onConditionOptionsCheckChange.bind( "USED" ),
     268                                }
     269                            ),
     270
     271              el(TextControl,
     272                                {
     273                                    type: 'number',
     274                                    label: __( 'Min Price', 'fast-ebay-listings' ) + ' (' + fuScriptBlock.ebayPriceCurrency + ')',
     275                                    value: props.attributes.minprice,
     276                                    onChange: function ( value ) {
     277                                        props.setAttributes( { minprice: value } );
     278                                    },
     279                  help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
     280                                }
     281                            ),                         
     282                            el(TextControl,
     283                                {
     284                                    type: 'number',
     285                                    label: __( 'Max Price', 'fast-ebay-listings' ) + ' (' + fuScriptBlock.ebayPriceCurrency + ')',
     286                                    value: props.attributes.maxprice,
     287                                    onChange: function ( value ) {
     288                                        props.setAttributes( { maxprice: value } );
     289                                    },
     290                  help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
     291                                }
     292                            ),
     293              el(TextControl,
     294                                {
     295                                    type: 'number',
     296                                    label: __( 'Min Auction Bids', 'fast-ebay-listings' ),
     297                                    value: props.attributes.minbids,
     298                                    onChange: function ( value ) {
     299                                        props.setAttributes( { minbids: value } );
     300                                    },
     301                  help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
     302                                }
     303                            ),                         
     304                            el(TextControl,
     305                                {
     306                                    type: 'number',
     307                                    label: __( 'Max Auction Bids', 'fast-ebay-listings' ),
     308                                    value: props.attributes.maxbids,
     309                                    onChange: function ( value ) {
     310                                        props.setAttributes( { maxbids: value } );
     311                                    },
     312                  help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
     313                                }
     314                            ),
     315                        ),
     316
     317                        el(PanelBody,
     318                            {
     319                                title: __( 'Geographic Criteria', 'fast-ebay-listings' ),
     320                                initialOpen: false
     321                            },
    212322                            el(SelectControl,
    213323                                {
     
    230340                                }
    231341                            ),
    232              
    233               el('div',
    234                 { className: 'fu_ebay_label_editor' },
    235                                 __( 'Buying Options', 'fast-ebay-listings' ),
    236                             ), 
    237               el(CheckboxControl,
    238                                 {
    239                                     label: __( 'Fixed Price', 'fast-ebay-listings' ),
    240                                     checked: buyingOptionFixedPrice,
    241                                     onChange: onBuyingOptionsCheckChange.bind( "FIXED_PRICE" ),
    242                   className: 'fu_ebay_checkbox_editor',
    243                                 }
    244                             ), 
    245               el(CheckboxControl,
    246                                 {
    247                                     label: __( 'Auction', 'fast-ebay-listings' ),
    248                                     checked: buyingOptionAuction,
    249                                     onChange: onBuyingOptionsCheckChange.bind( "AUCTION" ),
    250                   className: 'fu_ebay_checkbox_editor',
    251                                 }
    252                             ), 
    253               el(CheckboxControl,
    254                                 {
    255                                     label: __( 'Best Offer', 'fast-ebay-listings' ),
    256                                     checked: buyingOptionBestOffer,
    257                                     onChange: onBuyingOptionsCheckChange.bind( "BEST_OFFER" ),
    258                                 }
    259                             ),
    260 
    261               el('div',
    262                 { className: 'fu_ebay_label_editor' },
    263                                 __( 'Condition', 'fast-ebay-listings' ),
    264                             ), 
    265               el(CheckboxControl,
    266                                 {
    267                                     label: __( 'New', 'fast-ebay-listings' ),
    268                                     checked: conditionOptionNew,
    269                                     onChange: onConditionOptionsCheckChange.bind( "NEW" ),
    270                   className: 'fu_ebay_checkbox_editor',
    271                                 }
    272                             ), 
    273               el(CheckboxControl,
    274                                 {
    275                                     label: __( 'Refurbished', 'fast-ebay-listings' ),
    276                                     checked: conditionOptionRefurb,
    277                                     onChange: onConditionOptionsCheckChange.bind( "REFURB" ),
    278                   className: 'fu_ebay_checkbox_editor',
    279                                 }
    280                             ), 
    281               el(CheckboxControl,
    282                                 {
    283                                     label: __( 'Used', 'fast-ebay-listings' ),
    284                                     checked: conditionOptionUsed,
    285                                     onChange: onConditionOptionsCheckChange.bind( "USED" ),
    286                                 }
    287                             ),
    288 
    289               el(TextControl,
    290                                 {
    291                                     type: 'number',
    292                                     label: __( 'Min Price', 'fast-ebay-listings' ) + ' (' + fuScriptBlock.ebayPriceCurrency + ')',
    293                                     value: props.attributes.minprice,
    294                                     onChange: function ( value ) {
    295                                         props.setAttributes( { minprice: value } );
    296                                     },
     342                            el(TextControl,
     343                {
     344                  type: 'text',
     345                  label: __( 'Pickup postal code', 'fast-ebay-listings' ),
     346                  value: props.attributes.pickuppostcode,
     347                  onChange: function ( value ) {
     348                    props.setAttributes( { pickuppostcode: value } );
     349                  },
     350                  help: __( 'Display only items for local pickup near this postal code', 'fast-ebay-listings' ),
     351                }
     352              ),
     353                            el(TextControl,
     354                {
     355                  type: 'text',
     356                  label: __( 'Pickup radius', 'fast-ebay-listings' ) + ' (' + fuScriptBlock.ebayDistanceUnits + ')',
     357                  value: props.attributes.pickupradius,
     358                  onChange: function ( value ) {
     359                    props.setAttributes( { pickupradius: value } );
     360                  },
    297361                  help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
    298                                 }
    299                             ),                         
    300                             el(TextControl,
    301                                 {
    302                                     type: 'number',
    303                                     label: __( 'Max Price', 'fast-ebay-listings' ) + ' (' + fuScriptBlock.ebayPriceCurrency + ')',
    304                                     value: props.attributes.maxprice,
    305                                     onChange: function ( value ) {
    306                                         props.setAttributes( { maxprice: value } );
    307                                     },
    308                   help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
    309                                 }
    310                             ),
    311               el(TextControl,
    312                                 {
    313                                     type: 'number',
    314                                     label: __( 'Min Auction Bids', 'fast-ebay-listings' ),
    315                                     value: props.attributes.minbids,
    316                                     onChange: function ( value ) {
    317                                         props.setAttributes( { minbids: value } );
    318                                     },
    319                   help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
    320                                 }
    321                             ),                         
    322                             el(TextControl,
    323                                 {
    324                                     type: 'number',
    325                                     label: __( 'Max Auction Bids', 'fast-ebay-listings' ),
    326                                     value: props.attributes.maxbids,
    327                                     onChange: function ( value ) {
    328                                         props.setAttributes( { maxbids: value } );
    329                                     },
    330                   help: __( 'Leave blank for no filter', 'fast-ebay-listings' ),
    331                                 }
    332                             ),
     362                }
     363              ),
     364
    333365                        ),
    334                     el(PanelBody,
     366            el(PanelBody,
    335367                        {
    336368                            title: __( 'Presentation', 'fast-ebay-listings' ),
  • fast-ebay-listings/trunk/blocks/search/search.php

    r3221111 r3237345  
    2121      'searchindesc' => false,
    2222      'searchlocation' => fuItemLocation::Internationally,
     23      'pickuppostcode' => '',
     24      'pickupradius' => 0,
    2325      'seller' => '',
    2426      'sellertype' => '',
     
    4850    $apicall->setQuery($query, $searchindesc);
    4951  $apicall->setSearchLocation($searchlocation);
     52  $apicall->setPickupOptions($pickuppostcode, $pickupradius);
    5053  $apicall->setCategories($category);
    5154  $apicall->setSellers($seller);
  • fast-ebay-listings/trunk/changelog.txt

    r3221111 r3237345  
    11== Changelog ==
     2
     3= 2.12.13 =
     4Added geographic search filters for items within a radius of a pickup postal code
    25
    36= 2.12.12 =
  • fast-ebay-listings/trunk/constants.php

    r3221111 r3237345  
    55
    66define("FUBABY_EBAY_PLUGIN_TITLE", "Fast eBay Listings");
    7 define("FUBABY_EBAY_PLUGIN_VER", "2.12.12");
     7define("FUBABY_EBAY_PLUGIN_VER", "2.12.13");
    88define("FUBABY_EBAY_PLUGIN_WEBSITE", "https://www.fubaby.com/wordpress-plugins/fast-ebay-listings/");
    99define("FUBABY_EBAY_DEFAULTCAMPID", "5336840255");
  • fast-ebay-listings/trunk/fast-ebay-listings.php

    r3221111 r3237345  
    44 * Plugin URI: http://www.fubaby.com/wordpress-plugins/fast-ebay-listings/
    55 * Description: Display eBay auctions on your site, through the use of Blocks, Shortcodes and Widgets.
    6  * Version: 2.12.12
     6 * Version: 2.12.13
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
  • fast-ebay-listings/trunk/mce/mce-button-search.js

    r3221111 r3237345  
    7474      var searchindesc = v.searchindesc == 'true';
    7575      var searchlocation = v.searchlocation ? v.searchlocation : '';
     76      var pickupPostcode = v.pickupPostcode ? v.pickupPostcode : '';
     77      var pickupRadius = v.pickupRadius ? v.pickupRadius : '';
    7678            var category = v.category ? removeHtmlSpecialChars(v.category) : '';
    7779            var seller = v.seller ? removeHtmlSpecialChars(v.seller) : '';
     
    158160                  },
    159161                  {
     162                    layout: 'grid',
     163                    name: 'align',
     164                    label: editor.getLang('extrastrings.buyingOptionsLabel'),
     165                    type: 'form',
     166                    columns: '3',
     167                    spacingH: 10,
     168                    spacingV: 0,
     169                    padding: 0,
     170                    items: [
     171                      {
     172                        type: 'checkbox',
     173                        name: 'buyingOptionFixedPrice',
     174                        checked: buyingoptions.includes("FIXED_PRICE"),
     175                        label: editor.getLang('extrastrings.buyingOptionsFixedPrice'),
     176                        maxWidth: 100,
     177                        maxLength: 10,
     178                      },                       
     179                      {
     180                        type: 'checkbox',
     181                        name: 'buyingOptionAuction',
     182                        checked: buyingoptions.includes("AUCTION"),
     183                        label: editor.getLang('extrastrings.buyingOptionsAuction'),
     184                        maxWidth: 100,
     185                        maxLength: 10,
     186                      },   
     187                      {
     188                        type: 'checkbox',
     189                        name: 'buyingOptionBestOffer',
     190                        checked: buyingoptions.includes("BEST_OFFER"),
     191                        label: editor.getLang('extrastrings.buyingOptionsBestOffer'),
     192                        maxWidth: 100,
     193                        maxLength: 10,
     194                      },   
     195                    ]
     196                  },
     197                  {
     198                    layout: 'grid',
     199                    name: 'align',
     200                    label: editor.getLang('extrastrings.conditionOptionsLabel'),
     201                    type: 'form',
     202                    columns: '3',
     203                    spacingH: 10,
     204                    spacingV: 0,
     205                    padding: 0,
     206                    items: [
     207                      {
     208                        type: 'checkbox',
     209                        name: 'conditionOptionNew',
     210                        checked: conditionoptions.includes("NEW"),
     211                        label: editor.getLang('extrastrings.conditionOptionsNew'),
     212                        maxWidth: 100,
     213                        maxLength: 10,
     214                      },                       
     215                      {
     216                        type: 'checkbox',
     217                        name: 'conditionOptionRefurb',
     218                        checked: conditionoptions.includes("REFURB"),
     219                        label: editor.getLang('extrastrings.conditionOptionsRefurb'),
     220                        maxWidth: 100,
     221                        maxLength: 10,
     222                      },   
     223                      {
     224                        type: 'checkbox',
     225                        name: 'conditionOptionUsed',
     226                        checked: conditionoptions.includes("USED"),
     227                        label: editor.getLang('extrastrings.conditionOptionsUsed'),
     228                        maxWidth: 100,
     229                        maxLength: 10,
     230                      },   
     231                    ]
     232                  },
     233                  {
     234                    layout: 'grid',
     235                    name: 'align',
     236                    label: editor.getLang('extrastrings.minMaxPriceLabel'),
     237                    type: 'form',
     238                    columns: '2',
     239                    spacingH: 10,
     240                    spacingV: 0,
     241                    padding: 0,
     242                    items: [
     243                      {
     244                        type: 'textbox',
     245                        subtype: 'number',
     246                        name: 'minprice',
     247                        value: minprice,
     248                        tooltip: editor.getLang('extrastrings.minMaxPriceToolTip'),
     249                        maxWidth: 100,
     250                        maxLength: 10,
     251                      },                       
     252                      {
     253                        type: 'textbox',
     254                        subtype: 'number',
     255                        name: 'maxprice',
     256                        value: maxprice,
     257                        tooltip: editor.getLang('extrastrings.minMaxPriceToolTip'),
     258                        maxWidth: 100,
     259                        maxLength: 10,
     260                      },   
     261                    ]
     262                  },
     263                  {
     264                    layout: 'grid',
     265                    name: 'align',
     266                    label: editor.getLang('extrastrings.minMaxBidsLabel'),
     267                    type: 'form',
     268                    columns: '2',
     269                    spacingH: 10,
     270                    spacingV: 0,
     271                    padding: 0,
     272                    items: [
     273                      {
     274                        type: 'textbox',
     275                        subtype: 'number',
     276                        name: 'minbids',
     277                        value: minbids,
     278                        tooltip: editor.getLang('extrastrings.minMaxBidsToolTip'),
     279                        maxWidth: 100,
     280                        maxLength: 10,
     281                      },                       
     282                      {
     283                        type: 'textbox',
     284                        subtype: 'number',
     285                        name: 'maxbids',
     286                        value: maxbids,
     287                        tooltip: editor.getLang('extrastrings.minMaxBidsToolTip'),
     288                        maxWidth: 100,
     289                        maxLength: 10,
     290                      },   
     291                    ]
     292                  },
     293               ]
     294              },
     295              // Geographic Search Criteria Tab Panel
     296              {
     297                title: editor.getLang('extrastrings.geoTabTitle'),
     298                type: 'form',
     299                items: [
     300                  {
    160301                    type: 'listbox',
    161302                    name: 'searchlocation',
     
    174315                  },
    175316                  {
    176                     layout: 'grid',
    177                     name: 'align',
    178                     label: editor.getLang('extrastrings.buyingOptionsLabel'),
    179                     type: 'form',
    180                     columns: '3',
    181                     spacingH: 10,
    182                     spacingV: 0,
    183                     padding: 0,
    184                     items: [
    185                       {
    186                         type: 'checkbox',
    187                         name: 'buyingOptionFixedPrice',
    188                         checked: buyingoptions.includes("FIXED_PRICE"),
    189                         label: editor.getLang('extrastrings.buyingOptionsFixedPrice'),
    190                         maxWidth: 100,
    191                         maxLength: 10,
    192                       },                       
    193                       {
    194                         type: 'checkbox',
    195                         name: 'buyingOptionAuction',
    196                         checked: buyingoptions.includes("AUCTION"),
    197                         label: editor.getLang('extrastrings.buyingOptionsAuction'),
    198                         maxWidth: 100,
    199                         maxLength: 10,
    200                       },   
    201                       {
    202                         type: 'checkbox',
    203                         name: 'buyingOptionBestOffer',
    204                         checked: buyingoptions.includes("BEST_OFFER"),
    205                         label: editor.getLang('extrastrings.buyingOptionsBestOffer'),
    206                         maxWidth: 100,
    207                         maxLength: 10,
    208                       },   
    209                     ]
    210                   },
    211                   {
    212                     layout: 'grid',
    213                     name: 'align',
    214                     label: editor.getLang('extrastrings.conditionOptionsLabel'),
    215                     type: 'form',
    216                     columns: '3',
    217                     spacingH: 10,
    218                     spacingV: 0,
    219                     padding: 0,
    220                     items: [
    221                       {
    222                         type: 'checkbox',
    223                         name: 'conditionOptionNew',
    224                         checked: conditionoptions.includes("NEW"),
    225                         label: editor.getLang('extrastrings.conditionOptionsNew'),
    226                         maxWidth: 100,
    227                         maxLength: 10,
    228                       },                       
    229                       {
    230                         type: 'checkbox',
    231                         name: 'conditionOptionRefurb',
    232                         checked: conditionoptions.includes("REFURB"),
    233                         label: editor.getLang('extrastrings.conditionOptionsRefurb'),
    234                         maxWidth: 100,
    235                         maxLength: 10,
    236                       },   
    237                       {
    238                         type: 'checkbox',
    239                         name: 'conditionOptionUsed',
    240                         checked: conditionoptions.includes("USED"),
    241                         label: editor.getLang('extrastrings.conditionOptionsUsed'),
    242                         maxWidth: 100,
    243                         maxLength: 10,
    244                       },   
    245                     ]
    246                   },
    247                   {
    248                     layout: 'grid',
    249                     name: 'align',
    250                     label: editor.getLang('extrastrings.minMaxPriceLabel'),
    251                     type: 'form',
    252                     columns: '2',
    253                     spacingH: 10,
    254                     spacingV: 0,
    255                     padding: 0,
    256                     items: [
    257                       {
    258                         type: 'textbox',
    259                         subtype: 'number',
    260                         name: 'minprice',
    261                         value: minprice,
    262                         tooltip: editor.getLang('extrastrings.minMaxPriceToolTip'),
    263                         maxWidth: 100,
    264                         maxLength: 10,
    265                       },                       
    266                       {
    267                         type: 'textbox',
    268                         subtype: 'number',
    269                         name: 'maxprice',
    270                         value: maxprice,
    271                         tooltip: editor.getLang('extrastrings.minMaxPriceToolTip'),
    272                         maxWidth: 100,
    273                         maxLength: 10,
    274                       },   
    275                     ]
    276                   },
    277                   {
    278                     layout: 'grid',
    279                     name: 'align',
    280                     label: editor.getLang('extrastrings.minMaxBidsLabel'),
    281                     type: 'form',
    282                     columns: '2',
    283                     spacingH: 10,
    284                     spacingV: 0,
    285                     padding: 0,
    286                     items: [
    287                       {
    288                         type: 'textbox',
    289                         subtype: 'number',
    290                         name: 'minbids',
    291                         value: minbids,
    292                         tooltip: editor.getLang('extrastrings.minMaxBidsToolTip'),
    293                         maxWidth: 100,
    294                         maxLength: 10,
    295                       },                       
    296                       {
    297                         type: 'textbox',
    298                         subtype: 'number',
    299                         name: 'maxbids',
    300                         value: maxbids,
    301                         tooltip: editor.getLang('extrastrings.minMaxBidsToolTip'),
    302                         maxWidth: 100,
    303                         maxLength: 10,
    304                       },   
    305                     ]
    306                   },
    307                ]
     317                    type: 'textbox',
     318                    name: 'pickupPostcode',
     319                    label: editor.getLang('extrastrings.pickupPostcodeTitleLabel'),
     320                    value: pickupPostcode,
     321                    tooltip: editor.getLang('extrastrings.pickupPostcodeTitleToolTip'),
     322                  },                       
     323                  {
     324                    type: 'textbox',
     325                    subtype: 'number',
     326                    name: 'pickupRadius',
     327                    label: editor.getLang('extrastrings.pickupRadiusLabel'),
     328                    value: pickupRadius,
     329                    tooltip: editor.getLang('extrastrings.pickupRadiusToolTip'),
     330                    minWidth: 290,
     331                  },                 
     332                ]
    308333              },
    309334              // Presentation Tab Panel
     
    441466          if (typeof e.data.searchlocation != 'undefined' && e.data.searchlocation.length)
    442467            shortcode_str += ' searchlocation="' + e.data.searchlocation + '"';
     468          // check for pickup options
     469          if (typeof e.data.pickupPostcode != 'undefined' && e.data.pickupPostcode.length)
     470            shortcode_str += ' pickupPostcode="' + e.data.pickupPostcode + '"';
     471          if (typeof e.data.pickupRadius != 'undefined' && e.data.pickupRadius.length)
     472            shortcode_str += ' pickupRadius="' + e.data.pickupRadius + '"';
    443473          // check for category
    444474          if (typeof e.data.category != 'undefined' && e.data.category.length)
     
    528558          searchindesc : getAttr(data, 'searchindesc'),
    529559          searchlocation : getAttr(data, 'searchlocation'),
     560          pickupPostcode : getAttr(data, 'pickupPostcode'),
     561          pickupRadius : getAttr(data, 'pickupRadius'),
    530562                    category : getAttr(data,'category'),
    531563                    seller : getAttr(data,'seller'),
  • fast-ebay-listings/trunk/readme.txt

    r3225112 r3237345  
    88Tested up to: 6.7
    99Requires PHP: 7.4
    10 Stable tag: 2.12.12
     10Stable tag: 2.12.13
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    244244== Changelog ==
    245245
     246= 2.12.13 =
     247Added geographic search filters for items within a radius of a pickup postal code
     248
    246249= 2.12.12 =
    247250Added support to filter search results by condition (new, used etc).
  • fast-ebay-listings/trunk/shortcode-lang-file.php

    r3221111 r3237345  
    55
    66$globalId = get_option('fubaby_ebayGlobalID');
     7$distanceUnits = $globalId == "EBAY-US" || $globalId == "EBAY-GB" ?  "miles" : "km";
    78
    89$defaultSellerType = get_option('fubaby_ebayDefSellerType', fuEbaySellerType::Any);
     
    3132    variationToolTip: "' . esc_js( __( 'Tick if the eBay item has sub-options, e.g. size, color.', 'fast-ebay-listings' ) ) . '",
    3233    searchTabTitle: "' . esc_js( __( 'Search Criteria', 'fast-ebay-listings' ) ) . '",
     34    geoTabTitle: "' . esc_js( __( 'Geographic Criteria', 'fast-ebay-listings' ) ) . '",
    3335    presentationTabTitle: "' . esc_js( __( 'Presentation', 'fast-ebay-listings' ) ) . '",
    3436    feedbackCommentsTabTitle: "' . esc_js( __( 'Feedback Comments', 'fast-ebay-listings' ) ) . '",
     
    6264    searchLocation' . fuEbayItemLocation::NorthAmerica . ': "' . fuEbayItemLocation::$Labels[fuEbayItemLocation::NorthAmerica] . '",
    6365    searchLocation' . fuEbayItemLocation::UKIre . ': "' . fuEbayItemLocation::$Labels[fuEbayItemLocation::UKIre] . '",
     66    pickupPostcodeTitleLabel: "' . esc_js( __( 'Pickup postal code', 'fast-ebay-listings' ) ) . '",
     67    pickupPostcodeTitleToolTip: "' . esc_js( __( 'Display only items for local pickup near this postal code', 'fast-ebay-listings' ) ) . '",
     68    pickupRadiusLabel: "' . esc_js( __( 'Pickup radius', 'fast-ebay-listings' ) ) . ' (' . $distanceUnits .')",
     69    pickupRadiusToolTip: "' . esc_js( __( 'Display only items for local pickup within given radius', 'fast-ebay-listings' ) ) . '",
    6470    rssLabel: "' . esc_js( __( 'RSS Feed', 'fast-ebay-listings' ) ) . '",
    6571    rssToolTip: "' . esc_js( __( 'RSS Feed URI (e.g. from RSSGround.com or AuctionRequest)', 'fast-ebay-listings' ) ) . '",
  • fast-ebay-listings/trunk/shortcode-search.php

    r3221111 r3237345  
    3232     */
    3333    function shortcode_handler($atts , $content = null){
    34         // Attributes
     34        // Attributes (must be lower case)
    3535    extract(shortcode_atts(array(
    3636        'category' => '',
     
    3838        'searchindesc' => false,
    3939        'searchlocation' => '',
     40        'pickuppostcode' => '',
     41        'pickupradius' => 0,
    4042        'seller' => '',
    4143        'sellertype' => '',
     
    6567    $apicall->setQuery($query, $searchindesc);
    6668    $apicall->setSearchLocation($searchlocation);
     69    $apicall->setPickupOptions($pickuppostcode, $pickupradius);
    6770    $apicall->setCustomId($customid);
    6871    $apicall->setCategories($category);
  • fast-ebay-listings/trunk/utilities.php

    r3144949 r3237345  
    113113  wp_register_script('fu_ebay_block_script', '', array(), FUBABY_EBAY_PLUGIN_VER, false);   
    114114  wp_enqueue_script('fu_ebay_block_script');
     115
     116  $globalId = get_option('fubaby_ebayGlobalID');
    115117  wp_localize_script('fu_ebay_block_script', 'fuScriptBlock', array(
    116118        'adminAjaxUrl' => admin_url('admin-ajax.php'),
     
    124126    'ebayPicWidthList' => get_option("fubaby_ebayPicWidthList"),
    125127    'ebayDefNumSlides' => get_option("fubaby_ebayDefNumSlides"),
    126     'ebayPriceCurrency' => fuEbayGlobal::CurrencyCodes[ get_option('fubaby_ebayGlobalID') ],
     128    'ebayPriceCurrency' => fuEbayGlobal::CurrencyCodes[ $globalId ],
     129    'ebayDistanceUnits' => $globalId == "EBAY-US" || $globalId == "EBAY-GB" ?  "miles" : "km",
    127130    ));
    128131}
Note: See TracChangeset for help on using the changeset viewer.