Resolved¿Where can I find the push notification code to edit the notification text?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32154
    Gabriel
    Participant

    Using the Loco Translate plugin, when I translate the Add to cart button, the push notification is translated to.
    In Spanish, this texts loses the meaning if they are the same.
    Most precisely, the add to cart button must be “COMPRAR” and the push notification must be “PEDIDO”, so I need to edit the text of push notification manualy, but I can’t find where is this code.
    Can you help me?

    #32163
    Alex
    Keymaster

    Hello Gabriel,

    As I understand, you mean the text in the new order push notification received in the admin.

    This is defined in lafka/incl/woocommerce-functions.php , function lafka_new_orders_notification()

    You can copy the function in the child theme’s functions.php and modify the title and body texts of the notification. It is where the $notification variable is initialized:

    				$notification = array(
    					'title' => esc_html__( 'New Order', 'lafka' ),
    					'body'  => esc_html__( 'Order', 'lafka' ) . ' #' . esc_html( $order_id_to_notify ) . ' ' . esc_html__( 'is waiting to be processed.', 'lafka' ),
    					'icon'  => LAFKA_IMAGES_PATH . 'order-notification.png',
    					'sound'  => LAFKA_IMAGES_PATH . 'cart_add.wav',
    					'url'   => admin_url( 'post.php?post=' . $order_id_to_notify . '&action=edit' )
    				);

    Hope that helps.

    Regards,
    Alex

    #32190
    Gabriel
    Participant

    Hi Alex, thanks for the reply.
    Yes, I mean the admin notification for new orders.
    So, just with copying that in the funcions.php in the child theme, and changing the text is enough?
    ¡Thank you very much for your help!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register