Skip to content

Instantly share code, notes, and snippets.

View fervous's full-sized avatar

Anna fervous

View GitHub Profile
@fervous
fervous / functions.php
Created February 17, 2017 22:37 — forked from digitalchild/functions.php
Allow shop managers access wp-admin
<?php
// Allow shop managers to access wordpress admin
// WILL ONLY WORK FOR v1.3.8 and below. THIS WILL BREAK in v1.4.0.
add_filter( 'wcv_admin_lockout_capability', 'allow_shop_managers');
function allow_shop_managers( ){
return 'manage_woocommerce';
}
@fervous
fervous / product-edit.php
Last active February 15, 2017 04:02 — forked from avishai/product-edit.php
Hide Product Type Control - WC Vendors Pro
<!-- Product Type -->
<div class="hide_if_simple hide_if_variable hide_if_grouped">
<?php WCVendors_Pro_Product_Form::product_type( $object_id ); ?>
</div>
@fervous
fervous / functions.php
Created January 25, 2017 21:28 — forked from digitalchild/functions.php
Custom Taxonomy
<?php
// This code goes in your theme's functions.php
function form_caracteristica( $object_id ) {
WCVendors_Pro_Form_helper::select2( array(
'post_id' => $object_id,
'id' => 'wcv_custom_product_caracteristicas[]',
'class' => 'select2',
'label' => __('Caracteristicas', 'wcvendors-pro'),
'show_option_none' => __('Select a caracteristicas', 'wcvendors-pro'),
@fervous
fervous / bp-default-notification-settings.php
Created January 22, 2017 19:42 — forked from BoweFrankema/bp-default-notification-settings.php
Default BuddyPress Notification Settings
<?php
add_action( 'bp_core_activated_user', 'bpdev_set_email_notifications_preference');
function bpdev_set_email_notifications_preference( $user_id ) {
//I am putting all the notifications to no by default
//you can set the value to 'yes' if you want that notification to be enabled.
$settings_keys = array(
'notification_activity_new_mention' => 'no',
'notification_activity_new_reply' => 'no',
@fervous
fervous / gist:0a261d470b67f434a6ff32ae0e99477b
Created January 11, 2017 04:33 — forked from digitalchild/gist:84ec20a1721253b7215b
Hijack primary menu to add link to vendors store
<?php
/**
* Only run if wcv_vendors is installed.
*
* Place this in your themes functions.php file.
*/
if ( class_exists( 'WCV_Vendors' ) ) {
/**
@fervous
fervous / functions.php
Created January 3, 2017 17:47 — forked from digitalchild/functions.php
Make fields required
<?php
// You will also have to modify the store-settings.php template in templates/dashboard/store-settings.php
// Line 20 replace the form start with this
// <form method="post" action="" class="wcv-form wcv-formvalidator">
//do this in the core file not an override as this was missed and I've added it to core and will be upgrade safe next time
// Paypal required
function wcv_paypal_required( $args ){
@fervous
fervous / functions.php
Created November 30, 2016 21:22 — forked from dummyphp/functions.php
WC Vendors : Shipping fees per order
//*******************************************************************************
// !! CAUTION !!
// PROVIDED CODE WILL ONLY WORKS WHEN A CUSTOMER ORDER FROM ONLY 1 SHOP AT A TIME
//*******************************************************************************
// This code is provided as is and without any warranty
//Vendor can choose the minimum order amount.
//Vendor can choose the shipping fees for an order.
//Vendor can offer shipping when a certain amount order amount is reached.
@fervous
fervous / functions.php
Last active November 22, 2016 21:41 — forked from bentasm1/functions.php
Remove (or customize) Ships From wc vendors pro product meta
/* Remove Ships From in Product Meta */
add_filter( 'wcv_product_ships_from', 'custom_wcv_product_ships_from' );
function custom_wcv_product_ships_from( $ships_from ) {
$ships_from[ 'store_country' ] = '';
$ships_from[ 'title' ] = '';
return $ships_from;
}
@fervous
fervous / functions.php
Created November 15, 2016 15:43 — forked from bentasm1/functions.php
Disable International Shipping WC Vendors Pro
/* WC Vendors Pro - Disable International Shipping on Pro Vendor Dashboard */
/* Code written by Arvid V - Thanks! */
add_filter ('wcv_product_shipping_fee_international', 'ta_bort_internationell_frakt'); //Internaionell frakt, produkt
add_filter ('wcv_product_shipping_fee_international_qty', 'ta_bort_internationell_frakt'); //Checkruta 1, produkt
add_filter ('wcv_product_shipping_fee_international_disable', 'ta_bort_internationell_frakt'); //Checkruta 2, produkt
add_filter ('wcv_product_shipping_fee_international_free', 'ta_bort_internationell_frakt'); //Chckruta 3, produkt
add_filter ('wcv_shipping_international_fee', 'ta_bort_internationell_frakt'); //Internaionell frakt, butik
add_filter ('wcv_shipping_international_qty', 'ta_bort_internationell_frakt'); //Checkruta 1, butik
add_filter ('wcv_shipping_international_free', 'ta_bort_internationell_frakt'); //Checkruta 2, butik
@fervous
fervous / functions.php
Last active November 11, 2016 00:43 — forked from anonymous/gist:58d5b91ad1ba15ae5f32
wc vendors show products in buddypress feed (not tested!)
add_filter ( 'bp_blogs_record_post_post_types', 'activity_publish_custom_post_types',1,1 );
function activity_publish_custom_post_types( $post_types ) {
$post_types[] = 'product';
return $post_types;
}
add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
function record_cpt_activity_action( $activity_action, $post, $post_permalink ) {
global $bp;
if( $post->post_type == 'product' ) {