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 | |
| $search = $api->searchRequest(); | |
| $search->addFilter('category LIKE [trail]'); | |
| $products = $search->execute(); |
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 | |
| $search = $api->searchRequest(); | |
| $search->addFilter('ANY LIKE shoes'); | |
| $search->excludeDuplicates('image'); | |
| $products = $search->execute(); |
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 | |
| $search = $api->searchRequest(); | |
| $search->addFilter('ANY LIKE shoes'); | |
| $search->excludeDuplicates('merchant_id name price'); | |
| $products = $search->execute(); |
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 | |
| $networks = $api->getNetworks( array(), FALSE, array( '_id', 'name' ) ); | |
| foreach( $networks as $network ) { | |
| echo 'Network ID: ' . $network['_id']; | |
| echo 'Network Name: ' . $network['name']; | |
| } |
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 | |
| $merchants = $api->getMerchants( array( 6, 8, 3, 4 ), FALSE, array( '_id', 'name' ) ); | |
| foreach( $merchants as $merchant ) { | |
| echo "Merchant: " . $merchant['name'] . "(" . $merchant['_id'] . ")\n"; | |
| } |
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 | |
| $merchants = $api->getMerchantsById( array( 42742, 675, 4203, 677 ), FALSE, array( '_id', 'name', 'product_count' ) ); | |
| foreach( $merchants as $merchant ) { | |
| echo $merchant['name']; | |
| echo " (ID: " . $merchant['_id'] . ") "; | |
| echo number_format( $merchant['product_count'] ); | |
| echo " product<br />"; | |
| } |
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 | |
| $api = new DatafeedrApi(MY_ACCESS_ID, MY_SECRET_KEY, 'curl'); | |
| $search = $api->amazonSearchRequest(MY_AMAZON_ACCESS_KEY, MY_AMAZON_SECRET_KEY, MY_AMAZON_ASSOCIATE_TAG, "US"); | |
| $search->addParam('Brand', 'nike'); | |
| $search->addParam('Keywords', 'shoe golf'); | |
| $search->addParam('MaximumPrice', '1500'); | |
| $search->addParam('SearchIndex', 'Apparel'); |
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 | |
| $search = $api->searchRequest(); | |
| $search->addFilter( 'salediscount > 20' ); | |
| $products = $search->execute(); |
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 "Sort by discount" to sorting options. Defaults to biggest to smallest discount. | |
| */ | |
| add_filter( 'woocommerce_get_catalog_ordering_args', 'mycode_woocommerce_add_salediscount_to_catalog_ordering_args' ); | |
| function mycode_woocommerce_add_salediscount_to_catalog_ordering_args( $args ) { | |
| $orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
| if ( 'discount' == $orderby_value ) { | |
| $args['orderby'] = 'meta_value_num'; |