4

I got to update weight, qty, price and others field, but when I update the product name, on catalog list (admin) the product change the name, but when I enter on edit view, the product continue with the last name and on store search, the name continue the last too. But on API rest the name is updated.

I'm using POSTMAN, ex: Request a PUT on http://localhost/mystore/rest/V1/products/24-MB04:

{

  "product" : {
        "name" : "TESTE PRODUCT NAME",
        "weight" : 200,
        "custom_attributes": [
        {
          "attribute_code": "MARCA",
          "value": "TEST"
        }
      ]

  }
}

The response was

{
  "id": 2,
  "sku": "24-MB04",
  "name": "TESTE PRODUCT NAME",
  "attribute_set_id": 15,
  "price": 32,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": "2016-06-26 15:22:24",
  "updated_at": "2016-06-26 15:22:24",
  "weight": 200,
  "extension_attributes": {
    "stock_item": {
      "item_id": 2,
      "product_id": 2,
      "stock_id": 1,
      "qty": 100,
      "is_in_stock": true,
      "is_qty_decimal": false,
      "show_default_notification_message": false,
      "use_config_min_qty": true,
      "min_qty": 0,
      "use_config_min_sale_qty": 1,
      "min_sale_qty": 1,
      "use_config_max_sale_qty": true,
      "max_sale_qty": 10000,
      "use_config_backorders": true,
      "backorders": 0,
      "use_config_notify_stock_qty": true,
      "notify_stock_qty": 1,
      "use_config_qty_increments": true,
      "qty_increments": 0,
      "use_config_enable_qty_inc": true,
      "enable_qty_increments": false,
      "use_config_manage_stock": true,
      "manage_stock": true,
      "low_stock_date": null,
      "is_decimal_divided": false,
      "stock_status_changed_auto": 0
    }
  },
  "product_links": [],
  "options": [],
  "media_gallery_entries": [
    {
      "id": 2,
      "media_type": "image",
      "label": "Image",
      "position": 1,
      "disabled": false,
      "types": [
        "image",
        "small_image",
        "thumbnail"
      ],
      "file": "/m/b/mb04-black-0.jpg"
    },
    {
      "id": 3,
      "media_type": "image",
      "label": "Image",
      "position": 2,
      "disabled": false,
      "types": [],
      "file": "/m/b/mb04-black-0_alt1.jpg"
    }
  ],
  "tier_prices": [],
  "custom_attributes": [
    {
      "attribute_code": "description",
      "value": "<p>Convenience is next to nothing when your day is crammed with action. So whether you're heading to class, gym, or the unbeaten path, make sure you've got your Strive Shoulder Pack stuffed with all your essentials, and extras as well.</p>\n<ul>\n<li>Zippered main compartment.</li>\n<li>Front zippered pocket.</li>\n<li>Side mesh pocket.</li>\n<li>Cell phone pocket on strap.</li>\n<li>Adjustable shoulder strap and top carry handle.</li>\n</ul>"
    },
    {
      "attribute_code": "special_price",
      "value": "32.0000"
    },
    {
      "attribute_code": "special_from_date",
      "value": "2016-06-26 15:22:24"
    },
    {
      "attribute_code": "image",
      "value": "/m/b/mb04-black-0.jpg"
    },
    {
      "attribute_code": "small_image",
      "value": "/m/b/mb04-black-0.jpg"
    },
    {
      "attribute_code": "thumbnail",
      "value": "/m/b/mb04-black-0.jpg"
    },
    {
      "attribute_code": "color",
      "value": "49"
    },
    {
      "attribute_code": "news_from_date",
      "value": "2016-06-26 15:22:24"
    },
    {
      "attribute_code": "custom_design_from",
      "value": "2016-06-26 15:22:24"
    },
    {
      "attribute_code": "category_ids",
      "value": [
        "3",
        "7",
        "4"
      ]
    },
    {
      "attribute_code": "options_container",
      "value": "container2"
    },
    {
      "attribute_code": "required_options",
      "value": "0"
    },
    {
      "attribute_code": "has_options",
      "value": "0"
    },
    {
      "attribute_code": "url_key",
      "value": "strive-shoulder-pack"
    },
    {
      "attribute_code": "tax_class_id",
      "value": "2"
    },
    {
      "attribute_code": "activity",
      "value": "11,21,23,18"
    },
    {
      "attribute_code": "style_bags",
      "value": "27,29,30"
    },
    {
      "attribute_code": "material",
      "value": "32,33,36,38"
    },
    {
      "attribute_code": "strap_bags",
      "value": "61,62,65,66,67"
    },
    {
      "attribute_code": "features_bags",
      "value": "72,74,75,78"
    },
    {
      "attribute_code": "size",
      "value": "91"
    },
    {
      "attribute_code": "erin_recommends",
      "value": "1"
    },
    {
      "attribute_code": "sale",
      "value": "1"
    },
    {
      "attribute_code": "marca",
      "value": "TEST"
    }
  ]
}

When I enter on edit view product on catalog, the weight was changed,but the name didn't change!

Somebody can help me?

Thanks

  • hi @ranan cuoghi i would like to know do u have any idea to how add new attribute and value to the response object of this api rest/V1/products/24-MB04 ? – NIPPU Aug 8 '17 at 12:21
1

It's only a indexer cache. I use these commands:

php bin/magento setup:static-content:deploy

php bin/magento indexer:reindex.

  • I am also have the same problem @Renan Cuoghi . Is it working after reindexing and deploying ? – Vignesh Bala Feb 21 '17 at 5:48
  • Yes, it's only a cache. Reindex and clean cache. – Renan Cuoghi Mar 7 '17 at 15:21
  • No it's not working. I think it is Magento's bug – Vignesh Bala Mar 9 '17 at 5:47
  • Set the attribute name to global on Store > Attributes > Product – Renan Cuoghi Mar 10 '17 at 11:29
-1

It works in default stores view, i think you should use

/rest/{store_code}/V1/products/{sku}.

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.