Skip to content

Instantly share code, notes, and snippets.

View TanvirHasan19's full-sized avatar
🏘️
Working from home

Tanvir Hasan TanvirHasan19

🏘️
Working from home
View GitHub Profile
@TanvirHasan19
TanvirHasan19 / functions.php
Created December 18, 2025 03:52
WC Vendors to disable the burger menu from the vendor dashboard
/* By Tanvir Hasan WC Vendors to disable the burger menu from the vendor dashboard */
/**
* JavaScript to DISABLE burger menu completely, show all items,
* AND center-align the navigation to prevent flickering
*/
function wcv_disable_burger_menu() {
// Only run on dashboard pages
if ( ! function_exists( 'wcv_is_dashboard_page' ) || ! wcv_is_dashboard_page() ) {
@TanvirHasan19
TanvirHasan19 / functions.php
Created December 16, 2025 06:59
Hide B2C-Only Product Category from Wholesale Users
define( 'WWPP_B2C_ONLY_CATEGORY_ID', 123 ); // Change this to your category ID
/**
* Option 2: Use category slug (alternative)
* Uncomment and set the slug if you prefer using slug instead of ID
*/
// define( 'WWPP_B2C_ONLY_CATEGORY_SLUG', 'your-category-slug' );
/**
* Get the B2C-only category ID
@TanvirHasan19
TanvirHasan19 / functions.php
Created December 13, 2025 09:31
Fix for WWOF product sorting duplication issue
/**
* Fix for WWOF product sorting duplication issue
* This ensures the product list container is cleared before new products are added
*/
add_action( 'wp_footer', function() {
if ( is_page() || is_singular() ) {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Monitor for product list updates
@TanvirHasan19
TanvirHasan19 / style.css
Created December 12, 2025 06:13
Make the UL act like a grid container
/* Make the UL act like a grid container */
ul.wcv_vendorslist.grid{
display: grid !important;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 24px;
margin: 0 0 20px 0;
padding: 0;
list-style: none;
}
@TanvirHasan19
TanvirHasan19 / functions.php
Last active December 10, 2025 11:35
Vertical thumbnails with scroll arrows
/**
* Oz Robotics product gallery
* Vertical thumbnails with scroll arrows
*/
add_action( 'wp_head', 'oz_gallery_thumbs_styles' );
function oz_gallery_thumbs_styles() {
if ( ! function_exists( 'is_product' ) || ! is_product() ) {
@TanvirHasan19
TanvirHasan19 / Lead Capture Plugin - Hooks Reference.md
Created November 29, 2025 05:19
WooCommerce Wholesale Lead Capture Plugin - Hooks Reference

WooCommerce Wholesale Lead Capture Plugin - Hooks Reference

Registration Form Hooks

Action Hooks (do_action)

  1. before_registration_form
    • Location: includes/class-wwlc-shortcode.php:298
    • Parameters: $registration_form_fields (array)
  • Description: Fires before the registration form is rendered
@TanvirHasan19
TanvirHasan19 / functions.php
Created November 21, 2025 09:23
JavaScript to DISABLE burger menu completely - show all items in main bar
/**
* JavaScript to DISABLE burger menu completely - show all items in main bar
* This prevents any items from being moved to the burger menu
*/
function wcv_disable_burger_menu() {
// Only run on dashboard pages
if ( ! function_exists( 'wcv_is_dashboard_page' ) || ! wcv_is_dashboard_page() ) {
return;
}
?>
@TanvirHasan19
TanvirHasan19 / functions.php
Created November 12, 2025 07:33
Workaround for BOGO Coupon Not Working with Regular Coupons
<?php
/**
* Workaround for BOGO Coupon Not Working with Regular Coupons
*
* This snippet fixes the issue where BOGO coupons don't apply correctly
* when a regular WooCommerce coupon is already in the cart.
*
* DO NOT MODIFY PLUGIN CORE FILES
* Add this to your theme's functions.php or a custom plugin
*
@TanvirHasan19
TanvirHasan19 / Sale Price & Language Fixes.md
Created November 12, 2025 03:24
Sale Price & Language Fixes

Developer Quick Reference: Sale Price & Language Fixes

Quick Fix Summary

Sale Price Validation

File: classes/class-get-products.php
Lines: 2883-2916
What it does: Validates sale prices before including in feeds

Language Translation

@TanvirHasan19
TanvirHasan19 / functions.php
Created November 6, 2025 16:02
Add Wholesale Prices to WooCommerce CSV Export
function wwpp_add_wholesale_price_export_columns( $columns ) {
// Check if wholesale prices plugin is active
if ( ! class_exists( 'WWP_Wholesale_Prices' ) ) {
return $columns;
}
// ============================================
// CUSTOMIZE THIS: Set your wholesale role key
// ============================================