This topic has 2 replies, 2 voices, and was last updated 2 years, 8 months ago ago by Rose Tyler
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 = “
“;
echo $html;
}
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
Tagged: add to cart, best selling, code snippet, help, product page, themes, woocommerce
You must be logged in to reply to this topic.Log in/Sign up