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 | |
/** | |
* Imports additional product images for an array of given fields as gallery images | |
* for a WooCommerce product. | |
* | |
* @param WP_Post $post | |
*/ | |
function mycode_import_woocommerce_gallery_images( $post ) { |
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 '_pricemesh_pids' during product set inserts and updates. | |
* | |
* @param array $meta An array containing postmeta data for this $post. | |
* @param array $post Array containing WordPress Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. | |
* @param string $action Either "update" or "insert" depending on what the Product Set is doing. |
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 product titles, descriptions & excerpts from being overwritten during Product Set updates. | |
* | |
* @param array $post Array containing WordPress Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. | |
* @param string $action Either "update" or "insert" depending on what the Product Set is doing. | |
* |
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 | |
/** | |
* Hide a product's price from display on single Product pages | |
* if a product contains a cached Comparison Set that meets the minimum number of | |
* results requirement. | |
* | |
* @param string $price HTML containing product price markup. | |
* @param WC_Product $product | |
* |
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 | |
/** | |
* Put the Comparison Set immediately below a Product's Name. | |
* | |
* The following 2 actions and 1 function will move a Comparison Set from displaying underneath the WooCommerce | |
* product's short description to below the product's name and above it's price. | |
* | |
* @see remove_action(), dfrcs_wc_compset_priority() | |
*/ |
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 product's [Buy Now] button URL with link to lowest priced product from | |
* the Comparison Set. | |
* | |
* If a Comparison Set does not exist for the product or one has not been cached | |
* or the number of products returned does not meet the minimum required products | |
* specified in the "Minimum Number of Results" field, then this will just return | |
* the default $url. |
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 | |
/** | |
* This code changes a WooCommerce product's price (including sale price) with data | |
* from its Comparison Set when the Comparison Set is created or its cache is updated and | |
* the Comparison Set has a highest and lowest price. | |
* | |
* This code modifies all of a WooCommerce Product's pricing fields. | |
* | |
* @param Dfrcs $compset |
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 | |
/** | |
* Import a product image during a Product Set update. | |
* | |
* This WILL cause product set updates to be slower. | |
* | |
* @param array $post Array containing WordPress Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. |
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 | |
/** | |
* Configure the hours in which Product Sets should | |
* do updates. | |
* | |
* @param array $post | |
* | |
* @return array $post | |
*/ |
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 | |
/** | |
* Update the attached image's description, caption & | |
* alt text with values from the product when the image is imported. | |
* | |
* @param integer $attachment_id Attachment ID of imported image. | |
* @param Dfrps_Image_Importer $image_importer | |
*/ | |
function mycode_update_image_meta( $attachment_id, $image_importer ) { |