Skip to content

Instantly share code, notes, and snippets.

View picocodes's full-sized avatar
🏠
Building Noptin

picocodes

🏠
Building Noptin
View GitHub Profile
@picocodes
picocodes / getpaid-tickets-email-tags.md
Last active March 9, 2022 10:02
GetPaid Tickets Merge Tags

The following wildcards can be used in ticket templates:

Site Details

{SITE_TITLE} : Site Title

Ticket Details (Not available for ticket emails)

{TICKET_PRICE} : The ticket's price

@picocodes
picocodes / add-pdf-pay-link.php
Created August 17, 2021 10:17
This code snippet adds a payment link below the total amount on the invoice items table. But only if the invoice is not yet paid for.
<?php
// Copy this file to wp-content/themes/your-theme/geodirectory/templates/bootstrap/content-archive-listing.php
// Remember to replace "ENTER YOUR ADD HERE" with your actual ad code.
/**
* Template for the list of places
*
* This is used mostly on the listing (category) pages and outputs the actual grid or list of listings.
* See the link below for info on how to replace the template in your theme.
@picocodes
picocodes / create-invoice.php
Last active June 9, 2021 03:03
Programatically create invoices.
<?php
//Load Wordpress
include_once( '../wp-load.php' );
$new_invoice = new WPInv_Invoice();
$new_invoice->set_email_cc( 'jconley@example.com' );
$new_invoice->set_description( 'test Description' );
$new_invoice->set_disable_taxes( true );
@picocodes
picocodes / getpaid-customize-credit-card-form.php
Created May 5, 2021 09:29
How to customize the credit card form on GetPaid
<?php
// Example customizing the Authorize.NET credit card form.
// Remember to keep the input "name" attributes as they appear in this example
add_action( 'getpaid_init', function( $getpaid ) {
remove_action( 'wpinv_authorizenet_cc_form', array( $getpaid->gateways['authorizenet'], 'payment_fields' ), 10 );
add_action( 'wpinv_authorizenet_cc_form', function( $invoice_id, $form ) {
$authorizenet = getpaid()->gateways['authorizenet'];

The following wildcards can be used in email subjects, heading and content:

{site_title} : Site Title

{name} : Customer's full name

{first_name} : Customer's first name

{last_name} : Customer's last name

<?php // Do not copy this line.
add_filter( 'getpaid_user_address_fields', function() {
return array(
'first_name' => __( 'First Name', 'invoicing' ),
'last_name' => __( 'Last Name', 'invoicing' ),
'country' => __( 'Country', 'invoicing' ),
'state' => __( 'State', 'invoicing' ),
'zip' => __( 'Zip/Postal Code', 'invoicing' ),
@picocodes
picocodes / department-field.php
Last active February 11, 2021 05:19
Display department field after the company field in GetPaid
<?php
// Display the department field on the payment form.
function getpaid_example_department_field( $field_type ) {
if ( 'billing' != $field_type ) {
return;
}
echo aui()->input(
@picocodes
picocodes / hide-vat-settings.php
Created February 5, 2021 05:05
Hide VAT settings from GetPaid
<?php
function getpaid_example_hide_vat_settings( $settings ) {
unset( $settings['taxes']['vat'] );
return $settings;
}
add_filter( 'wpinv_registered_settings', 'getpaid_example_hide_vat_settings' );
@picocodes
picocodes / getpaid-link-to-invoice-course.php
Last active February 5, 2021 06:10
Selling courses via GetPaid