Skip to content

Instantly share code, notes, and snippets.

View NaszvadiG's full-sized avatar

Naszvadi Gábor NaszvadiG

View GitHub Profile
@NaszvadiG
NaszvadiG / szepkartya.py
Created February 28, 2024 10:12 — forked from ofalvai/szepkartya.py
OTP SZÉP Kártya parser
import requests
from bs4 import BeautifulSoup as bs
import re
import json
CARD_NUMBER = 12345678
CARD_CODE = 678
URL_API = 'https://magan.szepkartya.otpportalok.hu/ajax/egyenleglekerdezes/'
URL_HTML = 'https://magan.szepkartya.otpportalok.hu/fooldal/'
@NaszvadiG
NaszvadiG / remove_checkout_fields.php
Created January 25, 2024 23:54 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
@NaszvadiG
NaszvadiG / woo-update-product-stock-qty.php
Created January 25, 2024 23:54 — forked from stuart-lambon/woo-update-product-stock-qty.php
Updates WooCommerce product stock quantity programmatically. $sku and $qty variables need to be filled.
<?php
$sku = 'ITEM001';
$qty = 1;
// Get product_id from SKU — returns null if not found
$product_id = wc_get_product_id_by_sku( $sku );
// Process if product found
if ( $product_id != null ) {
// Your PHP code goes here!
class WFACP_Custom_validate_snippet {
private $billing_message = '<strong>Inserire il nome della via e il numero civico nella fatturazione</strong>';
private $shipping_message = '<strong>Inserire il nome della via e il numero civico. È obbligatorio per la spedizione</strong>';
public function __construct() {
add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'actions' ] );
@NaszvadiG
NaszvadiG / index.js
Created January 25, 2024 23:54 — forked from mjcarnaje/index.js
var ajax_window = {
ajax_url: "https://easybrandph.com/wp-admin/admin-ajax.php",
language: "en",
templates: {
line: '\n<div :style="additionalCss" class="calc-item ccb-hr" :class="lineField.additionalStyles" :data-id="lineField.alias">\n\t<div class="ccb-line" :style="getLine"></div>\n</div>\n',
html: '\n<div :style="additionalCss" class="calc-item html" :data-id="htmlField.alias" v-html="htmlContent" :class="htmlField.additionalStyles"></div>\n',
toggle:
'\n<div :style="additionalCss" class="calc-item ccb-field" :class="{required: $store.getters.isUnused(toggleField), [toggleField.additionalStyles]: toggleField.additionalStyles}" :data-id="toggleField.alias">\n\t<div class="calc-item__title">\n\t\t<span> {{ toggleField.label }} </span>\n\t\t<span class="ccb-required-mark" v-if="toggleField.required">*</span>\n\t\t<span v-if="toggleField.required" class="calc-required-field">\n\t\t\t<div class="ccb-field-required-tooltip">\n\t\t\t\t<span class="ccb-field-required-tooltip-text" :class="
@NaszvadiG
NaszvadiG / wp-helper.php
Created January 25, 2024 23:54 — forked from josanua/wp-helper.php
wordpress helper file
<?php
/************ Global Variables and settings ************/
// for external file to include WP environment
require( '../sitename-base/wp-load.php' );
// Global Var
// https://codex.wordpress.org/Global_Variables
@NaszvadiG
NaszvadiG / wp-plugins.txt
Created January 25, 2024 23:54 — forked from josanua/wp-plugins.txt
wp plugins
----------------------- Must have/new projects -------------------------
Check Email
Query Monitor
Show Current Template
Theme Check (nu mereu, doar sa verific thema dupa standard)
----------------------- Widgets -------------------------
Widgets / General ( widget settings )
- WooSidebar - widget config
@NaszvadiG
NaszvadiG / wp-code-utils.php
Created January 25, 2024 23:54 — forked from josanua/wp-code-utils.php
wp code utils
<?php
************ Debug, Debuging ************
//Activate log files in wp-config.php
define( 'WP_DEBUG', true ); // Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed.
define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_DISPLAY', true ); // Controls whether debug messages are shown inside the HTML of pages or not.
// use this
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
@NaszvadiG
NaszvadiG / theme-helper.css
Created January 25, 2024 23:54 — forked from josanua/theme-helper.css
Theme Helper CSS
/*
Theme Name (*): Name of the theme.
Theme URI: The URL of a public web page where users can find more information about the theme.
Author (*): The name of the individual or organization who developed the theme. Using the Theme Author’s wordpress.org username is recommended.
Author URI: The URL of the authoring individual or organization.
Description (*): A short description of the theme.
Version (*): The version, written in X.X or X.X.X format.
License (*): The license of the theme.
License URI (*): The URL of the theme license.
Text Domain (*): The string used for textdomain for translation.
@NaszvadiG
NaszvadiG / functions.php
Created January 25, 2024 23:54 — forked from josanua/functions.php
wp functions.php file
<?php
//--- Begin Standard Theme settings ---//
/**
* Test Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Test_Theme
*/