زيادة المبيعات عبر الإنترنت – الطريقة الثانية

زيادة المبيعات عبر الإنترنت مع التقنية الثانية

في هذه الطريقة تظهر رسالة للعميل في سلة التسوق وفي صفحة الدفع مفادها أنه في حالة تجاوز مبلغ الشراء المبلغ المطلوب، سيتم منح هدية قيمة تلقائيًا للمستخدم. ليقوم النظام تلقائيًا باعتبار منتج هدية للمستخدم من الرمز الترويجي الطريقة الأولى للبيع عبر الإنترنت استفاده کنید اما از همین کد می توانید به صورتی دیگر هم استفاده کنید، یک روش ارسال رایگان با مبلغ مشخص ایجاد کنید و متن پیام را به این صورت تغییر دهید، در صورت خرید بیش از مبلغ تعیین شده، ارسال شما رایگان خواهد شد   این کد را باید در انتهای فایل فانکشن خود قرار بدید و آن را ذخیره کنید.

// 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="/ar/%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="/ar/%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;
	}
}

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

 
الدردشة عبر الإنترنت

نحن على استعداد للإجابة على أسئلتك