What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-21 07:28:10
woocommerce update cart price
function before_calculate_totals( $cart_obj ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { return; } // Iterate through each cart item foreach( $cart_obj->get_cart() as $key=>$value ) { if( isset( $value['csCost'] ) ) { ... Add solution -
PHP 2021-11-20 13:25:17
how to get favicon with Goutte php
function getFavicon($url){ # make the URL simpler $elems = parse_url($url); $url = $elems['scheme'].'://'.$elems['host']; # load site $output = file_get_contents($url); # look for the shortcut icon inside the loaded page $reg... Add solution -
PHP 2021-11-20 07:35:19
undefined variable _session
<?php // add session start in your first main home page after login page // example // page1 : login.php session_start(); $_SESSION['name']='(your data modifiable)'; .... //redirect to your main page after login // page2 : home-user.php session_start(... Add solution -
PHP 2021-11-20 02:55:14
How to use php to set title
function set_page_title(){ global $page_title; /* you should make the variable global so the function can access it and set it to the page title otherwise you will get an error. */ if(isset($page_title)){ /*Check if my code has that varia... Add solution -
-
Other 2021-11-16 22:54:22
drupal 8 webform hook validation
namespace Drupal\custom_module\Validate; use Drupal\Core\Field\FieldException; use Drupal\Core\Form\FormStateInterface; /** * Form API callback. Validate element value. */ class MyValidateConstraint { /** * Validates given element. * ... Add solution