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 // don't include this in your functions.php | |
function sort_predefined_line_items( $items ) { | |
// somehow sort items, via uasort and custom callback | |
return $items; | |
} | |
add_filter( 'si_items_and_products', 'sort_predefined_line_items' ); |
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 // don't include this in your functions.php | |
function deregister_select2_for_caldera( $items ) { | |
if ( ! class_exists( 'SI_Controller' ) ) { | |
return; | |
} | |
if ( SI_Controller::is_si_admin() ) { | |
wp_deregister_script( 'cf-select2minjs' ); | |
wp_deregister_style( 'cf-select2css' ); | |
} |
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 remote form via AJAX or php get. | |
* Shortcode is [sa-create-demo-form] | |
* Currently no attributes are used even though they could be used | |
* so that the $demo_url variable doesn't need to be updated manually below. | |
* | |
* @param array $atts shortcode atts | |
* @return string Create demo form. | |
*/ |
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 | |
/* | |
Plugin Name: NinjaDemo AJAX Callbacks | |
Plugin URI: https://sproutapps.co/ | |
Description: Allow for the demo form to be remotely retreived. | |
Author: Sprout Apps | |
Version: 0.8 | |
Author URI: https://sproutapps.co | |
*/ |
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 | |
// filter paypal because of discount | |
function sa_mod_paypal_gateway_data( $paypal_args = array(), $purchase_data = array() ) { | |
if ( isset( $paypal_args['cmd'] ) && $paypal_args['cmd'] == '_xclick-subscriptions' ) { | |
$paypal_args['sra'] = '3'; // change failed attempts. | |
if ( $paypal_args['a3'] < 0.00 && isset( $purchase_data['discount'] ) ) { | |
// Fix recurring amount | |
$paypal_args['a3'] += $purchase_data['discount']; | |
// fix single item, it matches the recurring amount. |
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 | |
function modify_edd_get_discount_amount( $amount, $code_id ) { | |
// Download requirements | |
$download_id = 49; | |
// Coupon code filtered | |
$dcodes = array( 'YOUDONTHINKIKNOW', 'WHATYOURETRYINGTODO?', 'NICETRY!!' ); | |
// Filter only the discount code above | |
$code = edd_get_discount_code( $code_id ); | |
if ( in_array( $code, $dcodes ) ) { | |
// Check cart of requirements before filtering amount |
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 | |
function modify_edd_get_cart_content_details_item_discount_amount( $discount, $item ) { | |
// We are only worried about SI at this point. | |
if ( $item['id'] == 49 ) { | |
// Don't apply a discount since it should come off the signupfee. | |
return 0; | |
} | |
return $discount; | |
} | |
add_filter( 'edd_get_cart_content_details_item_discount_amount', 'modify_edd_get_cart_content_details_item_discount_amount', 10, 2 ); |
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
<script type="text/javascript" charset="utf-8"> | |
jQuery( 'body' ).on({ | |
edd_discount_applied: function() { | |
window.location.reload(); | |
jQuery('.edd_cart_discount_row').hide(); | |
}, | |
edd_discount_removed: function() { | |
window.location.reload(); | |
jQuery('.edd_cart_amount').each(function() { | |
jQuery(this).text('...'); |
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 | |
/** | |
* SA Template Name: Spanish Template | |
* | |
*/ | |
do_action( 'pre_si_invoice_view' ); ?><!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> |
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 | |
/** | |
* Placed in the functions.php file of your theme this filter will override | |
* the local used by Sprout Invoices (which is the local WordPress is configured to use). | |
* | |
* nl_NL is the local in this example, change it to your local. | |
*/ | |
function set_sprout_invoices_locale() { | |
return 'nl_NL'; // change nl_NL and leave the single quotes. | |
} |
OlderNewer