Skip to content

Instantly share code, notes, and snippets.

@m3esma
m3esma / functions.php
Created November 30, 2019 15:08
WooCommerce - Disable purchase for non-logged-in users. (Remove add-to-cart button).
<?php
// Do NOT include the opening php tag.
// Disable purchase for non-logged-in users. (Remove add-to-cart button).
function m3wc_woocommerce_is_purchasable( $is_purchasable, $product ) {
if ( ! is_user_logged_in() ) {
return false;
}
return $is_purchasable;
@iamtmrobinson
iamtmrobinson / custom-props.tsx
Created January 8, 2018 14:49
Using custom props with a Redux form in Typescript
import * as React from 'react';
import {
Field as FormField,
InjectedFormProps,
reduxForm,
} from 'redux-form';
interface CustomProps {
customText: string;
}
@MeLlamoPablo
MeLlamoPablo / nvmlink
Created February 1, 2017 11:34
Creates a symlink to /usr/bin/node after using nvm