This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_loaded', 'maybeAddMultipleProductToCart', 25 ); | |
/** | |
* Add Multiple products by URL | |
* @example | |
* simple: http://wpplugins.local/cart/?add-to-cart=27,28 | |
* variation : http://wpplugins.local/cart/?add-to-cart=208,32 | |
* @return void | |
* @throws Exception |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create custom RestAPI | |
* @link http://wpplugins.local/wp-json/letsgo/v1/activatePlugin | |
* @return void | |
*/ | |
add_action( 'rest_api_init', function (): void { | |
register_rest_route( | |
'letsgo/v1', '/activatePlugin', [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Payment Complete in WC | |
*/ | |
add_action( 'woocommerce_payment_complete', 'createMoodleUser' ); | |
/** | |
* Create Moodle User | |
* @param int $orderID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****************** | |
* Product Hooks | |
******************/ | |
// Print a product custom field | |
add_action( 'woocommerce_before_add_to_cart_button', 'printProductCustomFields' ); | |
/*************** | |
* Cart Hooks | |
***************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert your Ecommerce in catalog mode | |
* @package LetsGodev\MuPlugins | |
* @since 1.0 | |
*/ | |
// Hide the cart page & checkout page | |
add_action( 'template_redirect', 'hideCartCheckoutPage' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* | |
* Hooks | |
* Remember to remove shipping-transient-version transient | |
********/ | |
// Snippet 1 : Hide other shipping methods | |
add_filter( 'woocommerce_package_rates', 'maybeFreeShipping' ); | |
// Snippet 2 : Notify that the customer can access free shipping. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @link https://www.letsgodev.com/ | |
* @since 1.0.0 | |
* @package Plugins/LetsGoDev/PluginExample | |
* | |
* Plugin Name: Set minimum order | |
* Plugin URI: https://www.letsgodev.com/ | |
* Description: This plugin is an example | |
* Version: 1.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @link https://www.letsgodev.com/ | |
* @since 1.0.0 | |
* @package Plugins/LetsGoDev/PluginExample | |
* | |
* Plugin Name: Plugin Example | |
* Plugin URI: https://www.letsgodev.com/ | |
* Description: This plugin is an example | |
* Version: 1.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Send php variables to js | |
* @package LetsGodev\MuPlugins | |
* @since 1.0 | |
* @description : use letsgo_vars.ajax_url in script js | |
*/ | |
add_action( 'wp_enqueue_scripts', 'sendVarsToScripts' ); |
NewerOlder