Extension point for set website ids product in case admin not set websiteHow to get the URL for the B2C website/storeview from a B2B website/storeview/product-pageMagento 2: Default REST API unable to update product data to multiple storesHow can I rewrite URL which can help for SEO with multiwebsite?Magento 2.1 Create a filter in the product grid by new attributeMagento2 : how to set per website is_required custom attribute for account creation formmysql deadlock when saving product with website ids through console commandMagento 2 Plugin for Contact Form Post ControllerMagento 2: I Want to add multiple product using checkboxI have created one field using product form field for my price i want save my field value at product creation time from backend magento2Get Quote Item's Selected Custom Options

How do I exit BASH while loop using modulus operator?

What is the most common color to indicate the input-field is disabled?

How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction

Avoiding the "not like other girls" trope?

Am I breaking OOP practice with this architecture?

Can I hook these wires up to find the connection to a dead outlet?

Could the museum Saturn V's be refitted for one more flight?

Theorists sure want true answers to this!

How to remove border from elements in the last row?

What is required to make GPS signals available indoors?

How badly should I try to prevent a user from XSSing themselves?

files created then deleted at every second in tmp directory

OP Amp not amplifying audio signal

Ambiguity in the definition of entropy

What are the G forces leaving Earth orbit?

What exactly is ineptocracy?

How can saying a song's name be a copyright violation?

Finitely generated matrix groups whose eigenvalues are all algebraic

Send out email when Apex Queueable fails and test it

What historical events would have to change in order to make 19th century "steampunk" technology possible?

How to stretch the corners of this image so that it looks like a perfect rectangle?

Forgetting the musical notes while performing in concert

How to install cross-compiler on Ubuntu 18.04?

Why was Sir Cadogan fired?



Extension point for set website ids product in case admin not set website


How to get the URL for the B2C website/storeview from a B2B website/storeview/product-pageMagento 2: Default REST API unable to update product data to multiple storesHow can I rewrite URL which can help for SEO with multiwebsite?Magento 2.1 Create a filter in the product grid by new attributeMagento2 : how to set per website is_required custom attribute for account creation formmysql deadlock when saving product with website ids through console commandMagento 2 Plugin for Contact Form Post ControllerMagento 2: I Want to add multiple product using checkboxI have created one field using product form field for my price i want save my field value at product creation time from backend magento2Get Quote Item's Selected Custom Options













0















This is my scenario I have hidden website_ids field in product form (default magento show it)
So how i can use plugin for set website ids for product when it create. Is there any entry-point to do this



My goal is if not website ids available when post data so init default website ids for product



Added modifier for modify Form:



public function modifyMeta(array $meta)

$this->_meta = unset($meta['websites']);
return $this->_meta;










