As most of us have witnessed, there is a “semi new” scan entitled CLS in GTMetrix. I am at the start of learning to resolve these, and really need an example of doing so that is worthwhile (…
Modify empty keys in associative array in php
i have a really long form in wordpress that it filled out by the user and then submitted to a thirdparty crm via API. The thing is if user doesn’t fill a field, these field will be false or empty and remote_post will fail. I tried to add a custom value to empty fields with a foreach but they are
WooCommerce changing order line totals
I have a plugin which applies discounts based on the category of the product. I’m using the filters below to add text to the order table in the cart: And this action to change the total price of the order/cart. The total price of the order pulls through to the checkout, as do the modified product fields…
Show.blade.php is not displaying the content from the database, only the layout
`i am having a problem with my show.blade.php template, everything works fine but when I click on a post in the index page it directs me to the /post/1 page without showing the post content only the …
Apply a welcome discount to non “on sale” items in WooCommerce
I use this code to set up a “welcome” discount for a registered user: add_action( ‘woocommerce_cart_calculate_fees’, ‘personal_discount_based’, 20, 1 ); function personal_discount_based( $…
How can I get PHP to sign an input exactly the same as C#?
I’m working with an older API that requires XMLs to be signed. There is no proper documentation and the only code example was given in C#. I need to port this example to PHP. However, the code I’ve written in PHP gets a different output even when provided with the same input, causing the API call …
Symfony for PHP: inserting multiple rows to table from session using foreach
I’m writing a function to insert a new order with order items in it. Those items are stored in session. I need to insert all the items to order items table using Symfony for PHP. Here what I tried: $…
Why my relation ship return always null with PHP Phalcon?
I try to use relationShip ManyToMany with PHP Pahlcon 3.4 My models : use PhalconMvcModel; class Societe extends Model { public $id; public $nom; public $adresse1; public $adresse2; public $…
How can I echo a statement from a form?
I’m a student doing a challenge where I would have to make a Calculator-type form where you can input two values and click an operation. It’s a simple concept using only 4 operations. I was able to make the format of the form: title, input text and buttons. But I can’t find a way to take the…
How to check in PHP if a checkbox is checked or not before posting/submitting?
I’m trying to check if a checkbox has been selected so that if it is, I can then display another textbox, however I’ve tried the below code to try and check if the checkbox is checked or not but keep …