Skip to content

Instantly share code, notes, and snippets.

View psaikali's full-sized avatar
🥑
WordPress'in & React'in

Pierre Saikali psaikali

🥑
WordPress'in & React'in
View GitHub Profile
@psaikali
psaikali / custom_wc_get_products_parameters.php
Last active February 21, 2024 21:21
Ajouter de nouveaux paramètres de requête à wc_get_products()
<?php
namespace Mosaika;
/**
* Handle a custom 'vendor' query var to get products of a specific Vendor.
* Handle a custom 'featured_by_vendor' query var to get featured products of a specific Vendor.
*
* @param array $query_args - WP_Query args
* @param array $query_vars - WC_Product_Query args
@psaikali
psaikali / as3cf-update_products_downloadable_files.php
Last active May 21, 2019 09:52
Process WooCommerce products and set correct downloadable files if they've been offloaded by WP Offload Media
<?php
namespace Mosaika;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Register our custom commands.
@psaikali
psaikali / cf7-woocommerce-order-field.php
Created December 27, 2019 21:31
Create a new [wc_order] Contact Form 7 field tag which can only accept a valid WooCommerce order number.
<?php
/**
* Plugin Name: Contact Form 7 WooCommerce Order Select Field
* Description: Use the <code>[wc_order]</code> field in CF7 forms
* Author: Pierre Saïkali
* Author URI: https://saika.li
* Text Domain: cf7wcp
* Domain Path: /languages/
* Version: 1.0.0
*/
@psaikali
psaikali / woocommerce-custom-checkout-fields.php
Created December 28, 2019 13:05
Add custom WooCommerce checkout fields, add an extra fee to the cart, validate the fields before processing the order and save them on the order metadata.
<?php
/**
* Plugin Name: WooCommerce Custom Checkout Fields
* Description: Add some custom "emergency level" extra fields on the WooCommerce Checkout page. Save this custom data in each order metadata.
* Author: Pierre Saïkali
* Author URI: https://saika.li
* Text Domain: wc_ccf
* Domain Path: /languages/
* Version: 1.0.0
* Full Tutorial: https://mosaika.fr/personnaliser-tunnel-commande-woocommerce/