وردپرس

Use Woo functions to determine “unpaid” status


Your plugin is hard coding a check for “pending” status which means that custom order statuses are not working as intended. For “customer invoice” email, the following code is used:

	if ( $order->has_status( 'pending' ) ) {

This means I cannot add my own order status. If this was changed to follow the Woo approach, then custom order statuses could be used:

needs_payment() ) { ?>

The “needs_payment” function uses

$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this );

which gives other plugins the option to add an upaid status with the filter.

Or you could add your own filter to allow 3rd party plugin providers to add their own status.

Thank you for considering my suggestion!

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا