{"id":382845,"date":"2026-10-13T13:16:22","date_gmt":"2026-10-13T13:16:22","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/jeytech-unit-price-guard-for-woocommerce\/"},"modified":"2026-10-13T18:54:16","modified_gmt":"2026-10-13T18:54:16","slug":"jeytech-unit-price-guard","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/jeytech-unit-price-guard\/","author":23573036,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.1","stable_tag":"1.0.1","tested":"7.1.3","requires":"6.6","requires_php":"7.4","requires_plugins":null,"header_name":"JeyTech Unit Price Guard for WooCommerce","header_author":"JeyTech","header_description":"Show the price per kg, litre, metre or square metre, calculated from the net quantity of each product and variation.","assets_banners_color":"95996f","last_updated":"2026-10-13 18:54:16","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/jeytech.app","rating":0,"author_block_rating":0,"active_installs":0,"downloads":72,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"jeytech","date":"2026-10-13 13:16:08","revision":3744015},"1.0.1":{"tag":"1.0.1","author":"jeytech","date":"2026-10-13 18:54:16","revision":3744728}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3744015,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3744015,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3744015,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3744015,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{"blueprint.json":{"filename":"blueprint.json","revision":3744729,"resolution":false,"location":"assets","locale":"","contents":"{\"$schema\":\"https:\\\/\\\/playground.wordpress.net\\\/blueprint-schema.json\",\"meta\":{\"author\":\"JeyTech\",\"title\":\"Unit Price Guard \\u2014 sample store\",\"description\":\"Explore unit prices on sample products, variations and cart.\"},\"preferredVersions\":{\"php\":\"8.3\",\"wp\":\"latest\"},\"features\":{\"networking\":false},\"landingPage\":\"\\\/?product=demo-coffee\",\"steps\":[{\"step\":\"defineWpConfigConsts\",\"consts\":{\"DISABLE_WP_CRON\":true,\"WP_HTTP_BLOCK_EXTERNAL\":true,\"WP_DEBUG\":true,\"WP_DEBUG_LOG\":true,\"WP_DEBUG_DISPLAY\":false}},{\"step\":\"writeFile\",\"path\":\"\\\/wordpress\\\/wp-content\\\/mu-plugins\\\/jeytech-preview.php\",\"data\":\"<?php\\nadd_filter('pre_wp_mail', '__return_true');\\nadd_filter('pre_http_request', function(){ return new WP_Error('preview_offline', 'External HTTP disabled.'); }, 1);\\nadd_filter('action_scheduler_allow_async_request_runner', '__return_false');\\nadd_filter('woocommerce_enable_setup_wizard', '__return_false');\\nadd_filter('woocommerce_show_admin_notice', '__return_false');\\nadd_action('template_redirect', function(){ if(is_page('demo-cart')) { if(null === WC()->cart) wc_load_cart(); if(WC()->cart->is_empty()) WC()->cart->add_to_cart(get_option('jeytech_preview_product')); } }, 1);\\n\"},{\"step\":\"setSiteOptions\",\"options\":{\"show_avatars\":0,\"blogname\":\"JeyTech \\u2014 sample store\",\"blogdescription\":\"Sample products for the Unit Price Guard demo.\",\"timezone_string\":\"Europe\\\/Paris\",\"woocommerce_currency\":\"EUR\",\"woocommerce_default_country\":\"FR\",\"woocommerce_store_address\":\"1 Example Demo Street (fictitious)\",\"woocommerce_store_city\":\"Paris\",\"woocommerce_store_postcode\":\"75001\",\"woocommerce_coming_soon\":\"no\",\"woocommerce_enable_guest_checkout\":\"yes\",\"woocommerce_onboarding_profile\":{\"completed\":true,\"skipped\":true},\"woocommerce_task_list_hidden\":\"yes\",\"woocommerce_allow_tracking\":\"no\",\"woocommerce_enable_marketplace_suggestions\":\"no\",\"woocommerce_custom_orders_table_enabled\":\"no\",\"permalink_structure\":\"\\\/%postname%\\\/\",\"woocommerce_price_decimal_sep\":\",\",\"woocommerce_price_thousand_sep\":\" \",\"woocommerce_currency_pos\":\"right_space\",\"woocommerce_price_num_decimals\":2}},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"woocommerce\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"jeytech-unit-price-guard\"},\"options\":{\"activate\":true}},{\"step\":\"runPHP\",\"code\":\"<?php\\nrequire '\\\/wordpress\\\/wp-load.php';\\nwp_set_current_user(1);\\nWC_Install::create_pages();\\nuse JeyTech\\\\UnitPriceGuard\\\\Plugin as P;\\n$p=new WC_Product_Simple(); $p->set_name('Demo coffee \\u2014 250 g'); $p->set_slug('demo-coffee'); $p->set_status('publish'); $p->set_regular_price('3.10'); $p->set_sale_price('2.50'); $p->set_description('A sample 250 g bag of coffee. Open the product editor to change the quantity or price.'); $p->update_meta_data(P::META_QTY,'250'); $p->update_meta_data(P::META_UNIT,'g'); $p->save(); update_option('jeytech_preview_product',$p->get_id());\\n$a=new WC_Product_Attribute(); $a->set_name('Size'); $a->set_options(array('75 cl','1.5 l')); $a->set_visible(true); $a->set_variation(true);\\n$oil=new WC_Product_Variable(); $oil->set_name('Demo olive oil'); $oil->set_slug('demo-olive-oil'); $oil->set_status('publish'); $oil->set_attributes(array($a)); $oil->save();\\nforeach(array(array('75 cl','9','75','cl'),array('1.5 l','15','1.5','l')) as $r){ $v=new WC_Product_Variation(); $v->set_parent_id($oil->get_id()); $v->set_attributes(array('size'=>$r[0])); $v->set_status('publish'); $v->set_regular_price($r[1]); $v->update_meta_data(P::META_QTY,$r[2]); $v->update_meta_data(P::META_UNIT,$r[3]); $v->save(); } WC_Product_Variable::sync($oil->get_id());\\n$cart=wp_insert_post(array('post_type'=>'page','post_status'=>'publish','post_name'=>'demo-cart','post_title'=>'Sample cart','post_content'=>'[woocommerce_cart]')); update_option('woocommerce_cart_page_id',$cart);\\nflush_rewrite_rules();\\necho wp_json_encode(array('wp'=>get_bloginfo('version'),'wc'=>WC_VERSION,'php'=>PHP_VERSION,'product'=>$p->get_id(),'variable'=>$oil->get_id()));\\n\"},{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"}]}"}},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3744015,"resolution":"1","location":"assets","locale":"","width":1365,"height":900},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3744015,"resolution":"2","location":"assets","locale":"","width":1365,"height":900},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3744015,"resolution":"3","location":"assets","locale":"","width":1365,"height":900},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3744015,"resolution":"4","location":"assets","locale":"","width":1365,"height":1305},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3744015,"resolution":"5","location":"assets","locale":"","width":1365,"height":949},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3744015,"resolution":"6","location":"assets","locale":"","width":1365,"height":902}},"screenshots":{"1":"Set the net quantity, quantity unit and unit price reference on a product.","2":"A sale product shows its price per kg, calculated from the active price.","3":"A variable product shows a unit price range and the selected variation's price per litre.","4":"Unit prices are displayed on product lists in a block theme.","5":"The Cart Block includes the configured unit price line.","6":"Adjust the display and unit price format under WooCommerce &gt; Unit Price."}},"plugin_section":[],"plugin_tags":[246589,259881,286454,13406,286],"plugin_category":[45],"plugin_contributors":[282653],"plugin_business_model":[],"class_list":["post-382845","plugin","type-plugin","status-publish","hentry","plugin_tags-base-price","plugin_tags-price-per-kg","plugin_tags-price-per-litre","plugin_tags-unit-price","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-jeytech","plugin_committers-jeytech"],"banners":{"banner":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/banner-772x250.png?rev=3744015","banner_2x":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/banner-1544x500.png?rev=3744015","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/icon-128x128.png?rev=3744015","icon_2x":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/icon-256x256.png?rev=3744015","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-1.png?rev=3744015","caption":"Set the net quantity, quantity unit and unit price reference on a product."},{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-2.png?rev=3744015","caption":"A sale product shows its price per kg, calculated from the active price."},{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-3.png?rev=3744015","caption":"A variable product shows a unit price range and the selected variation's price per litre."},{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-4.png?rev=3744015","caption":"Unit prices are displayed on product lists in a block theme."},{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-5.png?rev=3744015","caption":"The Cart Block includes the configured unit price line."},{"src":"https:\/\/ps.w.org\/jeytech-unit-price-guard\/assets\/screenshot-6.png?rev=3744015","caption":"Adjust the display and unit price format under WooCommerce &gt; Unit Price."}],"raw_content":"<!--section=description-->\n<p>Selling coffee by the 250 g bag, olive oil by the 75 cl bottle or fabric by the metre? Enter the net quantity once and the unit price is calculated from the current price every time the page is displayed. A price change or a sale never leaves a stale \"\u20ac\/kg\" in a product description.<\/p>\n\n<ul>\n<li>Net quantity and unit on simple products and on each variation (g, kg, ml, cl, l, cm, m, m\u00b2). Variations without their own quantity use the parent values.<\/li>\n<li>Unit price per kg, l, m or m\u00b2, or per 100 g \/ 100 ml when you choose it for a product.<\/li>\n<li>Calculated from the active price, sale included, with your store tax display settings and price decimals.<\/li>\n<li>Shown under the price on product pages and product lists (classic templates and product blocks), and for the selected variation.<\/li>\n<li>Variable products show a unit price range when every variation shares the same reference unit.<\/li>\n<li>Optional line in the cart, mini-cart and checkout, classic and Cart\/Checkout blocks.<\/li>\n<li>Editable format, for example \"{price} \/ {unit}\" or \"({price} per {unit})\".<\/li>\n<\/ul>\n\n<p>Products without a net quantity are not changed. The plugin makes no external requests and does not change prices, orders or stock.<\/p>\n\n<p>Which products must show a unit price depends on your country's rules. This plugin calculates and displays the unit price you configure; it does not decide whether a product is concerned.<\/p>\n\n<p>Translations are delivered through native WordPress language packs when available.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate with WooCommerce active.<\/li>\n<li>Edit a product: in Product data &gt; General, enter the Net quantity (e.g. 250), its Unit (g) and the unit price shown (per kg or per 100 g). For variations, open the variation and fill the same fields, or leave them empty to use the parent values.<\/li>\n<li>Optional: adjust the display and format under WooCommerce &gt; Unit Price.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"is%20the%20unit%20price%20updated%20during%20a%20sale%3F\"><h3>Is the unit price updated during a sale?<\/h3><\/dt>\n<dd><p>Yes. It is calculated from the active price each time it is displayed, so scheduled and manual sales are included.<\/p><\/dd>\n<dt id=\"does%20it%20include%20tax%3F\"><h3>Does it include tax?<\/h3><\/dt>\n<dd><p>It follows your WooCommerce tax display settings: the shop setting for product pages, the cart setting for the cart and checkout.<\/p><\/dd>\n<dt id=\"why%20is%20there%20no%20range%20on%20my%20variable%20product%3F\"><h3>Why is there no range on my variable product?<\/h3><\/dt>\n<dd><p>A range is shown only when every visible variation has a net quantity, directly or through the parent, with the same reference unit. The selected variation still shows its own unit price.<\/p><\/dd>\n<dt id=\"is%20it%20shown%20in%20order%20emails%3F\"><h3>Is it shown in order emails?<\/h3><\/dt>\n<dd><p>No. Version 1.0.0 shows the unit price on the storefront, cart and checkout.<\/p><\/dd>\n<dt id=\"what%20happens%20on%20uninstall%3F\"><h3>What happens on uninstall?<\/h3><\/dt>\n<dd><p>The plugin settings are deleted. Net quantities saved on products are kept.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Add an optional review invitation on this plugin's settings screen after 14 days and feature use, with per-user snooze and permanent dismissal.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Show the price per kg, litre, metre or square metre, calculated from each product's net quantity. Variations, sales and cart included.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/382845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=382845"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jeytech"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=382845"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=382845"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=382845"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=382845"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=382845"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=382845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}