Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter leoria

    (@leoria)

    Hallo,

    zunächst wünsche ich Ihnen ein frohes neues Jahr 2018!

    Das o.g. Problem haben wir durch Eigenentwicklung gelöst. Hierfür anhand der Kalkulation des Gesamtgewichtes im Warenkorb ‘$woocommerce->cart->cart_contents_weight’ die Regeln erstellt.

    Allerdings haben wir ein anderes Problem mit den Maßen über 120x60x30 cm festgestellt. Können Sie sich bitte das neue Topic anschauen?

    Nachfolgend ist unser Lösungsansatz (/woocommerce/cart/cart-shipping.php):

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit;
    }
    ?>
    <tr class=”shipping”>
    <th><?php echo wp_kses_post( $package_name ); ?></th>
    <td data-title=”<?php echo esc_attr( $package_name ); ?>”>
    <?php if ( 1 < count( $available_methods ) ) : ?>
    <ul id=”shipping_method”>
    <?php
    // **************** Cusomizing LEORIA
    ?>
    <?php foreach ( $available_methods as $method ) : ?>

    <?php

    global $woocommerce;
    $max_weight = 31.5;
    $versanddienstleister = esc_attr( $method->id );
    //echo $versanddienstleister;
    $spedition = ‘awd_shipping’ ;
    //awd_shipping aus dem Plugin ‘oik Weight/Country Shipping’

    /** Lieferung per Spedition */
    if ( $woocommerce->cart->cart_contents_weight > $max_weight && $versanddienstleister == $spedition) { ?>

    • <?php
      //echo ‘ ‘ . ‘Spedition-Lieferung!’ . ‘ ‘;
      //echo $versanddienstleister;
      printf( ‘<input type=”radio” name=”shipping_method[%1$d]” data-index=”%1$d” id=”shipping_method_%1$d_%2$s” value=”%3$s” class=”shipping_method” %6$s />
      <label for=”shipping_method_%1$d_%2$s”>%5$s</label>’,
      $index, sanitize_title( $method->id ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ), wc_cart_totals_shipping_method_label( $method ), ‘checked=”checked”‘ );
      }

      /** Lieferung per andere Dienstleister */
      if ( $woocommerce->cart->cart_contents_weight < $max_weight && $versanddienstleister != $spedition) { ?>

    • <?php
      //echo ‘ ‘ . ‘andere Dienstleister!’ . ‘ ‘;
      //echo $versanddienstleister;
      printf( ‘<input type=”radio” name=”shipping_method[%1$d]” data-index=”%1$d” id=”shipping_method_%1$d_%2$s” value=”%3$s” class=”shipping_method” %4$s />
      <label for=”shipping_method_%1$d_%2$s”>%5$s</label>’,
      $index, sanitize_title( $method->id ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ), wc_cart_totals_shipping_method_label( $method ) );
      }

      // **************** Gustomizing LEORIA Ende

      do_action( ‘woocommerce_after_shipping_rate’, $method, $index );
      ?>

    • <?php endforeach; ?>

      ……..

    Thread Starter leoria

    (@leoria)

    Hallo André,

    wäre es möglich das Plugin um die Funktion zu erweitern, dass z.B. eine Benachrichtigung stattfindet, wenn das Gesamtgewicht aller Produkte 31,5 kg übersteigt oder dass man automatisch auf eine alternative Versandmethode abspringt deren Attribute man selber definieren kann?

    Wir könnten auch unser Problem mit einer Limitierung der im Warenkorb befindlichen Produkte nach Gewicht lösen, aber leider finden wir kein passendes Plugin dazu. Es gibt zwar Plugins die eine Limitierung der Produkte im Warenkorb nach Anzahl festlegen, aber nicht nach dem Gewicht.

    Können Sie uns weiterhelfen?

    Thread Starter leoria

    (@leoria)

    Hallo @andrecedik,

    vielen Dank für das schnelle Feedback.

Viewing 3 replies - 1 through 3 (of 3 total)