I need some help in code snippet under add to cart in product page

This topic has 2 replies, 2 voices, and was last updated 2 years, 8 months ago ago by Rose Tyler

  • Avatar: Michel Hamaoui
    Michel Hamaoui
    Participant
    March 9, 2022 at 07:50

    i am using a snippet code to show customer if he order before 4pm he will receive the order today.
    this message should be seen under add to cart on the product , but on your theme it show as a notification and disappear later , how i can keep it under the cart.

    this is the code that am using:

    add_action( ‘woocommerce_after_add_to_cart_form’, ‘bbloomer_dispatch_info_single_product’ );

    function bbloomer_dispatch_info_single_product() {
    date_default_timezone_set( ‘Europe/London’ );

    // if FRI/SAT/SUN delivery will be MON
    if ( date( ‘N’ ) >= 5 ) {
    $del_day = date( “l jS F”, strtotime( “next monday” ) );
    $order_by = “Monday”;
    }

    // if MON/THU after 4PM delivery will be TOMORROW
    elseif ( date( ‘H’ ) >= 16 ) {
    $del_day = date( “l jS F”, strtotime( “tomorrow” ) );
    $order_by = “tomorrow”;
    }

    // if MON/THU before 4PM delivery will be TODAY
    else {
    $del_day = date( “l jS F”, strtotime( “today” ) );
    $order_by = “today”;
    }

    $html = “

    Order by 4PM {$order_by} for delivery on {$del_day}

    “;

    echo $html;
    }

    1 Answer
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 9, 2022 at 12:00

    Hello,

    Additional customization in files is outside the scope of our support, but we will check what can be done to help you. Please provide temporary wp-admin and FTP access. Then I will pass your question to our dev team.
    Create an account via Dashboard (Users > Add new) with administrator role http://prntscr.com/s3rc9m > provide us with username and password via the Private Content area http://prntscr.com/s5mao7 You can use any email for it.
    If you do not know how to create FTP contact with your hosting provider, they will help you.

    Regards

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.