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
| /** | |
| * Automatically add product to cart on visit | |
| */ | |
| add_action( 'template_redirect', 'add_product_to_cart' ); | |
| function add_product_to_cart() { | |
| if ( ! is_admin() ) { | |
| $product_id = 2861; //replace with your own product id | |
| $found = false; | |
| //check if product already in cart | |
| if ( sizeof( WC()->cart->get_cart() ) > 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
| # Plugin main file | |
| <?php | |
| /* | |
| Plugin Name: Emails Helius | |
| Description: Changes the default user registration email and notify admin. | |
| Version: 1.0 | |
| Author: Helius | |
| Author URI: https://helius.dk | |
| */ |
NewerOlder