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 | |
/** | |
* Map each affiliate network ID to your affiliate ID for that network. | |
* | |
* In this example, Commission Junction's network ID is 3 and my Commission | |
* Junction affiliate ID is '321321321'. | |
*/ | |
$affiliate_ids = array( | |
3 => '321321321', // Commission Junction Affiliate ID. |
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 | |
/** | |
* Change the currency symbol for the WooCommerce product to match the currency | |
* of the product supplied by the Datafeedr API. | |
* | |
* @see dfrapi_currency_code_to_sign() | |
* @global WC_Product $product | |
* | |
* @param string $currency_symbol Current currency symbol. |
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 | |
/** | |
* THIS IS THE ONLY REQUIRED MODIFICATION!!! | |
* | |
* 1. GO HERE WordPress Admin Area > Pages > Add New | |
* 2. CREATE A NEW PAGE TO BE USED FOR DISPLAYING SEARCH RESULTS. | |
* 3. REPLACE "123" BELOW WITH THE ID OF YOUR NEW PAGE. | |
* | |
* Return the ID of the page to be used to display the search results. |
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 | |
/** | |
* 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 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 the woocommerce_template_loop_product_link_open() function from the | |
* WooCommerce "woocommerce_before_shop_loop_item" action. | |
* | |
* @see remove_action() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_woocommerce_template_loop_product_link_open' ); | |
function mycode_remove_woocommerce_template_loop_product_link_open() { |
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 | |
/** | |
* Add merchant logo (if it exists) to the Loop between product thumbnail and product name. | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', 'mycode_add_merchant_logo_to_loop', 20 ); | |
function mycode_add_merchant_logo_to_loop() { | |
global $product; | |
if ( dfrpswc_is_dfrpswc_product( $product->get_id() ) ) { | |
$postmeta = get_post_meta( $product->get_id(), '_dfrps_product', true ); |
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 | |
/** | |
* Add merchant logo (if it exists) to product details page. | |
* | |
* This displays the merchant's logo before the [buy now] button on | |
* single product detail pages. | |
* | |
* @global WC_Product $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 | |
/** | |
* Import a product's image during a Product Set import/update instead | |
* of after the product is imported. | |
* | |
* Use with CAUTION. This may cause product imports to be drastically slower or fail. | |
* | |
* @see do_action_ref_array(), get_post() | |
* |
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 Comparison Sets from WooCommerce Product pages. | |
* | |
* @see remove_action(), dfrcs_wc_compset_priority() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_compset_from_woocommerce_product_pages' ); | |
function mycode_remove_compset_from_woocommerce_product_pages() { | |
remove_action( 'woocommerce_after_single_product_summary', 'dfrcs_wc_single_product_page_compset', 0 ); |
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 | |
/** | |
* Example of how to execute the "the_content" filter ONLY once. | |
* | |
* @param string $content | |
* | |
* @return string $content | |
*/ | |
function mycode_the_content( $content ) { |
OlderNewer