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 | |
/** | |
* Modifies the delivery estimate label; $label = "day" / "days" | |
* | |
* @param string $label the label for the day estimate | |
* @param int $days number of dates for the estimate | |
* @return string - updated label | |
*/ | |
function sv_wc_shipping_estimate_modify_label( $label, $days ) { |
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 the minute / hour into available subscription period options | |
* | |
* @param array $subscription periods associative array of available periods | |
* @return array - updated periods | |
*/ | |
function sv_subs_new_subscription_period( $subscription_periods ) { |
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 | |
/** | |
* Change cart price display for free products | |
* | |
* @param string $price_html the price display html | |
* @param \WC_Product | |
* @return string - updated pricing html | |
*/ | |
function sv_wc_free_cart_price( $price_html, $product ) { |
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 | |
// get plan restriction rules if we have an ID, could be used in member area for example | |
$plan = wc_memberships_get_membership_plan( $plan_id ); | |
$product_rules = $plan->get_product_restriction_rules(); | |
foreach ( $product_rules as $rule ) { | |
// get the ids of restricted items from the rules | |
$restricted_items = $rule->get_object_ids(); |
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 product images to the WooCommerce order emails table | |
* Uses WooCommerce 2.5 or newer | |
* | |
* @param string $output the buffered email order items content | |
* @param \WC_Order $order | |
* @return $output the updated output | |
*/ | |
function sww_add_images_woocommerce_emails( $output, $order ) { |
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: WooCommerce Upsells Shortcode | |
* Plugin URI: http://skyver.ge/51 | |
* Description: Adds a shortcode to output WooCommerce product upsells; removes them from the original location when used | |
* Author: SkyVerge | |
* Author URI: https://www.skyverge.com/ | |
* Version: 1.0.0 | |
* | |
* Copyright: (c) 2016 SkyVerge, Inc. (info@skyverge.com) |
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: WooCommerce Upsells Widget | |
* Plugin URI: https://www.skyverge.com/blog/moving-woocommerce-upsells-on-product-pages/ | |
* Description: Adds a widget to display product upsells in a widget instead of below the product description | |
* Author: SkyVerge | |
* Author URI: https://www.skyverge.com/ | |
* Version: 1.1.0 | |
* Text Domain: woocommerce-upsells-widget | |
* |
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 a section with custom downloadable files to the "View Order Screen" | |
* if the order has a "custom_file" custom field with a download ID | |
* Requires Download Monitor | |
* | |
* SEE https://jilt.com/blog/selling-custom-files-woocommerce/ | |
* |
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 a custom order action in the "Recent Orders" table of the WooCommerce account | |
* if a download ID is entered as a "custom_file" order custom field | |
* Button downloads custom files for the order | |
* Requires Download Monitor | |
* | |
* @param array $actions the actions available for the order |