Skip to content

Instantly share code, notes, and snippets.

View rashedripon's full-sized avatar

Rashed Ripon rashedripon

View GitHub Profile
@rashedripon
rashedripon / functions.php
Last active March 1, 2021 21:22
Set custom order status for backorder items
// ---------------------
// 1. Register Order Status
add_filter( 'woocommerce_register_shop_order_post_statuses', 'extended_register_custom_order_status' );
function extended_register_custom_order_status( $order_statuses ){
// Status must start with "wc-"
$order_statuses['wc-custom-status'] = array(
'label' => _x( 'Custom Status', 'Order status', 'woocommerce' ),
<?php
/*
Plugin Name: wpdevguides.com must use plugins
Description: code that is used always
Version: 1.0.0
Author: WP Developer Guides
Author URI: wpdevguides.com
*/
add_filter( 'wc_stripe_payment_request_total_label_suffix', '__return_null' );
@rashedripon
rashedripon / functions.php
Last active February 7, 2022 08:03
Dokan store open-close in single product page
<?php
//Remove the <?php while using it in your theme's functions.php file
//Add store open-show information before single product add-to-cart button
add_action('woocommerce_before_add_to_cart_form', 'dokan_open_close', 1000);
function dokan_open_close() {
global $product;
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:35
Remove "Become a vendor" button from customers account
<?php
// Remove "Become a vendor" button from customers account
if(class_exists('Dokan_Pro')) {
remove_action( 'woocommerce_after_my_account', array( Dokan_Pro::init(), 'dokan_account_migration_button' ) );
}
@rashedripon
rashedripon / functions.php
Created December 29, 2019 22:23
Remove tabs under Dokan Vendor Dashboard > Booking
<?php
//Remove resources tab under Vendor Dashboard > Booking menu
add_filter('dokan_booking_nav_titles', function ($bookings) {
unset($bookings['resources']);
return $bookings;
});
@rashedripon
rashedripon / rating.php
Created March 3, 2021 16:49
Show "Be the first to review" when no reviews are available
<?php
/**
* Single Product Rating
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/rating.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@rashedripon
rashedripon / state.php
Created October 31, 2022 13:21
Add new state
/**
* Add or modify States
*/
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['DK'] = array(
'DK1' => 'Aarø',
);