This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://www.proy.info/woocommerce-allow-only-1-product-per-category/ | |
// Allow only one(or pre-defined) product per category in the cart | |
// Alternatively, try plugin: https://wordpress.org/plugins/woo-cart-limit/ | |
add_filter( 'woocommerce_add_to_cart_validation', 'allowed_quantity_per_category_in_the_cart', 10, 2 ); | |
function allowed_quantity_per_category_in_the_cart( $passed, $product_id) { | |
$max_num_products = 1;// change the maximum allowed in the cart | |
$running_qty = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SET PhpStormPath=C:\Program Files\JetBrains\PhpStorm 2020.2.1\bin\phpstorm64.exe | |
echo Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f | |
echo Adding within a folder entries |