Is there a simple way to get the class name without the namespace without using Reflection? This is my class and when I call get_class() I get CRMPiccoBundleServicesRFCWebhookSiteCancelled Answer Or simply exploding the return from class_name and getting the last element: Or simply removing the namespace from…
Tag: php
Ionic 3 Uncaught (in promise): [object Object]
I am new to Ionic 3 and mobile development. I am trying to connect a MySQL DB to my Ionic app and a PHP Restful API. I tested the API with Postman and it is working just fine, in order to implement it …
telegram bot SSL error: SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}
I use let’s encrypt free SSL (my host provider support it by default), I checked my site at sslshopper.com (the only warning was: The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate. Learn more about this …
Hide shipping methods based on products categories in Woocommerce
With Woocommerce, I would like to hide all shipping methods except “Local pickup” when a defined products category is in cart… The code below does that for other product types, except variable products: What can I do to make it work for variable products too? Any help is appreciated. Answer I have…
Microsoft VS Code: When I try to launch my program error “spawn php ENOENT” shows up
I am trying to run PHP code on Microsoft VS Code. When I click launch the only thing that happens is an error in the debug console saying: spawn php ENOENT To fix this, I have put the dll file for XDebug into the ext folder. I copied php.ini-development into a new file called php.ini and in that file I
Clicking on existing profile picture to upload and change image.
I have made a user profile card where the user can click on choose file to select and upload an image. Everything works fine however I would like to change it so instead of having to click on “choose file” and then click on “upload”, the user can just click on the existing image and be…
preg_match include string with unlimit occurence
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…