I have a WordPress site and I have written a filter: function wc_add_string_to_price_newline( $price, $product ) { $product_id = $product->get_id(); if ($product_id == ‘1190’) { $…
Tag: date
Split weeks of month
I’m trying to get a week range for the month, I’ve somewhat accomplished what I’m looking for but I’d like the code to be more reliable. The data ranges are going to be used to some MySQL queries …
PHP calculate past dates from today
I have created a PHP function that calculates how old a WordPress/WooCommerce order is. If the order is older than 90 days it should be canceled. The function used to work perfectly. However, since …
Laravel Eloquent – Specific Date Filtering
I have a Laravel app that sends reminders on specific days prior to a tenancy_start_date. Essentially every 3 days, then 2 days, then daily ([30, 27, 24, 21, 19, 17, 15, 13, 11, 9, 8, 7, 6, 5]) Is …
Issue with getting the day of a month with the week day and year
I’m trying to get the day of a month with this code: // your input $month = “September”; $year = “2013”; $dayWeek = “Friday”; $week = 2; // create a date object $date = new …
Search Array for Best Match based on Day & Time
I’m trying to work out how to the the correct Site base on the current Day and Time from an array. The examples array just shows Monday, the real array will contain 7 days of the week with multiple …
PHP Time Conversion and Timezones
I’m trying to convert an RSS date (ISO 8601) to an iCalendar date. I thought I would turn the initial date time to a Unix timestamp, then format it with strftime. I understand that strftime changes a …
Laravel: Comparing dates between two columns in database not working
We are trying to build and api with our project. My problem is when I need to get a specific event which has a column date_from and date_to it always gets the data even if the event was finished. I …
Get WooCommerce product purchase date from a product Id for a user Id
I have faced a problem. I need to get a specific product purchase date using the user id and product id. Using “Checking if customer has already bought something in WooCommerce” answer code, it checks …
Display the published date of every product on Woocommerce shop page
I’m looking for solution to display products published date on shop page. I tried the following code, but it show only for first product Any help will be greatful Answer the_date function assumes you are inside a loop that is properly setting up the post data, which in your case seems not to be done. You could manually provide the