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 | |
/** | |
* Display the Savings discount for a product that's on sale on product list pages. | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item', 'mycode_show_discount_in_product_lists' ); | |
function mycode_show_discount_in_product_lists() { | |
global $product; | |
$salediscount = get_post_meta( $product->id, '_dfrps_salediscount', true ); | |
if ( $salediscount > 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 | |
/** | |
* Replace affiliate links with links to VigLink. | |
* | |
* There are limitations to this method. Not all products contain the necessary data | |
* to redirect to VigLink. If the necessary data is not available, the affiliate network | |
* affiliate link will be returned instead. Therefore it's a good idea to enter your | |
* affiliate ID for all networks just in case here WordPress Admin Area >Datafeedr API > Networks | |
* |
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 the custom attribute label "Special Promotion" to a product. | |
* | |
* @param array $attributes An array attributes. | |
* @param array $post An array of post data including ID, post_title, post_status, etc... | |
* @param array $product An array of product data returned from the Datafeedr API. | |
* @param array $set A post array for this Product Set with an array key of postmeta containing all post meta data. | |
* @param string $action The action the Product Set is performing. Value are either "insert" or "update". |
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 | |
/** | |
* Prevent taxonomy-based attributes from being overwritten when a Product Set | |
* updates a product already in your store. | |
* | |
* @see wc_get_product_terms() | |
* @link http://stackoverflow.com/a/13454788/2489248 | |
* | |
* @param array|string $value The current value of the $attribute for this $post. |
OlderNewer