Archives: Snippets
Untitled Snippet
import { BrowserRouter, Routes, Route, Link } from “react-router-dom”; import “./styles.css”; function Header() { return ( SH Signature Hôtelière Accueil Particuliers Professionnels ); } function Home() { return ( Literie hôtelière haut de gamme Signature Hôtelière vous accompagne dans vos…Continue reading
Untitled Snippet
WWPP – Customize the admin “New Order” email subject for wholesalers v1.1
/** * Customize the Admin “New Order” email subject using Wholesale Prices Premium logic */ add_filter( ‘woocommerce_email_subject_new_order’, function( $subject, $order ) { if ( ! $order ) { return $subject; } // Access the Wholesale Prices Premium global object global…Continue reading
WWPP – Customize the admin “New Order” email subject for wholesalers
/** * Customize the Admin “New Order” email subject for wholesale customers only */ add_filter( ‘woocommerce_email_subject_new_order’, function( $subject, $order ) { if ( ! $order ) { return $subject; } $customer_id = $order->get_customer_id(); if ( ! $customer_id ) { return…Continue reading
Untitled Snippet
Flodesk Popup #2
Flodesk Popup
Single Line Form adjustments
/* Input fields styling */ #wpforms-758 .wpforms-field input[type=”text”], #wpforms-758 .wpforms-field input[type=”email”] { background-color: #1c355e !important; border: 1px solid #ffffff !important; border-radius: 3px !important; color: #ffffff !important; } /* Placeholder text color */ #wpforms-758 .wpforms-field input[type=”text”]::placeholder, #wpforms-758 .wpforms-field input[type=”email”]::placeholder { color:…Continue reading
WWPP – Restrict add-to-cart on specific products to a specific wholesale role only
// 1. Make the product unpurchasable for non-doctors add_filter( ‘woocommerce_is_purchasable’, ‘wws_restrict_purchase_for_doctors’, 10, 2 ); function wws_restrict_purchase_for_doctors( $is_purchasable, $product ) { $allowed_role = ‘doctors’; $restricted_category = ‘doctors-only’; $product_id = $product->is_type( ‘variation’ ) ? $product->get_parent_id() : $product->get_id(); if ( has_term( $restricted_category, ‘product_cat’,…Continue reading