kamiar3712
دوشنبه 05 آبان 1393, 16:50 عصر
سلام دوباره دوستان
در وردرپرس و افزونه ووکامرس:
برای بخش کارمزد بنده افزونه تخفیف را woocommerce-bulk-discount به کارمزد تغییر دادم یعنی در بخشی که قرار است بصورت تخفیف مبلغ کسر شود, مبلغ اضافه میشود:
public function filter_cart_product_subtotal( $subtotal, $_product, $quantity ) {
if ( !$_product || !$quantity ) {
return $subtotal;
}
if ( $this->coupon_check() ) {
return $subtotal;
}
if ( get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) != '' && get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) !== 'yes' ) {
return $subtotal;
}
$coeff = $this->discount_coeffs[$this->get_actual_id( $_product )]['coeff'];
if ( ( get_option( 'woocommerce_t4m_discount_type', '' ) == 'flat' ) ) {
$newsubtotal = woocommerce_price( max( 0, ( $_product->get_price() * $quantity ) + $coeff ) );
} else {
$newsubtotal = woocommerce_price( $_product->get_price() * $quantity * $coeff );
}
return $newsubtotal;
همان طور که متوجه شده اید با + $coeff مبلغ اضافه میشود و اتفاقا در صدور
فاکتور در ردیف کالا, مشکلی وجود ندارد و بدرستی کارمزد اضافه میشود اما در
جمع کل سبد خرید دوباره مبلغ کسر میشود و بشکلی که انگار مبلغ کالا به
صورت تخفیف محاسبه شده, بیان میشود.
در تصویر هم مشخص است.
http://s5.picofile.com/file/8147425292/Error.JPG (http://go.persianscript.ir/index.php?url=http://s5.picofile.com/file/8147425292/Error.JPG)
دوستان نظری دارند؟
مشکل بسیار کوچک است و شاید یکساعت کار داشته باشد اما متاسفانه به علت درگیری کاری نمیتوانم وقت برای آن بگذارم.
اگر عزیزی میتواند مورد را حل کند لطفا هزینه را پ.خ کند.
در وردرپرس و افزونه ووکامرس:
برای بخش کارمزد بنده افزونه تخفیف را woocommerce-bulk-discount به کارمزد تغییر دادم یعنی در بخشی که قرار است بصورت تخفیف مبلغ کسر شود, مبلغ اضافه میشود:
public function filter_cart_product_subtotal( $subtotal, $_product, $quantity ) {
if ( !$_product || !$quantity ) {
return $subtotal;
}
if ( $this->coupon_check() ) {
return $subtotal;
}
if ( get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) != '' && get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) !== 'yes' ) {
return $subtotal;
}
$coeff = $this->discount_coeffs[$this->get_actual_id( $_product )]['coeff'];
if ( ( get_option( 'woocommerce_t4m_discount_type', '' ) == 'flat' ) ) {
$newsubtotal = woocommerce_price( max( 0, ( $_product->get_price() * $quantity ) + $coeff ) );
} else {
$newsubtotal = woocommerce_price( $_product->get_price() * $quantity * $coeff );
}
return $newsubtotal;
همان طور که متوجه شده اید با + $coeff مبلغ اضافه میشود و اتفاقا در صدور
فاکتور در ردیف کالا, مشکلی وجود ندارد و بدرستی کارمزد اضافه میشود اما در
جمع کل سبد خرید دوباره مبلغ کسر میشود و بشکلی که انگار مبلغ کالا به
صورت تخفیف محاسبه شده, بیان میشود.
در تصویر هم مشخص است.
http://s5.picofile.com/file/8147425292/Error.JPG (http://go.persianscript.ir/index.php?url=http://s5.picofile.com/file/8147425292/Error.JPG)
دوستان نظری دارند؟
مشکل بسیار کوچک است و شاید یکساعت کار داشته باشد اما متاسفانه به علت درگیری کاری نمیتوانم وقت برای آن بگذارم.
اگر عزیزی میتواند مورد را حل کند لطفا هزینه را پ.خ کند.