Category attribute's value does not get updated when in store emulation modeGet category Display ModeRearranged Subcategory Does not Reflect Store ViewCreate categories through installer$category->getChildren(); does not work?Remove store level value for category attributeGet custom attribute's value in Index (cms, home page)Get custom category attribute valueMagento2 - create new/update category programmatically for specific storeView not workingMulti-select value does not store empty valuesMagento 2 category updated programmatically not working

Efficient Algorithm for the boundary of a set of tiles

How can I tell if I'm being too picky as a referee?

How to cut a climbing rope?

How did NASA Langley end up with the first 737?

How to politely tell someone they did not hit "reply to all" in an email?

Is Jon Snow the last of his House?

Is "cool" appropriate or offensive to use in IMs?

What could a self-sustaining lunar colony slowly lose that would ultimately prove fatal?

Is the Indo-European language family made up?

First Match - awk

Is there an online tool which supports shared writing?

Value of a binomial series

Which European Languages are not Indo-European?

How to patch glass cuts in a bicycle tire?

In the 3D Zeldas, is it faster to roll or to simply walk?

Did this character show any indication of wanting to rule before S8E6?

What is a Power on Reset IC?

Is this statement about cut time correct?

What is the function of the corrugations on a section of the Space Shuttle's external tank?

Question in discrete mathematics about group permutations

When the Torah was almost lost and one (or several) Rabbis saved it?

Where have Brexit voters gone?

Why didn't Thanos use the Time Stone to stop the Avengers' plan?

Remove CiviCRM and Drupal links / banner on profile form



Category attribute's value does not get updated when in store emulation mode


Get category Display ModeRearranged Subcategory Does not Reflect Store ViewCreate categories through installer$category->getChildren(); does not work?Remove store level value for category attributeGet custom attribute's value in Index (cms, home page)Get custom category attribute valueMagento2 - create new/update category programmatically for specific storeView not workingMulti-select value does not store empty valuesMagento 2 category updated programmatically not working






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to update some category attribute's value for a specific store, and i need to do it in emulation mode.



So i do something like this:



$appEmulation = Mage::getSingleton("core/app_emulation");
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation(4);
$category = Mage::getModel("catalog/category");
$category->load(381);
$category->addData(['name'=>'help', 'description'=>'ffff']);
$category->save();
$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);


I expect it to update values for this category's attributes passed to addData function, but values stay as they were in the database.



print_r($category->getData(), 1)



Exception: Array
(
[entity_id] => 381
[parent_id] => 2
[created_at] => 2016-02-13 16:37:40
[updated_at] => 2019-05-18 21:30:32
[path] => 1/2/381
[position] => 1
[level] => 2
[children_count] => 267
[store_id] => 1
[all_children] =>
[available_sort_by] =>
[breadcrumbs_priority] =>
[category_seo_name] =>
[children] =>
[custom_apply_to_products] => 0
[custom_design] =>
[custom_design_from] =>
[custom_design_to] =>
[custom_layout_update] =>
[custom_use_parent_settings] => 0
[default_sort_by] =>
[description] =>
[display_mode] => PRODUCTS
[exclude_from_crosslinking] => 0
[exclude_from_html_sitemap] => 0
[exclude_from_sitemap] => 0
[fb_translate] => 1
[filter_price_range] =>
[hint] =>
[image] =>
[include_in_menu] => 1
[is_active] => 1
[is_anchor] => 0
[landing_page] =>
[menu_popular_categories] =>
[meta_description] =>
[meta_keywords] =>
[meta_robots] =>
[meta_title] =>
[name] => tratat
[page_layout] =>
[path_in_store] =>
[redirect_priority] =>
[seo_text] =>
[tags] => оборудование
[thumbnail] => --__138.jpg
[url_key] => oborudovanie
[url_path] => oborudovanie.html
)




So, as you can see store_id = 4 which means that it fetches from the store that i passed to the startEnvironmentEmulation function, but it looks like the data does not get saved.



If i remove the emulation the data gets saved correctly but for all stores, which is not what i want.










