• Resolved goranpro

    (@goranpro)


    Hi,

    Im doing the code bellow in my REST API call. What i have noticed is that this code changes the permalinks(to the one defined in slug) on some products and NOT on some others. Im not sure why. How could i make sure that the permalniks are ALWAYS rewriten to the new defined “slug”(or title)?

    $data = [
    ‘name’ => $productTitle,
    ‘slug’ => $productTitle,
    ];

    $result = $woocommerce->put(‘products/’ . $productId, $data);

Viewing 1 replies (of 1 total)
  • Plugin Support mouli a11n

    (@mouli)

    Hi there,
    From your code snippet it looks as if you are updating a products Title and Slug using the REST API.
    My initial thought is that you are using the Product Title as the slug without updating it to make it all lower case and replace spaces with -.
    Try using slugs that are correctly formed to see if this is the issue.

    Good luck with it 🙂

Viewing 1 replies (of 1 total)

The topic ‘REST API and permalinks’ is closed to new replies.