- Revised date: November 5th, 2017
Between [company name]
And [customer name].
| /** | |
| * Use a shortcode to display product reviews. | |
| * Format: [product_reviews id="123"] | |
| * id = the product ID - you can get this from Products > All Products and hovering over the product title | |
| * | |
| * If there are no reviews for a product, nothing is returned to the browser. | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @param $atts | |
| * |
| /** | |
| * Return a list (array) of WooCommerce featured product IDs | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @return array|mixed | |
| */ | |
| function zpd_wc_get_featured_product_ids() { | |
| // Load from cache | |
| $featured_product_ids = get_transient( 'zpd_wc_featured_products' ); |
| /** | |
| * Rename the default WooCommerce product tabs | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @param $tabs | |
| * @return mixed | |
| */ | |
| function zpd_wc_rename_product_tabs($tabs) { | |
| global $post; |
| /** | |
| * Change "Add to cart" button text on single product page | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @return string|void | |
| */ | |
| function zpd_wc_add_to_cart_again_button() { | |
| global $woocommerce; |
| /** | |
| * Change "Out of stock" with "Sold" | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @param $availability | |
| * @return mixed | |
| */ | |
| function zpd_availability_filter_func($availability) | |
| { | |
| $availability['availability'] = str_ireplace( 'Out of stock', 'Sold', $availability['availability'] ); |
| /** | |
| * Add custom currency label to WooCommerce | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| * @param $currencies | |
| * @return mixed | |
| */ | |
| function zpd_add_wc_currency( $currencies ) { | |
| $currencies['BANANA'] = __( 'Banana', 'woocommerce' ); |
| /** | |
| * Add a privacy policy checkbox on the checkout form | |
| * | |
| * @author Wil Brown zeropointdevelopment.com | |
| */ | |
| function zpd_add_checkout_privacy_policy() { | |
| woocommerce_form_field( 'privacy_policy', array( | |
| 'type' => 'checkbox', | |
| 'class' => array('form-row privacy'), |
| <?php | |
| //This will prepend your WordPress RSS feed content with the featured image | |
| function wbd_featured_image_in_rss_feed( $content ) { | |
| global $post; | |
| if( is_feed() ) { | |
| if ( has_post_thumbnail( $post->ID ) ){ | |
| $prepend = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 10px;' ) ) . '</div>'; | |
| $content = $prepend . $content; | |
| } | |
| } |