{"id":347573,"date":"2022-08-18T12:11:55","date_gmt":"2022-08-18T12:11:55","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=347573"},"modified":"2022-12-28T08:22:02","modified_gmt":"2022-12-28T08:22:02","slug":"how-to-use-cs-cart-hooks-part-1","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/","title":{"rendered":"How to Use Cs-Cart Hooks (Part -1)"},"content":{"rendered":"\n<p>In this Blog, we will learn about Cs-Cart <mark>Hooks<\/mark> in the coding scenario and their types.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is hooking?<\/strong><\/h2>\n\n\n\n<p>&#8216;Hooking&#8217; is a programming concept that is used to control flow. Hook are the entry points in the code for external code and for modifications. We can use hook in Cs-cart to manipulate the data or get the data in between the flow of the code.<br>There is also a Cs-Cart hook <a href=\"https:\/\/docs.cs-cart.com\/latest\/developer_guide\/addons\/hooking\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">explanation<\/a>.<\/p>\n\n\n\n<p>The hook is very important in creating <a href=\"https:\/\/store.webkul.com\/CS-Cart.html\">add-ons in CS-Cart<\/a>.<\/p>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\"><strong>Cs-Cart Hooks Types<\/strong><\/h2>\n\n\n\n<p>There are two types of hooks used in Cs-Cart.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>PHP Hooks<\/strong><\/li>\n\n\n\n<li><strong>TPL Hooks<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\"><strong>PHP Hooks<\/strong><\/h2>\n\n\n\n<p>PHP hook are specifically specified in the core code of the Cs-Cart. We can use these hooks by calling a specified function of the hook in the addon.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"986\" height=\"43\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\" alt=\"image-24\" class=\"wp-image-347594\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png 986w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24-300x13.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24-250x11.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24-768x33.png 768w\" sizes=\"(max-width: 986px) 100vw, 986px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">CsCart hook setup<\/figcaption><\/figure>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\"><strong>How to use Hooks in Cs-Cart<\/strong><\/h2>\n\n\n\n<p>There are two ways to set hooks in the add-on:-<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Using addon Init and func file<\/li>\n\n\n\n<li>Using addon XML scheme 4.0 and Bootstrap.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\"><strong>Using the addon Init and func file<\/strong><\/h2>\n\n\n\n<p>Firstly, we have to register the hook which we are going to use in <strong>\u2018init.php\u2019<\/strong> by using <strong>\u2018fn_registers_hooks\u2019.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-25.png\" alt=\"image-25\" class=\"wp-image-347595\" width=\"597\" height=\"77\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-25.png 471w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-25-300x39.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-25-250x32.png 250w\" sizes=\"(max-width: 597px) 100vw, 597px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Register hook<\/figcaption><\/figure>\n\n\n\n<p>Now Hook is registered, you can use it by creating a hook function in the addon. We have to create a specified function in the addon \u2018func.php\u2019 file. The hook Function name should be specified in this way: &#8211;<\/p>\n\n\n\n<p>\u2018<strong>fn_addon_name_hook_name(arguments) {<\/strong><\/p>\n\n\n\n<p><strong>\/\/Your code<\/strong><\/p>\n\n\n\n<p><strong>}<\/strong><\/p>\n\n\n\n<p><em>Example<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_1.png\" alt=\"blog_1\" class=\"wp-image-347613\" width=\"820\" height=\"70\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_1.png 922w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_1-300x26.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_1-250x21.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_1-768x66.png 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Created a change_order_status hook function<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"461\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2-1200x461.png\" alt=\"blog2\" class=\"wp-image-347615\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2-1200x461.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2-300x115.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2-250x96.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2-768x295.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog2.png 1263w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\"> Changing Order status<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"112\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33-1200x112.png\" alt=\"blog_33\" class=\"wp-image-347626\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33-1200x112.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33-300x28.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33-250x23.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33-768x72.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_33.png 1294w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\"> Result of change_order_status hook<\/figcaption><\/figure>\n\n\n\n<h2 class=\"has-medium-font-size wp-block-heading\"><strong>Using addon XML scheme 4.0 and Bootstra<\/strong>p<\/h2>\n\n\n\n<p><mark>The OOPS concept is needed for using the hook in this way.<\/mark><br>In this, we have to use scheme 4.0 so that we can use autoloader PSR-4 in the addon XML file. <\/p>\n\n\n\n<p> <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_7.png\" alt=\"blog_7\" class=\"wp-image-348191\" width=\"819\" height=\"51\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_7.png 780w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_7-300x19.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_7-250x16.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_7-768x48.png 768w\" sizes=\"(max-width: 819px) 100vw, 819px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Scheme 4.0<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"908\" height=\"85\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_8.png\" alt=\"blog_8\" class=\"wp-image-348192\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_8.png 908w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_8-300x28.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_8-250x23.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_8-768x72.png 768w\" sizes=\"(max-width: 908px) 100vw, 908px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Autoloader PSR4<\/figcaption><\/figure>\n\n\n\n<p>In the addon.xml file, you can load the controller using namespace through the PSR4 tag.<\/p>\n\n\n\n<p>Now, you have to create the src folder inside the addon.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"445\" height=\"221\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_13.png\" alt=\"blog_13\" class=\"wp-image-348287\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_13.png 445w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_13-300x149.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_13-250x124.png 250w\" sizes=\"(max-width: 445px) 100vw, 445px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Structure for hook<\/figcaption><\/figure>\n\n\n\n<p>Use ServiceProvider.php for registering hook handlers classes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"647\" height=\"124\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_14.png\" alt=\"blog_14\" class=\"wp-image-348288\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_14.png 647w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_14-300x57.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_14-250x48.png 250w\" sizes=\"(max-width: 647px) 100vw, 647px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Register hooks class<\/figcaption><\/figure>\n\n\n\n<p>Now, map hook in bootstrap.php using getHookHandlerMap() function.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"661\" height=\"232\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_15.png\" alt=\"blog_15\" class=\"wp-image-348290\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_15.png 661w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_15-300x105.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_15-250x88.png 250w\" sizes=\"(max-width: 661px) 100vw, 661px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Map Hook methods<\/figcaption><\/figure>\n\n\n\n<p>Then, you have to create methods in the hook handler class according to the map.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"658\" height=\"40\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_16.png\" alt=\"blog_16\" class=\"wp-image-348291\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_16.png 658w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_16-300x18.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/blog_16-250x15.png 250w\" sizes=\"(max-width: 658px) 100vw, 658px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Hook method<\/figcaption><\/figure>\n\n\n\n<p>Note:-  The blog will contain TPL Hook.<\/p>\n\n\n\n<p>For Rest API documentation:- Refer to this <a href=\"https:\/\/webkul.com\/blog\/cs-cart-rest-api\/\">link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Blog, we will learn about Cs-Cart Hooks in the coding scenario and their types. What is hooking? &#8216;Hooking&#8217; is a programming concept that is used to control flow. Hook are the entry points in the code for external code and for modifications. We can use hook in Cs-cart to manipulate the data or <a href=\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":457,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-347573","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Cs-Cart Hooks (Part -1) -Hooks<\/title>\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\/how-to-use-cs-cart-hooks-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Cs-Cart Hooks (Part -1) -Hooks\" \/>\n<meta property=\"og:description\" content=\"In this Blog, we will learn about Cs-Cart Hooks in the coding scenario and their types. What is hooking? &#8216;Hooking&#8217; is a programming concept that is used to control flow. Hook are the entry points in the code for external code and for modifications. We can use hook in Cs-cart to manipulate the data or [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\" \/>\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-08-18T12:11:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-28T08:22:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\" \/>\n<meta name=\"author\" content=\"Abhishek Kumar\" \/>\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=\"Abhishek Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\"},\"author\":{\"name\":\"Abhishek Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/6119c902a336cdd05474ed2585b821b7\"},\"headline\":\"How to Use Cs-Cart Hooks (Part -1)\",\"datePublished\":\"2022-08-18T12:11:55+00:00\",\"dateModified\":\"2022-12-28T08:22:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\"},\"wordCount\":389,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\",\"name\":\"How to Use Cs-Cart Hooks (Part -1) -Hooks\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\",\"datePublished\":\"2022-08-18T12:11:55+00:00\",\"dateModified\":\"2022-12-28T08:22:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png\",\"width\":986,\"height\":43,\"caption\":\"image-24\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Cs-Cart Hooks (Part -1)\"}]},{\"@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\/6119c902a336cdd05474ed2585b821b7\",\"name\":\"Abhishek Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0ac65d7de58cd54f4aff681f269b93f405d8f20566de29cf023ec28b8d513891?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\/0ac65d7de58cd54f4aff681f269b93f405d8f20566de29cf023ec28b8d513891?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Abhishek Kumar\"},\"description\":\"Skilled CS-Cart developer with expertise in Generative AI Integration, POS, and AMP. He excels in CS-Cart Marketplace Development, POS System Development, and Headless Development, crafting innovative and efficient solutions that drive business success and enhance user experiences.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/abhishek-kumar025\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Cs-Cart Hooks (Part -1) -Hooks","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\/how-to-use-cs-cart-hooks-part-1\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Cs-Cart Hooks (Part -1) -Hooks","og_description":"In this Blog, we will learn about Cs-Cart Hooks in the coding scenario and their types. What is hooking? &#8216;Hooking&#8217; is a programming concept that is used to control flow. Hook are the entry points in the code for external code and for modifications. We can use hook in Cs-cart to manipulate the data or [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-08-18T12:11:55+00:00","article_modified_time":"2022-12-28T08:22:02+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png","type":"","width":"","height":""}],"author":"Abhishek Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Abhishek Kumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/"},"author":{"name":"Abhishek Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/6119c902a336cdd05474ed2585b821b7"},"headline":"How to Use Cs-Cart Hooks (Part -1)","datePublished":"2022-08-18T12:11:55+00:00","dateModified":"2022-12-28T08:22:02+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/"},"wordCount":389,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/","url":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/","name":"How to Use Cs-Cart Hooks (Part -1) -Hooks","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png","datePublished":"2022-08-18T12:11:55+00:00","dateModified":"2022-12-28T08:22:02+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/08\/image-24.png","width":986,"height":43,"caption":"image-24"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-cs-cart-hooks-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Cs-Cart Hooks (Part -1)"}]},{"@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\/6119c902a336cdd05474ed2585b821b7","name":"Abhishek Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0ac65d7de58cd54f4aff681f269b93f405d8f20566de29cf023ec28b8d513891?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\/0ac65d7de58cd54f4aff681f269b93f405d8f20566de29cf023ec28b8d513891?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Abhishek Kumar"},"description":"Skilled CS-Cart developer with expertise in Generative AI Integration, POS, and AMP. He excels in CS-Cart Marketplace Development, POS System Development, and Headless Development, crafting innovative and efficient solutions that drive business success and enhance user experiences.","url":"https:\/\/webkul.com\/blog\/author\/abhishek-kumar025\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/347573","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\/457"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=347573"}],"version-history":[{"count":19,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/347573\/revisions"}],"predecessor-version":[{"id":362097,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/347573\/revisions\/362097"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=347573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=347573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=347573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}