{"id":354827,"date":"2022-10-14T04:38:12","date_gmt":"2022-10-14T04:38:12","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=354827"},"modified":"2023-01-09T10:27:13","modified_gmt":"2023-01-09T10:27:13","slug":"restrict-customers-placing-order-with-plugin","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/","title":{"rendered":"Restrict Place Order Using Plugin"},"content":{"rendered":"\n<p><strong>Restrict place order Using Plugin\/Interceptor in Magento 2<\/strong><\/p>\n\n\n\n<p>In some cases like placing an order, we can restrict customers to place the order. The common cases may be the low cart amount, geographical location issue, or any other issue.<\/p>\n\n\n\n<p>We can easily achieve this functionality using the Magento 2 plugin also known as interceptors without touching the core files.<\/p>\n\n\n\n<p>You can read about the interceptors through this link :<\/p>\n\n\n\n<p><a href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/plugins\/\">https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/plugins\/<\/a><\/p>\n\n\n\n<p>Also, you can follow our article on plugins &#8211;<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/magento2-use-plugins\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/webkul.com\/blog\/magento2-use-plugins\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"590\" height=\"260\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\" alt=\"webkul blog\" class=\"wp-image-354854\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp 590w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg-300x132.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg-250x110.webp 250w\" sizes=\"(max-width: 590px) 100vw, 590px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><strong>Here are the steps to achieve this functionality  <\/strong>&#8211;<\/p>\n\n\n\n<p>We can validate the Magento 2 product before order placement using plugins. We are using the before method here.<\/p>\n\n\n\n<p>We have created a separate module to achieve this which is a preferred and most secure way.<\/p>\n\n\n\n<p>Here are the steps :<\/p>\n\n\n\n<p>1)&nbsp;Firstly, Create a registration.php file inside the app\/code\/Vendor\/Module folder and paste this code to register the module into your store :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Vendor_Module\n * @author    Webkul &lt;support@webkul.com&gt;\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html ASL Licence\n * @link      https:\/\/store.webkul.com\/license.html\n *\/\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    &quot;Vendor_Module&quot;,\n    __DIR__\n);<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>2)&nbsp;Secondly, to you have to create module.xml file inside app\/code\/Vendor\/Module\/etc folder &#8211;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;!--\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Vendor_Module\n * @author    Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n--&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Module\/etc\/module.xsd&quot;&gt;\n    &lt;module name=&quot;Vendor_Module&quot; \/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p> The above two files are necessary to create and register our module in magento database. <\/p>\n\n\n\n<p>3- After registering the module, create&nbsp;di.xml&nbsp;at path&nbsp;app\\code\\Vendor\\Module\\etc folder, which is dependency injection file and inject the plugin\/interceptors dependency  &#8211;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:ObjectManager\/etc\/config.xsd&quot;&gt;\n&lt;!-- For Logged in Customer --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;type name=&quot;Magento\\Checkout\\Api\\PaymentInformationManagementInterface&quot;&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;plugin name=&quot;validate_order_with_plugin&quot; type=&quot;Vendor\\Module\\Plugin\\PlaceOrderValidationCheck&quot;\/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/type&gt;\n&lt;!-- Guest Customers --&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;type name=&quot;Magento\\Checkout\\Api\\GuestPaymentInformationManagementInterface&quot;&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;plugin name=&quot;restrict_guest_place_order&quot; type=&quot;Vendor\\Module\\Plugin\\GuestPlaceOrderValidationCheck&quot;\/&gt;\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/type&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p> 4 &#8211; &nbsp;After this create&nbsp;PlaceOrderValidationCheck.php&nbsp;file at location for logged in magento customer: &nbsp;app\\code\\Vendor\\Module\\Plugin\\PlaceOrderValidationCheck.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n&nbsp;\nnamespace Vendor\\Module\\Plugin;\n&nbsp;\nuse Magento\\Checkout\\Api\\PaymentInformationManagementInterface;\nuse Magento\\Framework\\Exception\\LocalizedException;\nuse Magento\\Quote\\Api\\Data\\PaymentInterface;\nuse Magento\\Quote\\Api\\Data\\AddressInterface;\n&nbsp;\n\/**\n* Class PlaceOrderValidationCheck\n*\/\nclass PlaceOrderValidationCheck\n{\n&nbsp;&nbsp;&nbsp;&nbsp;\/**\n&nbsp;&nbsp;&nbsp;&nbsp; * Validate order submitting\n&nbsp;&nbsp;&nbsp;&nbsp; *\n&nbsp;&nbsp;&nbsp;&nbsp; * @param PaymentInformationManagementInterface $subject\n&nbsp;&nbsp;&nbsp;&nbsp; * @param int $cartId\n&nbsp;&nbsp;&nbsp;&nbsp; * @param PaymentInterface $paymentMethod\n&nbsp;&nbsp;&nbsp;&nbsp; * @param AddressInterface|null $billingAddress\n&nbsp;&nbsp;&nbsp;&nbsp; * @return void\n&nbsp;&nbsp;&nbsp;&nbsp; * @throws LocalizedException\n&nbsp;&nbsp;&nbsp;&nbsp; *\/\n&nbsp;&nbsp;&nbsp;&nbsp;public function beforeSavePaymentInformationAndPlaceOrder(\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PaymentInformationManagementInterface $subject,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cartId,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PaymentInterface $paymentMethod,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AddressInterface $billingAddress = null\n&nbsp;&nbsp;&nbsp;&nbsp;) {\n    $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n    $cart = $objectManager-&gt;get(&#039;\\Magento\\Checkout\\Model\\Cart&#039;); \n    $grandTotal = $cart-&gt;getQuote()-&gt;getGrandTotal();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($grandTotal &lt; 100) {\n&nbsp;&nbsp;&nbsp;&nbsp;throw new LocalizedException(__(&quot;You can&#039;t place the order.&quot;));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}<\/pre>\n\n\n\n<p> <\/p>\n\n\n\n<p>5- &nbsp;Now, you can create&nbsp;GuestPlaceOrderValidationCheck.php file at&nbsp;path which is used for guest customers place order:  app\\code\\Vendor\\Module\\Plugin\\GuestPlaceOrderValidationCheck.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n&nbsp;\nnamespace Vendor\\Module\\Plugin;\n&nbsp;\nuse Magento\\Checkout\\Api\\GuestPaymentInformationManagementInterface;\nuse Magento\\Framework\\Exception\\LocalizedException;\nuse Magento\\Quote\\Api\\Data\\AddressInterface;\nuse Magento\\Quote\\Api\\Data\\PaymentInterface;\n&nbsp;\n\/**\n* Class GuestPlaceOrderValidationCheck\n*\/\nclass GuestPlaceOrderValidationCheck\n{\n&nbsp;&nbsp;&nbsp;&nbsp;\/**\n&nbsp;&nbsp;&nbsp;&nbsp; * Validate order submitting\n&nbsp;&nbsp;&nbsp;&nbsp; *\n&nbsp;&nbsp;&nbsp;&nbsp; * @param GuestPaymentInformationManagementInterface $subject\n&nbsp;&nbsp;&nbsp;&nbsp; * @param string $cartId\n&nbsp;&nbsp;&nbsp;&nbsp; * @param string $email\n&nbsp;&nbsp;&nbsp;&nbsp; * @param PaymentInterface $paymentMethod\n&nbsp;&nbsp;&nbsp;&nbsp; * @param AddressInterface|null $billingAddress\n&nbsp;&nbsp;&nbsp;&nbsp; * @return void\n&nbsp;&nbsp;&nbsp;&nbsp; * @throws LocalizedException\n&nbsp;&nbsp;&nbsp;&nbsp; *\/\n&nbsp;&nbsp;&nbsp;&nbsp;public function beforeSavePaymentInformationAndPlaceOrder(\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GuestPaymentInformationManagementInterface $subject,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cartId,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$email,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PaymentInterface $paymentMethod,\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AddressInterface $billingAddress = null\n&nbsp;&nbsp;&nbsp;&nbsp;)\n&nbsp;&nbsp;&nbsp;&nbsp;{\n    $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n    $cart = $objectManager-&gt;get(&#039;\\Magento\\Checkout\\Model\\Cart&#039;); \n    $grandTotal = $cart-&gt;getQuote()-&gt;getGrandTotal();\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($grandTotal &lt; 100) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new LocalizedException(__(&quot;You can&#039;t place the order.&quot;));\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;}\n}<\/pre>\n\n\n\n<p>6- Finally, run these commands in sequence:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:upgrade\nphp bin\/magento setup:di:compile\nphp bin\/magento setup:static-content:deploy -f\nphp bin\/magento cache:flush<\/pre>\n\n\n\n<p>That&#8217;s it! the functionality is achieved with after plugin easily.<\/p>\n\n\n\n<p>Whenever a customer places a store order, the plugin will check the grand total quote class and validate the condition. If the condition matches the error place order functionality will not work and throw an error.<\/p>\n\n\n\n<p>I hope this blog will help you in <a href=\"https:\/\/webkul.com\/magento-development\/\">Magento 2 development<\/a> also you may check our <a href=\"https:\/\/store.webkul.com\/Magento2-Elasticsearch.html\">Magento 2 elastic search extension<\/a><\/p>\n\n\n\n<p>Thanks  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Restrict place order Using Plugin\/Interceptor in Magento 2 In some cases like placing an order, we can restrict customers to place the order. The common cases may be the low cart amount, geographical location issue, or any other issue. We can easily achieve this functionality using the Magento 2 plugin also known as interceptors without <a href=\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":441,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13114,2070,13112,13115,42,13113],"class_list":["post-354827","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-interceptors","tag-magento2","tag-place-order","tag-place-order-with-restriction","tag-plugin","tag-restrict-orders"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Restrict Place Order Using Plugin - Webkul Blog restrict order<\/title>\n<meta name=\"description\" content=\"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Restrict Place Order Using Plugin - Webkul Blog restrict order\" \/>\n<meta property=\"og:description\" content=\"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-14T04:38:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-09T10:27:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\" \/>\n<meta name=\"author\" content=\"Arun Joshi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Joshi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\"},\"author\":{\"name\":\"Arun Joshi\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/8b94a9d95c7e434bc21e91ff0e614123\"},\"headline\":\"Restrict Place Order Using Plugin\",\"datePublished\":\"2022-10-14T04:38:12+00:00\",\"dateModified\":\"2023-01-09T10:27:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\"},\"wordCount\":359,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\",\"keywords\":[\"interceptors\",\"Magento2\",\"place order\",\"place order with restriction\",\"plugin\",\"restrict orders\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\",\"url\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\",\"name\":\"Restrict Place Order Using Plugin - Webkul Blog restrict order\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\",\"datePublished\":\"2022-10-14T04:38:12+00:00\",\"dateModified\":\"2023-01-09T10:27:13+00:00\",\"description\":\"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp\",\"width\":590,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Restrict Place Order Using Plugin\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/8b94a9d95c7e434bc21e91ff0e614123\",\"name\":\"Arun Joshi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff769a28846d6e43741fa4ccbfd685e02593e81a83320587121671ebd0143d43?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff769a28846d6e43741fa4ccbfd685e02593e81a83320587121671ebd0143d43?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Arun Joshi\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/arun-joshi632\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Restrict Place Order Using Plugin - Webkul Blog restrict order","description":"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/","og_locale":"en_US","og_type":"article","og_title":"Restrict Place Order Using Plugin - Webkul Blog restrict order","og_description":"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order","og_url":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-10-14T04:38:12+00:00","article_modified_time":"2023-01-09T10:27:13+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp","type":"","width":"","height":""}],"author":"Arun Joshi","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Arun Joshi","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/"},"author":{"name":"Arun Joshi","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/8b94a9d95c7e434bc21e91ff0e614123"},"headline":"Restrict Place Order Using Plugin","datePublished":"2022-10-14T04:38:12+00:00","dateModified":"2023-01-09T10:27:13+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/"},"wordCount":359,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp","keywords":["interceptors","Magento2","place order","place order with restriction","plugin","restrict orders"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/","url":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/","name":"Restrict Place Order Using Plugin - Webkul Blog restrict order","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp","datePublished":"2022-10-14T04:38:12+00:00","dateModified":"2023-01-09T10:27:13+00:00","description":"How to restrict place order using plugin in magento , Restriction on place order of product in magento 2, Restrict customer to place order","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/10\/accent-bg.webp","width":590,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/restrict-customers-placing-order-with-plugin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Restrict Place Order Using Plugin"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/8b94a9d95c7e434bc21e91ff0e614123","name":"Arun Joshi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff769a28846d6e43741fa4ccbfd685e02593e81a83320587121671ebd0143d43?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff769a28846d6e43741fa4ccbfd685e02593e81a83320587121671ebd0143d43?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Arun Joshi"},"url":"https:\/\/webkul.com\/blog\/author\/arun-joshi632\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/354827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/441"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=354827"}],"version-history":[{"count":14,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/354827\/revisions"}],"predecessor-version":[{"id":363735,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/354827\/revisions\/363735"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=354827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=354827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=354827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}