Skip to content

Instantly share code, notes, and snippets.

View picocodes's full-sized avatar
🏠
Building Noptin

picocodes

🏠
Building Noptin
View GitHub Profile
<?php
add_filter( 'wpinv_get_full_address_format', function( $format ) {
return "{{address}} \n {{zip}} {{city}} \n {{country}}";
} );
@picocodes
picocodes / subscribers.js
Created June 12, 2020 12:05
Async Polyfill
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=37)}({37:function(t,e,n){"use strict";n.r(e);var r,i,o,s=n(5),a=n.n(s);function u(t,e,n,r,i,o,s){try{var a=t[o](s),u=
@picocodes
picocodes / invoice_docs.php
Created July 29, 2020 11:00
Quick documentation of invoice properties.
/**
* Invoice id.
*/
public $ID = 0;
/**
* The title of the invoice. Usually the invoice number.
*/
public $title;
@picocodes
picocodes / invoice-email-tags.md
Last active April 18, 2022 13:23
Invoicing Invoice Email Tags

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

@picocodes
picocodes / quote-merge-tags.md
Last active October 30, 2020 07:35
Quote merge tags

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
function my_currency_symbol( $currency_symbol, $currency ) {
if ( $currency_symbol == 'QAR' ) {
return 'QAR';
}
return $currency_symbol;
}
.wpi_invoice_notes_container .meta {
display: none;
}
.wpinv-print .wpinv-line-items .wpinv-item .rate,
.wpinv-print .wpinv-line-items .wpinv-item .qty,
.wpinv-print .wpinv-line-items .wpinv-item .total {
width: 10%;
}
@picocodes
picocodes / getpaid-automatically-create-invoice-each-month.php
Created January 28, 2021 07:01
This code automatically creates an invoice at the start of the month and notifies the customer.
add_action( 'getpaid_daily_maintenance', 'getpaid_generate_invoice_monthly_1611816820' );
function getpaid_generate_invoice_monthly_1611816820() {
// Check if this is the first day of month.
if ( date( 'j' ) === '1' ) {
$invoice = new WPInv_Invoice();
$invoice->set_user_id( $user_id ); // Replace user id with the user id.
$invoice->add_item( $item_id ); // Replace item id with the item id.
@picocodes
picocodes / ayecode-ui-loader.php
Last active February 3, 2021 12:13
A gist showing how to conditionally load aui assets
<?php
/**
* Add the function that calls the class.
*/
if(!function_exists('aui')){
function aui(){
global $aui_load_assets;
if(!class_exists("AUI",false)){
@picocodes
picocodes / getpaid-link-to-invoice-course.php
Last active February 5, 2021 06:10
Selling courses via GetPaid