Skip to content

Instantly share code, notes, and snippets.

View mattallan's full-sized avatar

Matt Allan mattallan

View GitHub Profile
@mattallan
mattallan / wcs-redirect-to-cart.php
Created March 2, 2015 03:44
Redirect customers to the cart page when adding a subscription to their cart (rather than the checkout page, which is the default).
<?php
/**
* Plugin Name: WooCommerce Subscriptions Redirect to Cart
* Description: Redirect customers to the cart page when adding a subscription to their cart (rather than the checkout page, which is the default).
* Author: Gerhard Potgieter & Brent Shepherd
* Author URI: http://www.woothemes.com/products/woocommerce-subscriptions/
* Version: 1.0
* License: GPL v2
*/
@mattallan
mattallan / wcs-payment-gateway-support-example.php
Last active August 29, 2015 14:17
WC Subscriptions: Adding Support for Admin Change Payment Method Example
$this->supports = array(
'subscription_payment_method_change_admin',
// Add other support flags here
);
@mattallan
mattallan / one-subscription-per-user.php
Last active August 29, 2015 14:19
Limit Subscriptions to one active/suspended per user.
<?php
/**
* Plugin Name: User Limited Subscriptions
* Description: Limit users to only one active or suspended subscription
* Author: Matt Allan
* Author URI: http://www.prospress.com
* Version: 1.0
* License: GPL v2
*/
@mattallan
mattallan / sync_end_date_fixer.php
Last active November 30, 2021 07:36
sync end date fixer
<?php
/**
* Plugin Name: Fix incorrect end dates calculated on Synced Subscriptions
* Plugin URI:
* Description: Add `&sync_date_fixer=log` to the URL to log any incorrect end dates (see log file: wcs_sync_fixer_test). Add `&sync_date_fixer=update` to the URL to log and update any incorrect end dates (see log file: wcs_sync_fixer_updated to find which subscriptions were incorrect and have been updated.)
* Version: 1.0
* Author: Matt Allan
* Author URI: http://prospress.com
* License: GPLv2
*/
@mattallan
mattallan / wcs-force-webhook.php
Last active February 9, 2017 19:19
Immediately send `subscription.updated` webhooks for pending subscriptions
<?php
/**
* Plugin Name: WCS immediately send subscription.updated webhook
* Plugin URI:
* Description: Force immediate webhook delivery for subscription.updated webhooks on pending subscriptions
* Version: 1.0
* Author: Matt Allan - Prospress Inc.
* Author URI: http://prospress.com
*/
@mattallan
mattallan / disable-pp-rt.php
Last active May 18, 2016 03:46
Force disable PP Reference Transactions
<?php
/**
* Plugin Name: Disable PayPal Reference Transactions
* Plugin URI:
* Description: Force the store to use PP Standard. Helps to test both sides of PayPal :+1:
* Version: 1.0
* Author: Matt Allan
* Author URI: http://prospress.com
* License:
*/
@mattallan
mattallan / wc-api-endpoints.md
Last active September 19, 2016 04:10
v2.6 WC-API endpoints testing
Some of these examples require httpie installed: brew install httpie

Subscriptions

/subscriptions/

  • GET
<?php
/**
* Plugin Name: Prospress.com Facebook Pixel Conversion code
* Description: A plugin to bootup our Facebook Pixels on Prospress.com
* Author: Prospress
* Author URI: http://prospress.com/
* Version: 1.0
*/
/**
@mattallan
mattallan / sw-facebook-pixel.php
Last active November 7, 2016 01:57
Small Woorld Facebook Pixel Code
<?php
/**
* Plugin Name: Small Woorld Facebook Pixel Conversion code
* Description: A plugin to bootup our Facebook Pixels on Prospress.com
* Author: Prospress
* Author URI: https://smallwoorld.com/
* Version: 1.0
*/
/**
@mattallan
mattallan / pp-research-pixel-code.php
Last active October 26, 2016 03:38
Research Prospress Pixel Tracking on post
<?php
/**
* Plugin Name: Research Prospress Pixel Conversion code
* Description: A plugin to bootup our Facebook Pixels on research.prospress.com
* Author: Prospress
* Author URI: https://research.prospress.com
* Version: 1.0
*/
/**