Changeset 3259042
- Timestamp:
- 03/20/2025 10:12:55 AM (13 months ago)
- Location:
- fuvar-hu-api/trunk
- Files:
-
- 3 edited
-
fuvarhu.php (modified) (1 diff)
-
inc/shipping_method.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fuvar-hu-api/trunk/fuvarhu.php
r3110987 r3259042 5 5 Plugin URI: https://app.fuvar.hu 6 6 description: Bővítmény segítségével hozzáadhatod a fuvar.hu által kínált szolgáltatásokat a webshopodhoz 7 Version: 2 7 Version: 2.1 8 8 Author: Fuvar.hu 9 9 License: GPL2 -
fuvar-hu-api/trunk/inc/shipping_method.php
r3110987 r3259042 10 10 $methods[ 'fuvarhu_aut_dpd' ] = 'WC_Shipping_fuvarhu_AUT_DPD'; 11 11 $methods[ 'fuvarhu_aut_pck' ] = 'WC_Shipping_fuvarhu_AUT_PCK'; 12 $methods[ 'fuvarhu_aut_fxp' ] = 'WC_Shipping_fuvarhu_AUT_FXP'; 12 13 13 14 return $methods; … … 243 244 } 244 245 246 if(!class_exists("WC_Shipping_fuvarhu_AUT_FXP")){ 247 class WC_Shipping_fuvarhu_AUT_PCK extends WC_Shipping_Method { 248 public function __construct( $instance_id = 0 ) { 249 $this->id = 'fuvarhu_aut_fxp'; 250 $this->instance_id = absint( $instance_id ); 251 $this->method_title = __( 'Fuvar.hu - Automata (Foxpost)' ); 252 $this->method_description = __( 'Foxpost Automata a Fuvar.hu szerződött partnere által' ); 253 $this->supports = array( 254 'shipping-zones', 255 'instance-settings', 256 ); 257 $this->instance_form_fields = array( 258 'enabled' => array( 259 'title' => __( 'Engedélyezve' ), 260 'type' => 'checkbox', 261 'label' => __( 'Szállítási mód engedélyezése' ), 262 'default' => 'yes', 263 ), 264 'shipping_fee' => array( 265 'title' => __( 'Szállítás összege' ), 266 'type' => 'number', 267 'description' => __( 'A vevőre terhelt szállítási díj' ), 268 'default' => __( '0' ), 269 'desc_tip' => true 270 ) 271 ); 272 $this->enabled = $this->get_option( 'enabled' ); 273 $this->title = 'Automata (Foxpost)'; 274 275 add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) ); 276 } 277 278 public function calculate_shipping( $package = array() ) { 279 $this->add_rate( array( 280 'id' => $this->id . $this->instance_id, 281 'label' => $this->title, 282 'cost' => $this->get_option('shipping_fee'), 283 ) ); 284 } 285 } 286 } 287 245 288 246 289 if(!class_exists("WC_Shipping_fuvarhu_POP")){ … … 411 454 } 412 455 456 if(strpos($chosen_method_id,"fuvarhu_aut_fxp") !== false){ 457 $selected = "aut"; 458 } 459 413 460 if($selected != "haz" && ($selected == "pos" || $selected == "csp" || $selected = "pop" || $selected = "aut")){ 414 461 if(!isset($_POST['pickup_store']) || empty($_POST['pickup_store'])){ … … 422 469 function fuvarhu_pickup_store_custom_field( $method, $index ) { 423 470 424 if( is_cart() || !in_array($method->method_id, ["fuvarhu_csp","fuvarhu_pop","fuvarhu_pos","fuvarhu_aut_dpd","fuvarhu_aut_pck" ]) )471 if( is_cart() || !in_array($method->method_id, ["fuvarhu_csp","fuvarhu_pop","fuvarhu_pos","fuvarhu_aut_dpd","fuvarhu_aut_pck","fuvarhu_aut_fxp"]) ) 425 472 return; 426 473 … … 461 508 $provider = "pck"; 462 509 $show_for = "fuvarhu_aut_pck"; 510 } 511 512 if(strpos($chosen_method_id,"fuvarhu_aut_fxp") !== false){ 513 $selected = "aut"; 514 $provider = "fxp"; 515 $show_for = "fuvarhu_aut_fxp"; 463 516 } 464 517 … … 499 552 } 500 553 501 if(sizeof($options) > 0){ 502 echo '<div class="wrapper-pickup_store" style="margin-top:8px; margin-bottom:16px">'; 503 504 echo "<p><small>max. 20kg súlyig</small></p>"; 505 506 echo'<label class="title">' . __("Kérlek, válassz kézbesítési pontot") . ':</label> 507 <select name="pickup_store" style="width: 100%; padding: 10px; border: 1px solid #000">'; 508 echo"<option value='' disabled selected>Kérlek, válassz egy kézbesítési pontot</option>"; 554 555 echo '<div class="wrapper-pickup_store" style="margin-top:8px; margin-bottom:16px">'; 556 557 echo "<p><small>max. 20kg súlyig</small></p>"; 558 559 echo'<label class="title">' . __("Kérlek, válassz kézbesítési pontot") . ':</label> 560 <select name="pickup_store" style="width: 100%; padding: 10px; border: 1px solid #000" class="fuvarhu-select">'; 561 echo"<option value='' disabled selected>Kérlek, válassz egy kézbesítési pontot</option>"; 562 if(sizeof($options) > 0){ 509 563 foreach ($options as $key => $value) { 510 564 echo "<option value='".$key."'>".$value."</option>"; 511 565 } 512 echo'</select> 513 </div>'; 514 } 515 } 516 } 517 566 }else{ 567 echo"<option value='' disabled selected>A pontok lekérdezése sikertelen volt</option>"; 568 } 569 echo'</select> 570 </div>'; 571 572 echo'<script>jQuery(document).ready(function() { if(jQuery.fn.select2) {jQuery(".fuvarhu-select").select2();}});</script>'; 573 574 } 575 } 576 -
fuvar-hu-api/trunk/readme.txt
r3110992 r3259042 4 4 Requires at least: 5.6.1 5 5 Tested up to: 6.1 6 Stable tag: 2 6 Stable tag: 2.1 7 7 Requires PHP: 8.1 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.