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 | |
function my_child_theme_edd_paypal_redirect_args( $paypal_args ) { | |
$paypal_args['cbt'] = 'Return to our site to complete your purchase'; | |
return $paypal_args; | |
} | |
add_filter( 'edd_paypal_redirect_args', 'my_child_theme_edd_paypal_redirect_args' ); |
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
<!-- As indicated by the docs https://easydigitaldownloads.com/docs/creating-custom-add-to-cart-links/ --> | |
<a href="http://yoururl.com/checkout?edd_action=add_to_cart&download_id=ID_OF_THE_DOWNLOAD">Purchase This</a> | |
<!-- Following the docs, this doesn't work and adds the download twice --> | |
<!-- URL looks like this http://eddsupport.sumobithemes.dev/checkout?edd_action=add_to_cart&download_id=10 --> | |
<a href="http://eddsupport.sumobithemes.dev/checkout?edd_action=add_to_cart&download_id=10">Buy Now</a> | |
<!--This does work - note the / after checkout --> | |
<!-- URL looks like this http://eddsupport.sumobithemes.dev/checkout/?edd_action=add_to_cart&download_id=10 --> |
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 | |
function edd_custom_modify_htaccess_rules( $rules, $method ) { | |
switch( $method ) : | |
case 'redirect' : | |
// Prevent directory browsing | |
$rules = "Options -Indexes"; | |
break; |
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 | |
function my_child_theme_edd_sale_notification( $email_body, $payment_id, $payment_data ) { | |
// retrieve payment meta array and unserialize it | |
$payment_meta = maybe_unserialize( get_post_meta( $payment_id, '_edd_payment_meta', true ) ); | |
// add your fields here | |
$company = $payment_meta['company']; | |
$phone = $payment_meta['phone']; |
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 | |
/** | |
* Get array of payment IDs | |
* | |
* @param int $download_id Download ID | |
* @return array $payment_ids | |
*/ | |
function get_payment_ids( $download_id = '' ) { | |
// these functions are used within a class, so you may need to update the function call | |
$log_ids = $this->get_log_ids( $download_id ); |
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_child_theme_static_home_page() { | |
if ( is_front_page() ) | |
remove_action( 'shopfront_the_title', 'shopfront_render_the_title' ); | |
} | |
add_action( 'template_redirect', 'my_child_theme_static_home_page' ); |
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 | |
function my_child_theme_post_classes( $classes ) { | |
// get the terms from our 'download_category' taxonomy | |
$terms = get_the_terms( get_the_ID(), 'download_category' ); | |
if ( $terms && ! is_wp_error( $terms ) ) { | |
// add each term slug to our classes array | |
foreach ( $terms as $term ) { | |
$classes[] = $term->slug; | |
} |
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 | |
function my_child_theme_edd_post_classes() { | |
// get the terms from our 'download_category' taxonomy | |
$terms = get_the_terms( get_the_ID(), 'download_category' ); | |
// keep our original edd_download class | |
$classes = array( 'edd_download' ); | |
if ( $terms && ! is_wp_error( $terms ) ) { |
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 | |
function sumobi_custom_email_receipt_download_title( $title, $item, $price_id ) { | |
$price = $item['price']; | |
$quantity = $item['quantity']; | |
// only show quantity if quantities are enabled | |
$quantity = edd_item_quantities_enabled() ? ' (quantity: ' . $quantity . ')' : ''; | |
// append price and quantity to title | |
// Download Title – $50.00 (quantity: 5) | |
$title .= edd_currency_filter( edd_format_amount( $price ) ) . $quantity; |
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 | |
function my_child_theme_edd_downloads_query( $query, $atts ) { | |
// modify order and orderby to suit simple page ordering plugin | |
$query['orderby'] = 'menu_order'; | |
$query['order'] = 'ASC'; | |
return $query; | |
} | |
add_filter( 'edd_downloads_query', 'my_child_theme_edd_downloads_query', 10, 2 ); |