Online-Verkäufe steigern – Methode zwei

Steigern Sie den Online-Umsatz mit der zweiten Technik

Bei dieser Methode zeigen Sie dem Kunden im Warenkorb und auf der Bezahlseite einen Hinweis an, dass ihm automatisch ein wertvolles Geschenk gutgeschrieben wird, wenn der Kaufbetrag den gewünschten Betrag übersteigt. Damit das System anhand des Aktionscodes automatisch ein Geschenkprodukt für den Benutzer berücksichtigt Die erste Methode des Online-Verkaufs استفاده کنید اما از همین کد می توانید به صورتی دیگر هم استفاده کنید، یک روش ارسال رایگان با مبلغ مشخص ایجاد کنید و متن پیام را به این صورت تغییر دهید، در صورت خرید بیش از مبلغ تعیین شده، ارسال شما رایگان خواهد شد   این کد را باید در انتهای فایل فانکشن خود قرار بدید و آن را ذخیره کنید.

// Show "XX to free shipping or gift" notification in Woocommerce
add_action( 'woocommerce_before_cart_table', 'cart_page_notice' );
 
function cart_page_notice() {
	$min_amount = 2000000; //This is the amount of your free shipping threshold. Change according to your free shipping settings
	$current = WC()->cart->subtotal;
	if ( $current < $min_amount ) {
	$added_text = '<div class="woocommerce-message"><strong>Buy  ' . wc_price( $min_amount - $current ) . ' more, get your gift and send it for free</strong>'; // This is the message shown on the cart page
	$return_to = wc_get_page_permalink( 'shop' );
	$notice = sprintf( '%s<a class="button" href="/de/%s/">%s</a>', $added_text, esc_url( $return_to ), 'Add product</div>' ); // This is the text shown below the notification. Link redirects to the shop page
	echo $notice;
	}
}



add_action( 'woocommerce_before_checkout_form', 'Rezvan_add_checkout_content', 11 );
function Rezvan_add_checkout_content() {
	$min_amount = 2000000; //This is the amount of your free shipping threshold. Change according to your free shipping settings
	$current = WC()->cart->subtotal;
	if ( $current < $min_amount ) {
	$added_text = '<div class="woocommerce-message"><strong>Buy  ' . wc_price( $min_amount - $current ) . ' more, get your gift and send it for free</strong>'; // This is the message shown on the cart page
	$return_to = wc_get_page_permalink( 'shop' );
	$notice = sprintf( '%s<a class="button" href="/de/%s/">%s</a>', $added_text, esc_url( $return_to ), 'Add product</div>' ); // This is the text shown below the notification. Link redirects to the shop page
	echo $notice;
	}
}

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

 
Online-Chat

Wir sind bereit, Ihre Fragen zu beantworten