Skip to content

Instantly share code, notes, and snippets.

@wp126
wp126 / google anyalytice event and facebook pixel on contact form 7
Created April 24, 2023 04:01
google anyalytice event and facebook pixel on contact form 7
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
<?php
add_action('wp', 'mysialus');
function mysialus(){
if(!is_admin()){
if(!is_user_logged_in()){
if(!is_page(1587)){
wp_redirect( get_permalink(1587));
exit;
}
}
<?php
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', __DIR__);
}
include _PS_ADMIN_DIR_.'/../config/config.inc.php';
$id_lang=2;
$start=3001;
$limit=4000;
$order_by='id_product';
https://codepen.io/atelierbram/pen/LRZrxQ
@wp126
wp126 / gravity form with wp_user_query
Created November 17, 2022 07:46
gravity form with wp_user_query
if ( !empty( $_GET['branch'] ) ) {
add_action( 'pre_user_query', 'add_my_custom_queries' );
}
$user_query = new WP_User_Query( $arr );
if ( !empty( $_GET['branch'] ) ) {
remove_action( 'pre_user_query', 'add_my_custom_queries' );
}
function add_my_custom_queries( $query ) {
global $wpdb;
@wp126
wp126 / Update Attribute and Combination Price in Prestashop
Created October 19, 2022 11:52
Update Attribute and Combination Price in Prestashop
$combination = new Combination(20);//id_product_attribute add there
$combination->price = (float)20;
$combination->save();
@wp126
wp126 / Update Product Price in Preastashop
Created October 19, 2022 11:50
Update Product Price in Preastashop
$product = new Product(3);
$product->price = 30;
$product->save();
@wp126
wp126 / url
Created October 19, 2022 11:48
Call controller by generate url in prestashop
index.php?fc=module&module=MODULE_NAME&controller=CONTROLLER_NAME
@wp126
wp126 / in cmd write
Last active September 21, 2022 07:29
Create Cron Job in Xampp
#for create
schtasks /create /tn "XamppCron" /tr "D:\xampp\php\php.exe D:\xampp\htdocs\cron.php" /sc minute /mo 1
#for delete
schtasks /delete /tn "XamppCron"
#for status check
schtasks /Query /TN "XamppCron"
@wp126
wp126 / function.php
Created September 14, 2022 08:33
update stock and price in woocommerce
<?php
$product = new WC_Product( 5 );
$product->set_price( 10 );
$product->set_stock_quantity(3 );
$product->save();