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
| add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' ); | |
| function wc_custom_redirect_after_purchase() { | |
| global $wp; | |
| if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
| $order_id = absint( $wp->query_vars['order-received'] ); | |
| $order_key = wc_clean( $_GET['key'] ); | |
| $redirect = get_permalink( {PAGE_ID} ); | |
| $redirect .= get_option( 'permalink_structure' ) === '' ? '&' : '?'; |
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 | |
| /** | |
| * My Account page | |
| * | |
| * @author WooThemes | |
| * @edited by McLane Creative | |
| * @package WooCommerce/Templates | |
| * @version 3.1.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 | |
| /** | |
| * start the customisation | |
| */ | |
| function custom_woo_before_shop_link() { | |
| add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
| add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
| } | |
| add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
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 | |
| /* | |
| We now maintain this code gist as an addon. | |
| * On GitHub: https://github.com/strangerstudios/pmpro-wp-affiliate-platform | |
| * Our Site: http://www.paidmembershipspro.com/add-ons/plus-add-ons/pmpro-wp-affiliate-platform-integration/ | |
| Tips and tricks also maintains a version here: | |
| https://www.tipsandtricks-hq.com/wordpress-affiliate/paid-memberships-pro-wp-affiliate-plugin-integration-873 | |
| */ |
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 | |
| /** | |
| * Code should be placed in your theme functions.php file. | |
| */ | |
| add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 ); | |
| function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) { | |
| if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { | |
| $html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">'; | |
| $html .= woocommerce_quantity_input( array(), $product, false ); |