Skip to content

Instantly share code, notes, and snippets.

View Kodzhesyan's full-sized avatar
🎯
Focusing

Roman Kodzhesyan

🎯
Focusing
View GitHub Profile
@Kodzhesyan
Kodzhesyan / functions.php
Created December 17, 2021 00:21
Custom validation for Billing Phone checkout field - WooCommerce
// Custom validation for Billing Phone checkout field
add_action('woocommerce_checkout_process', 'custom_validate_billing_phone');
function custom_validate_billing_phone() {
$is_correct = preg_match('/^[0-9]{10}$/', $_POST['billing_phone']);
if ( $_POST['billing_phone'] && !$is_correct) {
wc_add_notice( __( 'Напишите правильно свой номер телефона.<strong>Он должен состоять только из 10 цифр</strong>. Например: <strong>0990603439</strong>' ), 'error' );
}
}
@Kodzhesyan
Kodzhesyan / functions.php
Last active September 30, 2024 12:37
Google Customer Reviews Snippet for WooCommerce
/**
* QREUZ SNIPPET FOR WOOCOMMERCE / WORDPRESS
*
* @TITLE Google Customer Reviews Snippet for WooCommerce
* @VERSION 1.4.2
* @DESCRIPTION Implements the necessary snippets to WooCommerce for collecting Google Customer Reviews from customers after purchase
* @FOR Google Customer Reviews, https://support.google.com/merchants/answer/7124319
* @LINK https://qreuz.com/snippets/google-customer-reviews-snippet-for-woocommerce/
* @AUTHOR Qreuz GmbH <hello@qreuz.com>
* @LICENSE GNU GPL v3 https://www.gnu.org/licenses/gpl-3.0
*PPD-Adobe: "4.3"
*%%%% PPD file for ZPL Label Printer with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.7.5.
*% Copyright 2007-2012 by Apple Inc.
*% Copyright 1997-2007 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
*% property of Apple Inc. and are protected by Federal copyright
*% law. Distribution and use rights are outlined in the file "LICENSE.txt"
*% which should have been included with this file. If this file is