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
| Checkout (<span class="sellMediaCart_quantity">0</span>) |
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
| function my_sell_media_above_item_form(){ | |
| echo 'This text will show up between the product thumbnail and the size and license select boxes on the cart popup.'; | |
| } | |
| add_action( 'sell_media_above_item_form', 'my_sell_media_above_item_form' ); |
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 | |
| /** | |
| * Plugin Name: Example Functionality Plugin | |
| * Plugin URI: http://your-website.com | |
| * Description: An example functionality for housing your actions and filters. | |
| * Version: 1.0 | |
| * Author: Your Name | |
| * License: GPL2 | |
| */ | |
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
| function my_sell_media_after_successful_payment( $payment_id ){ | |
| wp_mail( '[email protected]', 'New Sale!', 'A new payment was successfully recorded and I figured you might want to know.' ); | |
| } | |
| add_action( 'sell_media_after_successful_payment', 'my_sell_media_after_successful_payment' ); |
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
| function my_sell_media_download_size_text(){ | |
| return 'Parameters'; | |
| } | |
| add_filter( 'sell_media_download_size_text', 'my_sell_media_download_size_text' ); |
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
| /** | |
| * Loads a template from a specified path | |
| * | |
| * @package Ajax | |
| * @uses load_template() | |
| * @since 0.1 | |
| */ | |
| function sell_media_load_template() { | |
| if ( file_exists( get_template_directory() . '/cart.php' ) ) { |
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
| function my_set_add_to_cart_button() { | |
| global $wp_scripts; | |
| $data = $wp_scripts->get_data( 'sell_media', 'data' ); | |
| if( !is_array( $data ) ) { | |
| $data = json_decode( str_replace( 'var sell_media = ', '', substr( $data, 0, -1 ) ), true ); | |
| } | |
| $data['added_to_cart'] = 'New Add Cart Button Text'; | |
| $wp_scripts->add_data( 'sell_media', 'data', '' ); |
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
| function my_search_filter( $query ) { | |
| if ( !$query->is_admin && $query->is_search ) { | |
| $query->set( 'post_type', array('post', 'page' ) ); | |
| } | |
| return $query; | |
| } | |
| add_filter( 'pre_get_posts', 'my_search_filter' ); |
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
| sellMediaCart.total = function(){ | |
| var total = 0; | |
| sellMediaCart.each(function (item) { | |
| total += item.total(); | |
| }); | |
| // take 10 off it qty is greater than or equal to 5 | |
| if ( sellMediaCart.quantity() >= 5 ){ | |
| total -= 10; |