• Resolved eWallz

    (@archonic08)


    Maybe its a bug. With just this plugin and woo activated. The complete check icon in the Action column still showing even when the orders had already completed. If i disable this plugin, the check icon not showing for completed order as it should. Please check.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks for sending in your support topic.

    Our team will be looking into things shortly. For faster and better support, please provide your WooCommerce Status Report (provide link to the instructions on WooCommerce), screenshot, error info, and visit our site’s support section for additional help. Due to forum policies, we are not able to share any credentials, provide files/patches, or sensitive information.

    Thank you,

    Alfred

    Plugin Support mathdaniel

    (@mathdaniel)

    Hi eWallz,

    I hope you’re doing well.

    Thank you for reporting this issue. We will address this in the next version, which will also include new features to complement what is currently offered.

    Best regards,
    Peace!

    Plugin Support mathdaniel

    (@mathdaniel)

    Hello,

    I hope you are doing well.

    As we haven’t received a recent response, I’ll mark this as resolved. Feel free to open a new ticket if you continue encountering issues or reopen this ticket.

    We’d be happy to assist. Thank you!

    Best regards, peace!

    Until the new version is released, it can be resolved by changing a function in a file
    bp-custom-order-status-for-woocommerce/src/Status.php

    I have updated the function so that, in this case, the custom order status does not appear if it is marked as completed.






    /**

    ?* Add custom status to order actions buttons.

    ?*

    ?* @param ?array ? $actions - array of actions.

    ?* @param ?object ?$order ?- order object.

    ?* @return array

    ?*/

    public function add_custom_status_actions_buttons( $actions, $order ) {

    ? ? // Obtener la lista de estados personalizados que el usuario quiere agregar en la columna de acciones de pedidos

    ? ? $statuses = $this->wcbvCustomStatusFiltermetaActive( '_enable_action_status', true );

    ? ? $order_id = $order->get_id();

    ? ? // Verificar si el pedido no está ya completado antes de agregar la acción 'complete'

    ? ? if ( ! $order->has_status( 'completed' ) && ! array_key_exists( 'complete', $actions ) ) {

    ? ? ? ? $actions['complete'] = array(

    ? ? ? ? ? ? 'url' ? ?=> wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $order_id ), 'woocommerce-mark-order-status' ),

    ? ? ? ? ? ? 'name' ? => __( 'Complete', 'woocommerce' ),

    ? ? ? ? ? ? 'action' => 'complete',

    ? ? ? ? );

    ? ? }

    ? ? // Solo agregar acciones de estado personalizado si el pedido NO está completado

    ? ? if ( ! $order->has_status( 'completed' ) ) {

    ? ? ? ? foreach ( $statuses as $slug => $label ) {

    ? ? ? ? ? ? $custom_order_status = sanitize_title( $slug ); // Asegurarse de que el slug esté limpio

    ? ? ? ? ? ? if ( ! $order->has_status( $custom_order_status ) ) { // Si el pedido no tiene el estado personalizado

    ? ? ? ? ? ? ? ? $status_post = get_posts(

    ? ? ? ? ? ? ? ? ? ? array(

    ? ? ? ? ? ? ? ? ? ? ? ? 'post_type' => 'order_status',

    ? ? ? ? ? ? ? ? ? ? ? ? 'title' ? ? => $label,

    ? ? ? ? ? ? ? ? ? ? ? ? 'numberposts' => 1, // Limitar a un solo post

    ? ? ? ? ? ? ? ? ? ? )

    ? ? ? ? ? ? ? ? );

    ? ? ? ? ? ? ? ? if ( ! empty( $status_post ) ) {

    ? ? ? ? ? ? ? ? ? ? $custom_order_status_obj = $status_post[0];

    ? ? ? ? ? ? ? ? ? ? $custom_order_status_id ?= $custom_order_status_obj->ID;

    ? ? ? ? ? ? ? ? ? ? $custom_status_icon ? ? ?= get_post_meta( $custom_order_status_id, 'status_icon', true );

    ? ? ? ? ? ? ? ? ? ? // Solo agregar el ícono si existe

    ? ? ? ? ? ? ? ? ? ? if ( ! empty( $custom_status_icon ) ) {

    ? ? ? ? ? ? ? ? ? ? ? ? $icon_html = '<i class="' . esc_attr( $custom_status_icon ) . '"></i> ';

    ? ? ? ? ? ? ? ? ? ? } else {

    ? ? ? ? ? ? ? ? ? ? ? ? $icon_html = '';

    ? ? ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? ? ? ? ? $actions[ $custom_order_status ] = array(

    ? ? ? ? ? ? ? ? ? ? ? ? 'url' ? ?=> wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=' . $custom_order_status . '&order_id=' . $order_id ), 'woocommerce-mark-order-status' ),

    ? ? ? ? ? ? ? ? ? ? ? ? 'name' ? => $icon_html . esc_html__( $label, 'woocommerce' ),

    ? ? ? ? ? ? ? ? ? ? ? ? 'action' => 'view ' . sanitize_title( $custom_order_status ),

    ? ? ? ? ? ? ? ? ? ? );

    ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? }

    ? ? ? ? }

    ? ? }

    ? ? return $actions;

    }
    Thread Starter eWallz

    (@archonic08)

    @losmochos thanks for the temp fix.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.