add_action( 'woocommerce_thankyou', 'whatconverts_tracking' ); function whatconverts_tracking($order_id) { if ($order_id > 0) { $order = wc_get_order($order_id); if ( $order instanceof WC_Order ) { $completion_date = empty($order->get_date_paid()) ? strtotime($order->get_date_created()) : strtotime($order->get_date_paid()); $current_date = new Datetime(); $time_difference = $current_date->format('U') - $completion_date; if ($time_difference < 180) { $email = $name = $phone_number = $company = $address_1 = $address_2 = $city = $state = $postcode = $country = ''; if (!empty($order->get_billing_email())) $email = $order->get_billing_email().' '; if (!empty($order->get_billing_first_name())) $name .= $order->get_billing_first_name().' '; if (!empty($order->get_billing_last_name())) $name .= $order->get_billing_last_name(); if (!empty($order->get_billing_phone())) $phone_number = $order->get_billing_phone(); if (!empty($order->get_billing_company())) $company = $order->get_billing_company(); if (!empty($order->get_billing_address_1())) $address_1 = $order->get_billing_address_1(); if (!empty($order->get_billing_address_2())) $address_2 = $order->get_billing_address_2(); if (!empty($order->get_billing_city())) $city = $order->get_billing_city(); if (!empty($order->get_billing_state())) $state = $order->get_billing_state(); if (!empty($order->get_billing_postcode())) $postcode = $order->get_billing_postcode(); if (!empty($order->get_billing_country())) $country = $order->get_billing_country(); echo ''; } } } }
Free Shipping over $100

Blogs & news

The Royal Blog

  • All
  • Adjustable Bed
  • Mattress
  • Pillows
  • Unlocking Comfort: Adjusting to a Firm Memory Foam Mattress

    Unlocking Comfort: Adjusting to a Firm Memory Foam Mattress Are you tossing and turning on your memory foam mattress? Is it too firm for your liking? Fear not! Many people experience an adjustment period when transitioning to a firmer mattress, especially regarding memory foam. You’re in for a treat with Royal Sleep, a brand renowned […]

    Read More
  • A Guide to Choosing the Perfect Mattress for Your Adjustable Bed

    A Guide to Choosing the Perfect Mattress for Your Adjustable Bed Investing in an adjustable bed is a game-changer for your sleep quality and overall well-being. With Royal Sleep, a leading brand offering a diverse range of mattresses, bed frames, adjustable beds, pillows, and bunk beds, the journey to your dream sleep setup becomes an […]

    Read More
  • 5 Reasons Why Natural, Organic Pillows Will Help You Sleep Better

    5 Reasons Why Natural, Organic Pillows Will Help You Sleep Better Quality sleep is the cornerstone of a healthy lifestyle, and your choice of bedding plays a crucial role in achieving that. When it comes to pillows, the market is flooded with options, but not all are created equal. Royal Sleep – Your destination for […]

    Read More