share|improve this question




























    0















    This is my scenario I have hidden website_ids field in product form (default magento show it)
    So how i can use plugin for set website ids for product when it create. Is there any entry-point to do this



    My goal is if not website ids available when post data so init default website ids for product



    Added modifier for modify Form:



    public function modifyMeta(array $meta)

    $this->_meta = unset($meta['websites']);
    return $this->_meta;










    share|improve this question


























      0












      0








      0








      This is my scenario I have hidden website_ids field in product form (default magento show it)
      So how i can use plugin for set website ids for product when it create. Is there any entry-point to do this



      My goal is if not website ids available when post data so init default website ids for product



      Added modifier for modify Form:



      public function modifyMeta(array $meta)

      $this->_meta = unset($meta['websites']);
      return $this->_meta;










      share|improve this question
















      This is my scenario I have hidden website_ids field in product form (default magento show it)
      So how i can use plugin for set website ids for product when it create. Is there any entry-point to do this



      My goal is if not website ids available when post data so init default website ids for product



      Added modifier for modify Form:



      public function modifyMeta(array $meta)

      $this->_meta = unset($meta['websites']);
      return $this->_meta;







      magento2 product plugin multi-website






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 18 hours ago









      Ashish Viradiya

      1,0811830




      1,0811830










      asked Mar 30 at 5:27









      mrtuvnmrtuvn

      1,88411829




      1,88411829




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I post my answer here in case someone in future may need



          Create di.xml file for prepare plugin class



          <type name="MagentoCatalogControllerAdminhtmlProductInitializationHelper">
          <plugin name="updateProductWebsiteIds" type="NamespaceModulePluginControllerProductInitializationHelperWebsitePlugin" sortOrder="40" />
          </type>


          original class here



          Add new file Class WebsitePlugin



          public function afterInitialize(
          MagentoCatalogControllerAdminhtmlProductInitializationHelper $subject,
          MagentoCatalogModelProduct $product
          )
          if (Add your logic check here && isset($product))
          if (!$product->getWebsiteIds())
          $defaultWebsiteId = $this->storeManager->getDefaultStoreView()->getWebsiteId();
          $websitesIds = [$defaultWebsiteId];
          $product->setWebsiteIds($websitesIds);


          return $product;






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268028%2fextension-point-for-set-website-ids-product-in-case-admin-not-set-website%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I post my answer here in case someone in future may need



            Create di.xml file for prepare plugin class



            <type name="MagentoCatalogControllerAdminhtmlProductInitializationHelper">
            <plugin name="updateProductWebsiteIds" type="NamespaceModulePluginControllerProductInitializationHelperWebsitePlugin" sortOrder="40" />
            </type>


            original class here



            Add new file Class WebsitePlugin



            public function afterInitialize(
            MagentoCatalogControllerAdminhtmlProductInitializationHelper $subject,
            MagentoCatalogModelProduct $product
            )
            if (Add your logic check here && isset($product))
            if (!$product->getWebsiteIds())
            $defaultWebsiteId = $this->storeManager->getDefaultStoreView()->getWebsiteId();
            $websitesIds = [$defaultWebsiteId];
            $product->setWebsiteIds($websitesIds);


            return $product;






            share|improve this answer





























              0














              I post my answer here in case someone in future may need



              Create di.xml file for prepare plugin class



              <type name="MagentoCatalogControllerAdminhtmlProductInitializationHelper">
              <plugin name="updateProductWebsiteIds" type="NamespaceModulePluginControllerProductInitializationHelperWebsitePlugin" sortOrder="40" />
              </type>


              original class here



              Add new file Class WebsitePlugin



              public function afterInitialize(
              MagentoCatalogControllerAdminhtmlProductInitializationHelper $subject,
              MagentoCatalogModelProduct $product
              )
              if (Add your logic check here && isset($product))
              if (!$product->getWebsiteIds())
              $defaultWebsiteId = $this->storeManager->getDefaultStoreView()->getWebsiteId();
              $websitesIds = [$defaultWebsiteId];
              $product->setWebsiteIds($websitesIds);


              return $product;






              share|improve this answer



























                0












                0








                0







                I post my answer here in case someone in future may need



                Create di.xml file for prepare plugin class



                <type name="MagentoCatalogControllerAdminhtmlProductInitializationHelper">
                <plugin name="updateProductWebsiteIds" type="NamespaceModulePluginControllerProductInitializationHelperWebsitePlugin" sortOrder="40" />
                </type>


                original class here



                Add new file Class WebsitePlugin



                public function afterInitialize(
                MagentoCatalogControllerAdminhtmlProductInitializationHelper $subject,
                MagentoCatalogModelProduct $product
                )
                if (Add your logic check here && isset($product))
                if (!$product->getWebsiteIds())
                $defaultWebsiteId = $this->storeManager->getDefaultStoreView()->getWebsiteId();
                $websitesIds = [$defaultWebsiteId];
                $product->setWebsiteIds($websitesIds);


                return $product;






                share|improve this answer















                I post my answer here in case someone in future may need



                Create di.xml file for prepare plugin class



                <type name="MagentoCatalogControllerAdminhtmlProductInitializationHelper">
                <plugin name="updateProductWebsiteIds" type="NamespaceModulePluginControllerProductInitializationHelperWebsitePlugin" sortOrder="40" />
                </type>


                original class here



                Add new file Class WebsitePlugin



                public function afterInitialize(
                MagentoCatalogControllerAdminhtmlProductInitializationHelper $subject,
                MagentoCatalogModelProduct $product
                )
                if (Add your logic check here && isset($product))
                if (!$product->getWebsiteIds())
                $defaultWebsiteId = $this->storeManager->getDefaultStoreView()->getWebsiteId();
                $websitesIds = [$defaultWebsiteId];
                $product->setWebsiteIds($websitesIds);


                return $product;







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 18 hours ago

























                answered 18 hours ago









                mrtuvnmrtuvn

                1,88411829




                1,88411829



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268028%2fextension-point-for-set-website-ids-product-in-case-admin-not-set-website%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?