• Resolved mumbomedia

    (@mumbomedia)


    Hallo

    habe folgendes Problem:
    In einem mehrsprachigen Kunden-Shop (WPML installiert) soll es Produkte geben, die kostenlos versendet werden.
    Es gibt allerdings auch Produkte für die eine Versandkostenpauschale gelten soll.

    Bei Versand sind derzeit die Versandmethoden “Kostenlose Lieferung” eingestellt.
    Für die Ausnahmen wurde bereits eine Versandklasse eingerichtet und zugeordnet.
    Jedoch steht bei diesen Produkten neben der Pauschale auch die Option “Kostenlose Lieferung” zur Auswahl. Dies soll nicht m?glich sein.

    Was müsste eingestellt werden, damit bei den Produkten mit der Versandklasse, die Option “Kostenloser Versand” nicht mehr zur Auswahl steht.

    Habe auch schon probiert, bei Versandmethoden neben kostenlosen Versand auch Pauschale zuzulassen. Anscheinend gilt dies Einstellung aber für alle Produkte.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there!

    Thanks for all of that detail! I don’t speak German well, so will respond in English.

    To summarize, the problem is that while some products are set for free shipping, when they are combined in a cart with products which don’t qualify for free shipping, the free shipping option is still available.

    Having some products ship for free and others not can be a bit tricky. This article offers a few different suggestions:
    https://metorik.com/blog/apply-free-shipping-to-certain-products-in-woocommerce

    Which one have you already tried?

    Thread Starter mumbomedia

    (@mumbomedia)

    @fernashes

    thank you for the fast respond and the interesting article.
    It’s no problem I also speak english well.

    I have found a solution myself by using the built in shipping classes.
    I use one for the products that have free shipping and the other for the few products that need a shipping flatrate.

    There was only a small display issue.
    Woocommerce will display the method name as defined in the wordpress backend, which default is “Versandkostenpauschale” for a flatrate shipping it will be display even if the price is set to 0.

    To change that I’ve added the following snippet to my child themes functions.php:

    /**
     * Setzt Versandmethoden-Label auf das Woocommerce Standardlabel für kostenlosen Versand wenn der Preis der Methode <= 0 ist.
     * @param string $label Label der Versandmethode (Standard: Versandkostenpauschale)
     * @param WC_Shipping_Rate $method Versandmethode
     */
    function mjm_woocommerce_cart_shipping_method_full_label($label,$method){
    	/* Prüfen ob die Kosten der Versandmethode <= 0 sind */
    	if($method->cost <= 0){
    		/* Auf Standardwert für kostenlosen Versand stellen */
    		$label = __('Free Shipping','woocommerce');
    	}
    	return $label;
    }
    add_filter('woocommerce_cart_shipping_method_full_label','mjm_woocommerce_cart_shipping_method_full_label',10,2);

    In Deutsch:
    vielen Dank für die schnelle Rückmeldung und den interessanten Artikel.
    Ihre Antwort war kein Problem, da ich auch Englisch gut beherrsche.

    Ich habe selbst eine L?sung gefunden, indem ich die integrierten Versandklassen benutze. Ich verwende eine Klasse für die Produkte die kostenlos versendet werden und eine weitere für die wenigen Produkte für die eine Versandkostenpauschale ben?tigt wird.

    Es gab nur ein kleines Anzeige-Problem.
    Woocommerce zeigt den Methodenname der Versandart wie im Woocommerce Backend an, welcher standardm??ig “Versandkostenpauschale” für pauschale Versandkosten ist, auch wenn der Preis hierfür auf 0 eingestellt ist.

    Um dies zu ?ndern habe ich folgendes Snippet zu der functions.php meines Child-Themes hinzugefügt:

    /**
     * Setzt Versandmethoden-Label auf das Woocommerce Standardlabel für kostenlosen Versand wenn der Preis der Methode <= 0 ist.
     * @param string $label Label der Versandmethode (Standard: Versandkostenpauschale)
     * @param WC_Shipping_Rate $method Versandmethode
     */
    function mjm_woocommerce_cart_shipping_method_full_label($label,$method){
    	/* Prüfen ob die Kosten der Versandmethode <= 0 sind */
    	if($method->cost <= 0){
    		/* Auf Standardwert für kostenlosen Versand stellen */
    		$label = __('Free Shipping','woocommerce');
    	}
    	return $label;
    }
    add_filter('woocommerce_cart_shipping_method_full_label','mjm_woocommerce_cart_shipping_method_full_label',10,2);
    • This reply was modified 6 years, 4 months ago by mumbomedia. Reason: Kommentare zum besseren Verst?ndnis hinzugefügt
    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    Thanks for switching to English – your English is far better than my German!

    I’m glad to hear you’ve solved it. Thank you for taking the time to explain.

    Thread Starter mumbomedia

    (@mumbomedia)

    You’re welcome

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Kostenloser Versand / Versandpauschale pro Produkt einstellen’ is closed to new replies.