Skip to content

Instantly share code, notes, and snippets.

Avatar

David Towoju davexpression

View GitHub Profile
@davexpression
davexpression / update-paywall-cookie-time.php
Created Sep 30, 2020
Change Paywall Cookie Time in MemberPress
View update-paywall-cookie-time.php
View pluginette-wp-bitbucket-pipeline.php
image: php:7.1.29
pipelines:
default:
- step:
name: "Build and Test"
script:
- apt-get update
- apt-get install -y zip
- mkdir dist
@davexpression
davexpression / gp-enable-margin-on-discount.php
Last active Feb 11, 2019
Enable margin on GP ecommerce discount field
View gp-enable-margin-on-discount.php
<?php
/*
Plugin Name: GP Ecommerce Margin
Plugin URI: https://figarts.co
*/
/** You may noe start coding! **/
class GPECF_Margins {
private static $instance = null;
@davexpression
davexpression / vendor-managers.php
Created Jan 18, 2018
Create WooCommerce vendor managers on user registration
View vendor-managers.php
/**
* Turn all subscribers into Woo Vendors
*/
function figarts_make_users_vendors( $user_id ) {
if (!defined('WC_PRODUCT_VENDORS_TAXONOMY')){
return;
}
View better-woocommerce-cart-checkout-styles.css
/* Woocommerce Styles */
.woocommerce-message { display: none; }
.woocommerce-cart.full-width-content .content,
.woocommerce-checkout.full-width-content .content { max-width: 100%; }
.woocommerce-cart .woocommerce table.shop_table td.actions {
border-top: 1px solid #e6e6e6;
background: #f7f7f7;
border-bottom: 0px solid #e6e6e6;
@davexpression
davexpression / vendor-managers-customers-fire.php
Created Jan 18, 2018
Fires the previous code to turn customers to vendor manager
View vendor-managers-customers-fire.php
add_action( 'woocommerce_created_customer', 'figarts_make_customers_vendors', 10, 2 );
View vendor-managers-customers.php
/**
* Turn all subscribers into Woo Vendors
*/
function figarts_make_customers_vendors( $user_id, $user_data ) {
if (!defined('WC_PRODUCT_VENDORS_TAXONOMY')){
return;
}
@davexpression
davexpression / vendor-managers-fire.php
Created Jan 18, 2018
Fires the previous code to turn subscribers to vendor manager
View vendor-managers-fire.php
add_action( 'user_register', 'figarts_make_users_vendors_wrapper', 10, 1 );
@davexpression
davexpression / customize-add-to-cart-message.php
Last active Jan 12, 2018
Change WooCommerce 3.0+ “has been added to cart” message
View customize-add-to-cart-message.php
function mytheme_custom_add_to_cart_message($message, $product_id = null) {
$titles[] = get_the_title( key($product_id));
$titles = array_filter( $titles );
$added_text = sprintf( _n( '%s has been added to cart.', '%s have been added to cart', sizeof( $titles ), 'woocommerce' ), wc_format_list_of_items( $titles ) ); //Change the message here
$message = sprintf( '%s <a href="%s" class="button">%s</a>',
esc_html( $added_text ),
esc_url( wc_get_page_permalink( 'checkout' ) ), // Change to esc_url( wc_get_page_permalink( 'cart' ) ), if you want users to go to cart
esc_html__( 'Pay Now', 'woocommerce' ));
@davexpression
davexpression / custom_menu_admin.php
Created Oct 4, 2017 — forked from carlodaniele/custom_menu_admin.php
A basic plugin showing how to add menu metaboxes to admin menu page
View custom_menu_admin.php
<?php
/**
* @package Custom_menu_admin
* @version 1.0
*/
/*
Plugin Name: Custom menu admin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
You can’t perform that action at this time.