I trying to create preg_match function with a pattern to validate the future string with unlimit occurence. This is my function like this: One occurrence must respect the following format any charchters between two parentheses: (mystring123/). The whole of string ($arg) is a collection of these occurrences. F…
Display total cart shipping volume value in Woocommerce
I use woocommerce for wholesale customers who order containers of furniture – normally 40 foot containers with a volume of 68 cubic meters. Is there a way I can show somewhere on the website – maybe in the header area a box with showing the total m3 of products in their basket? I need to show the …
Creating a function to logout a WordPress user?
I’m trying to create a function to logout WordPress users after a period of inactivity. The timed element is working as it should and redirecting users after a set period of time. The problem is that once the PHP script is loaded (in code sample), I run into the following error: Fatal error: Call to und…
Sort Orders IDs alphabetically based on the shipping last name in Woocommerce
I need to sort my $order_name (more specifically $order_shipping_last_name) alphabetically. I’ve tried many different basic php sort() methods, in many different places, and can’t get this to work. I’m assuming I’m missing something? In my code, get_all_orders_that_have_a_product_varia…
PHP display nested Object with array of other Object as 1 nested array
I have big Object with protected properties and a property can be an array of other Objects. My goal is to print this entire Object as a single nested array. So I need to convert the object to an array. I’ve tried doing: $result = (array) $object; But this converts only the highest lever object to an ar…
Shipping carrier custom fields validation in Woocommerce checkout page
I have added two custom input fields in the shipping method section by changing the template /genesis-sample/woocommerce/checkout/review-order.php I have also managed to get them conditionally required. Only when the specific radio button is checked, the input fields appear and become required. I am using jQu…
Laravel Jobs Serialization of ‘Closure’ is not allowed
I would like to send Data to a NewsletterStore Job. But it’s failing with the following error. Any suggestions? I also tried to remove the SerializesModels Models trait. Without any success. Error Controller Job Answer Request is not serializable there is a workaround what you are trying to achieve Your…
Split string by last character and save to array?
I have several strings that look like: longname1, anotherlongname2, has1numbers2init3 I would like to use str_split to split off the last character of the strings. Eg: I can get the number alone using substr($string, -1); but need to find an efficient way of retrieving the remainder of the string. I have trie…
Laravel Storage file encoding
I’m trying to save text file as UTF-8 by using Laravel’s Storage facade. Unfortunately couldn’t find a way and it saves as us-ascii. How can I save as UTF-8? Currently I’m using following code to …
installed php71w-gd and getting error GD Library extension not available with this PHP installation
I am using laravel web framework on centos 7 server and nginx web server, I installed php71w-gd and still getting this error when i want to upload a file Intervention Image Exception …