JuliusB Posted May 24, 2019 Share Posted May 24, 2019 Hi folks ! I have a problem. I try to add a tag programmatically with and odd result. Here is the code : $tag_list[] = "MyTag"; $product = new Product(5003334); Tag::addTags($default_lang, $product->id, $tag_list); I can see the tag on the backoffice on the edit product page BUT I can't found it if I search the tag on the frontoffice. However if I click the "save" button on the edit product page THEN I can found the product if I search the tag on the frontoffice. It's like the tag exist but a check or something similar is missing. I have the same problem if I try to add the tag directly on the DDB. Please help me ! Thank you ! Link to comment Share on other sites More sharing options...
JuliusB Posted May 27, 2019 Author Share Posted May 27, 2019 Please someone ! Link to comment Share on other sites More sharing options...
Janett Posted May 27, 2019 Share Posted May 27, 2019 Your code looks good but I think there are a Smarty cache on the front, so the product page is not updated until cache clear. For search problem, maybe it's because the search index is not updated. So try to clear cache and rebuild search index after create a new tag with your code. What is your Prestashop version ? Link to comment Share on other sites More sharing options...
JuliusB Posted May 27, 2019 Author Share Posted May 27, 2019 Thank you for your answer. I'm using Prestashop 1.6. I will try to rebuild the search index maybe that's just that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now