Skip to content

Instantly share code, notes, and snippets.

Avatar
☠️

Joey Ricketts jrick1229

☠️
View GitHub Profile
@jrick1229
jrick1229 / bbloomer_shipping_phone_checkout.php
Last active Dec 18, 2020
Altered BusinessBloomer snippet to make phone field required for shipping address, as well as moving it to make it conform to billing address location
View bbloomer_shipping_phone_checkout.php
<?php
/**
* @snippet Shipping Phone & Email - WooCommerce
* @how-to Get CustomizeWoo.com FREE
* @author Rodolfo Melogli
* @compatible WooCommerce 3.6.4
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
@jrick1229
jrick1229 / wcs_gifting_autocheck.php
Created Dec 8, 2020
Auto-check the Subscriptions Gifting checkbox on the product page
View wcs_gifting_autocheck.php
<?php
add_filter('wcsg_recipient_checkbox_checked', '__return_true');
@jrick1229
jrick1229 / wcsg_shipping_address_false.php
Created Nov 27, 2020
Do not require a WooCommerce Subscriptions Gifting recipient to enter a shipping address when completing their account creation
View wcsg_shipping_address_false.php
<?php
add_filter( 'wcsg_require_shipping_address_for_virtual_products', '__return_false' );
@jrick1229
jrick1229 / woocommerce_subscriptions_processing_order_override.php
Created Nov 25, 2020
Set all orders to Processing on payment complete - even ones containing products marked as Virtual & Downloadable
View woocommerce_subscriptions_processing_order_override.php
<?php
/*
* set all orders to Processing on payment complete
* even ones containing products marked as Virtual & Downloadable
*/
add_action( 'woocommerce_payment_complete', 'woocommerce_subscriptions_processing_order_override' );
function woocommerce_subscriptions_processing_order_override( $order_id ) {
if ( ! $order_id ) {
@jrick1229
jrick1229 / my_automatewoo_referrals_generate_advocate_key.php
Created Nov 19, 2020
[AutomateWoo - Refer A Friend] Change the advocate ID to 'REF[user_id][first_name]'
View my_automatewoo_referrals_generate_advocate_key.php
<?php
add_filter('automatewoo/referrals/generate_advocate_key', 'my_automatewoo_referrals_generate_advocate_key', 10, 2 );
/**
* @param $key
* @param AW_Model_Referral_Advocate $advocate
* @return int|string
*/
function my_automatewoo_referrals_generate_advocate_key( $key, $advocate ) {
@jrick1229
jrick1229 / ppro_add_comment.php
Last active Nov 13, 2020
Add the order number to PayPal Pro's 'Comment 1' field in PayPal dashboard (only works with 'PayPal Pro - Payflow', **not** 'PayPal Pro - Classic')
View ppro_add_comment.php
<?php
/**
* Add WooCommerce Order Number to PayPal Comment
*
* return @array $post_data
*/
function ppro_add_comment( $post_data, $order ) {
$post_data['COMMENT1'] = $order->get_order_number();
@jrick1229
jrick1229 / number_thumbnail_columns.php
Created Oct 23, 2020
Change the amount of thumbnail columns are shown in the product gallery from '4' to '5'
View number_thumbnail_columns.php
<?php
add_filter('woocommerce_product_thumbnails_columns', 'number_thumbnail_columns');
function number_thumbnail_columns() {
$columns = 5;
return $columns;
}
@jrick1229
jrick1229 / eg_remove_my_subscriptions_button.php
Created Oct 13, 2020
Hide the 'Cancel' button for subscriptions based on category
View eg_remove_my_subscriptions_button.php
<?php
function eg_remove_my_subscriptions_button( $actions, $subscription ) {
$items = $subscription->get_items();
foreach ( $items as $item ) {
$product_id = $item->get_product_id();
if ( ! has_term( 'subscriptions_1', 'product_cat', $product_id ) ) {
if ( $subscription->get_time( 'end' ) === 0 || $next_payment_timestamp > $subscription->get_time( 'end' ) ) {
View upgrade_downgrade.txt
#: includes/class-wc-subscriptions-switcher.php:444
#: includes/class-wc-subscriptions-switcher.php:539
#: includes/class-wc-subscriptions-switcher.php:2560
msgid "Upgrade or Downgrade"
msgstr ""
#: includes/class-wc-subscriptions-switcher.php:1857
msgctxt "a switch type"
msgid "Upgrade"
msgstr ""
@jrick1229
jrick1229 / functions.php
Created Jul 25, 2020
Output the 'purchase note' of a product with a variable in AutomateWoo. (currently only works with one product per order)
View functions.php
<?php
/**
* Add the new variable to the list.
*/
add_filter( 'automatewoo/variables', 'new_automatewoo_purchase_note_variable' );
/**
* @param $variables array
* @return array
You can’t perform that action at this time.