share|improve this question






























    0















    I am trying to update some category attribute's value for a specific store, and i need to do it in emulation mode.



    So i do something like this:



    $appEmulation = Mage::getSingleton("core/app_emulation");
    $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation(4);
    $category = Mage::getModel("catalog/category");
    $category->load(381);
    $category->addData(['name'=>'help', 'description'=>'ffff']);
    $category->save();
    $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);


    I expect it to update values for this category's attributes passed to addData function, but values stay as they were in the database.



    print_r($category->getData(), 1)



    Exception: Array
    (
    [entity_id] => 381
    [parent_id] => 2
    [created_at] => 2016-02-13 16:37:40
    [updated_at] => 2019-05-18 21:30:32
    [path] => 1/2/381
    [position] => 1
    [level] => 2
    [children_count] => 267
    [store_id] => 1
    [all_children] =>
    [available_sort_by] =>
    [breadcrumbs_priority] =>
    [category_seo_name] =>
    [children] =>
    [custom_apply_to_products] => 0
    [custom_design] =>
    [custom_design_from] =>
    [custom_design_to] =>
    [custom_layout_update] =>
    [custom_use_parent_settings] => 0
    [default_sort_by] =>
    [description] =>
    [display_mode] => PRODUCTS
    [exclude_from_crosslinking] => 0
    [exclude_from_html_sitemap] => 0
    [exclude_from_sitemap] => 0
    [fb_translate] => 1
    [filter_price_range] =>
    [hint] =>
    [image] =>
    [include_in_menu] => 1
    [is_active] => 1
    [is_anchor] => 0
    [landing_page] =>
    [menu_popular_categories] =>
    [meta_description] =>
    [meta_keywords] =>
    [meta_robots] =>
    [meta_title] =>
    [name] => tratat
    [page_layout] =>
    [path_in_store] =>
    [redirect_priority] =>
    [seo_text] =>
    [tags] => оборудование
    [thumbnail] => --__138.jpg
    [url_key] => oborudovanie
    [url_path] => oborudovanie.html
    )




    So, as you can see store_id = 4 which means that it fetches from the store that i passed to the startEnvironmentEmulation function, but it looks like the data does not get saved.



    If i remove the emulation the data gets saved correctly but for all stores, which is not what i want.










    share|improve this question


























      0












      0








      0








      I am trying to update some category attribute's value for a specific store, and i need to do it in emulation mode.



      So i do something like this:



      $appEmulation = Mage::getSingleton("core/app_emulation");
      $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation(4);
      $category = Mage::getModel("catalog/category");
      $category->load(381);
      $category->addData(['name'=>'help', 'description'=>'ffff']);
      $category->save();
      $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);


      I expect it to update values for this category's attributes passed to addData function, but values stay as they were in the database.



      print_r($category->getData(), 1)



      Exception: Array
      (
      [entity_id] => 381
      [parent_id] => 2
      [created_at] => 2016-02-13 16:37:40
      [updated_at] => 2019-05-18 21:30:32
      [path] => 1/2/381
      [position] => 1
      [level] => 2
      [children_count] => 267
      [store_id] => 1
      [all_children] =>
      [available_sort_by] =>
      [breadcrumbs_priority] =>
      [category_seo_name] =>
      [children] =>
      [custom_apply_to_products] => 0
      [custom_design] =>
      [custom_design_from] =>
      [custom_design_to] =>
      [custom_layout_update] =>
      [custom_use_parent_settings] => 0
      [default_sort_by] =>
      [description] =>
      [display_mode] => PRODUCTS
      [exclude_from_crosslinking] => 0
      [exclude_from_html_sitemap] => 0
      [exclude_from_sitemap] => 0
      [fb_translate] => 1
      [filter_price_range] =>
      [hint] =>
      [image] =>
      [include_in_menu] => 1
      [is_active] => 1
      [is_anchor] => 0
      [landing_page] =>
      [menu_popular_categories] =>
      [meta_description] =>
      [meta_keywords] =>
      [meta_robots] =>
      [meta_title] =>
      [name] => tratat
      [page_layout] =>
      [path_in_store] =>
      [redirect_priority] =>
      [seo_text] =>
      [tags] => оборудование
      [thumbnail] => --__138.jpg
      [url_key] => oborudovanie
      [url_path] => oborudovanie.html
      )




      So, as you can see store_id = 4 which means that it fetches from the store that i passed to the startEnvironmentEmulation function, but it looks like the data does not get saved.



      If i remove the emulation the data gets saved correctly but for all stores, which is not what i want.










      share|improve this question
















      I am trying to update some category attribute's value for a specific store, and i need to do it in emulation mode.



      So i do something like this:



      $appEmulation = Mage::getSingleton("core/app_emulation");
      $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation(4);
      $category = Mage::getModel("catalog/category");
      $category->load(381);
      $category->addData(['name'=>'help', 'description'=>'ffff']);
      $category->save();
      $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);


      I expect it to update values for this category's attributes passed to addData function, but values stay as they were in the database.



      print_r($category->getData(), 1)



      Exception: Array
      (
      [entity_id] => 381
      [parent_id] => 2
      [created_at] => 2016-02-13 16:37:40
      [updated_at] => 2019-05-18 21:30:32
      [path] => 1/2/381
      [position] => 1
      [level] => 2
      [children_count] => 267
      [store_id] => 1
      [all_children] =>
      [available_sort_by] =>
      [breadcrumbs_priority] =>
      [category_seo_name] =>
      [children] =>
      [custom_apply_to_products] => 0
      [custom_design] =>
      [custom_design_from] =>
      [custom_design_to] =>
      [custom_layout_update] =>
      [custom_use_parent_settings] => 0
      [default_sort_by] =>
      [description] =>
      [display_mode] => PRODUCTS
      [exclude_from_crosslinking] => 0
      [exclude_from_html_sitemap] => 0
      [exclude_from_sitemap] => 0
      [fb_translate] => 1
      [filter_price_range] =>
      [hint] =>
      [image] =>
      [include_in_menu] => 1
      [is_active] => 1
      [is_anchor] => 0
      [landing_page] =>
      [menu_popular_categories] =>
      [meta_description] =>
      [meta_keywords] =>
      [meta_robots] =>
      [meta_title] =>
      [name] => tratat
      [page_layout] =>
      [path_in_store] =>
      [redirect_priority] =>
      [seo_text] =>
      [tags] => оборудование
      [thumbnail] => --__138.jpg
      [url_key] => oborudovanie
      [url_path] => oborudovanie.html
      )




      So, as you can see store_id = 4 which means that it fetches from the store that i passed to the startEnvironmentEmulation function, but it looks like the data does not get saved.



      If i remove the emulation the data gets saved correctly but for all stores, which is not what i want.







      magento-1.9 category environment-emulation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 19 at 8:56







      Asadov Kamran

















      asked May 18 at 21:47









      Asadov KamranAsadov Kamran

      6619




      6619




















          0






          active

          oldest

          votes












          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%2f275144%2fcategory-attributes-value-does-not-get-updated-when-in-store-emulation-mode%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f275144%2fcategory-attributes-value-does-not-get-updated-when-in-store-emulation-mode%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form