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 | |
| /** | |
| * Skip cart and redirect to direct checkout | |
| * | |
| * @package WooCommerce | |
| * @version 1.0.0 | |
| * @author Alessandro Benoit | |
| */ | |
| // Skip the cart and redirect to check out url when clicking on Add to cart |
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 | |
| /** | |
| * Plugin Name: WooCommerce Settings Tab Demo | |
| * Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a | |
| * Description: A plugin demonstrating how to add a WooCommerce settings tab. | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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( 'woocommerce_customer_save_address', 'jsforwp_update_address_for_orders', 10, 2 ); | |
| function jsforwp_update_address_for_orders( $user_id ) { | |
| $customer_meta = get_user_meta( $user_id ); | |
| $customer_orders = get_posts( array( | |
| 'numberposts' => -1, | |
| 'meta_key' => '_customer_user', |
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 | |
| //Loop through each item from the cart | |
| foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
| //get the current product ID | |
| $product_id = $cart_item['product_id']; | |
| //first - check if product has variations | |
| if(isset($cart_item['variation']) && count($cart_item['variation']) > 0 ){ | |
| //get the WooCommerce Product object by product ID | |
| $current_product = new WC_Product_Variable($product_id); | |
| //get the variations of this product |
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
| /** | |
| * Change the subscription thank you message after purchase | |
| * | |
| * @param int $order_id | |
| * @return string | |
| */ | |
| function custom_subscription_thank_you( $order_id ){ | |
| if( WC_Subscriptions_Order::order_contains_subscription( $order_id ) ) { | |
| $thank_you_message = sprintf( __( '%sThank you for purchasign our subscription! Visit %syour account%s page to know its status.%s', 'woocommerce-subscriptions' ), '<p>', '<a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">', '</a>','</p>' ); |
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 | |
| /** | |
| * Google Font URL | |
| * Combine multiple google font in one URL | |
| * @link https://shellcreeper.com/?p=1476 | |
| * @author David Chandra <david@shellcreeper.com> | |
| */ | |
| function tamatebako_google_fonts_url( $fonts, $subsets = array() ){ | |
| /* URL */ |
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 | |
| /* | |
| * Google Font Importer | |
| */ | |
| $fonts = "https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyCpfnm5kVng8hhP_jnAnnTXVP7MEUM89-k"; | |
| $fonts = file_get_contents($fonts, 0, null, null); | |
| $fp = fopen('fonts.txt', 'w'); |
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
| import React, { Component } from 'react'; | |
| import TextField from 'components/base/TextField'; | |
| const WAIT_INTERVAL = 1000; | |
| const ENTER_KEY = 13; | |
| export default class TextSearch extends Component { | |
| constructor(props) { | |
| super(); |