cancel
Showing results for 
Search instead for 
Did you mean: 

Add some product links in 1 request

SOLVED

Add some product links in 1 request

Hi anyone! I've tried for make a request like this:

{
    "items": [
        {
            "sku": "product-test",
            "link_type": "crosssell",
            "linked_product_sku": "product-1"
        },
        {
            "sku": "product-test",
            "link_type": "crosssell",
            "linked_product_sku": "product-2"
        },
        {
            "sku": "product-test",
            "link_type": "related",
            "linked_product_sku": "product-1"
        }
    ]
}

for product-test, it's already have a crosssell product link. I think it's must be updated, but there's no update. any solutions?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Add some product links in 1 request

Hello @harits_rahman 

You can refer the below links for the solution:

 

https://magento.stackexchange.com/questions/158137/update-only-related-products-programatically-mage...

 

https://gist.github.com/mrkhoa99/bd43fe34fc51d1f7fd38fbf7d13d384b

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

View solution in original post

3 REPLIES 3

Re: Add some product links in 1 request

Hello @harits_rahman 

You can refer the below links for the solution:

 

https://magento.stackexchange.com/questions/158137/update-only-related-products-programatically-mage...

 

https://gist.github.com/mrkhoa99/bd43fe34fc51d1f7fd38fbf7d13d384b

 

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Add some product links in 1 request

So, I must makes some requests again for make another product links added to the product?

Re: Add some product links in 1 request

Hey @harits_rahman  

 

For that, you need to create an array variable and store your product SKU in the array as per your requirement.

 

Thanks.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"