View wc-sku-sorting.php
This file contains 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 // ONLY COPY THIS LINE IF NEEDED! | |
/** | |
* Adds the ability to sort products in the shop based on the SKU | |
* Can be combined with tips here to display the SKU on the shop page: https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/ | |
* | |
* @param array $args the sorting args | |
* @return array updated args | |
*/ | |
function sv_add_sku_sorting( $args ) { |
View wc-add-order-item-meta-to-rest-response.php
This file contains 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 // only copy if needed | |
/** | |
* Example: Add order meta to the REST API | |
* WC 2.6+ | |
* | |
* @param \WP_REST_Response $response The response object. | |
* @param \WP_Post $post Post object. | |
* @param \WP_REST_Request $request Request object. | |
* @return object updated response object |
View wc-custom-order-action-sample.php
This file contains 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 // only copy if needed | |
/** | |
* Add a custom action to order actions select box on edit order page | |
* Only added for paid orders that haven't fired this action yet | |
* | |
* @param array $actions order actions array to display | |
* @return array - updated actions | |
*/ | |
function sv_wc_add_order_meta_box_action( $actions ) { |
View registration-order-link-for-woocommerce.php
This file contains 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: Registration Order Link for WooCommerce | |
* Plugin URI: http://skyver.ge/5S | |
* Description: Automatically links previous orders to new customer accounts upon WooCommerce registration. | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: link-wc-orders | |
* |
View wc-change-return-to-shop-link.php
This file contains 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
// Tutorial: http://www.skyverge.com/blog/change-woocommerce-return-to-shop-button/ | |
function skyverge_change_empty_cart_button_url() { | |
return get_site_url(); | |
//Can use any page instead, like return '/sample-page/'; | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'skyverge_change_empty_cart_button_url' ); |
View wc-memberships-post-types-blacklist.php
This file contains 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 | |
// Remove Sensei Messages from post types that can be restricted by a plan | |
function sv_add_post_type_memberships_blacklist( $blacklist ) { | |
$blacklist[] = 'sensei_message'; | |
return $blacklist; | |
} | |
add_filter( 'wc_memberships_content_restriction_excluded_post_types', 'sv_add_post_type_memberships_blacklist' ); |
View filter-wc-orders-by-gateway.php
This file contains 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: Filter WooCommerce Orders by Payment Method | |
* Plugin URI: http://skyverge.com/ | |
* Description: Filters WooCommerce orders by the payment method used :) | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: wc-filter-orders-by-payment | |
* |
View wc-disable-any-repeat-purchase.php
This file contains 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 | |
/** | |
* Disables repeat purchase for products / variations | |
* | |
* @param bool $purchasable true if product can be purchased | |
* @param \WC_Product $product the WooCommerce product | |
* @return bool $purchasable the updated is_purchasable check | |
*/ | |
function sv_disable_repeat_purchase( $purchasable, $product ) { |
View wc-prevent-checkout-for-cart-with-specific-category.php
This file contains 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 // only copy this line if needed | |
/** | |
* Renders a notice and prevents checkout if the cart | |
* only contains products in a specific category | |
*/ | |
function sv_wc_prevent_checkout_for_category() { | |
// set the slug of the category for which we disallow checkout | |
$category = 'clothing'; |
View wc-add-shop-loop.php
This file contains 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
/** | |
* Will add information to the shop loop above the "Add to cart" button | |
* This example will use post meta (custom fields) and display them if set | |
* Tutorial: http://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/ | |
**/ | |
function skyverge_shop_display_post_meta() { | |
global $product; | |
NewerOlder