0

"Use Default Value" gets unchecked, when product data is saved

"Use default value" being ignored for certain fields in multiple store mode

MAGENTO 2 “USE DEFAULT VALUE” STORE VIEW SCOPE FIX

Check This Link But Not Success.

After Migration Use Default Value Not Save When Product Have Migrated Attribute Set.

Example :-

I Have a 2 Attribute Set

  1. Default (Magento Default Attribute Set)
  2. Migration_Default (After Migration Generate Attribute Set)

When Product Attribute Set is Migration_Default Use Default Value Not Save.

And Also Is There Any Way To Combine Those 2 Attribute on Migration Process...

Using This Link I Got Temporary Solution...

Add This Code In This File /vendor/magento/module-ui/view/base/web/js/form/form.js

        // HACK for product - use default value...
            if($('input[name="product[name]"]').length){
                $(".admin__field-service").each(function(i, v){
                    if($(this).find("input").attr("type") == "checkbox"){
                        var name = $(this).find("input").attr("name");
                        var checked = $(this).find("input").prop("checked");
                        var value = 0;
                        if(checked){
                            value = 1;
                        }
                        source.set('data.'+name, value);
                    }
                });
            }
        // HACK for product - use default value...

And Also Debug form.js in line no.310 i'm also gettting use_default value Array (this.source.data.use_default)

But in Magento not Getting Any use_default Array

1

First backup your database and then run below SQL queries

delete from catalog_product_entity_int where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_decimal where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_text where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_datetime where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_varchar where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_int where IFNULL(store_id, 0) <> 0;

delete from catalog_product_entity_media_gallery_value where IFNULL(store_id, 0) <> 0;

It will set all products data to use default check and install this module for future

magento2-scope-fix

1
  • i already ry this module and also this query is for selected use default value.
    – Rk Rathod
    Sep 12 '19 at 5:24
0

I have had this issue before wasnt a quick fix but to fix it you need to manually go into the database and delete the specific store view values this will auto check the use default value it all came down to multiple values for the same store. sorry cant provide better solution just going from experience

1
  • i m already do this in local system. but in live site around 150000 record of store 1 so it is not possible in live site,
    – Rk Rathod
    Sep 10 '19 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.