Jump to content

Get all product by specific tag


Otaksone

Recommended Posts

hello you can use the method of class Tag like this

first define the context and id_lang
after that

array of tags

$tags_array = ['tag1', 'tag2', 'tag3'];

if array then you need to make a foreach loop

foreach($tags_array as $tag){
    $tag_obj = new Tag(null, $tag, $id_lang);
    $products = $tag_obj->getProducts();
    
    //...
}

Link to comment
Share on other sites

  • 2 weeks later...
On 10/11/2019 at 8:56 AM, Razi said:

hello you can use the method of class Tag like this

first define the context and id_lang
after that

array of tags

$tags_array = ['tag1', 'tag2', 'tag3'];

if array then you need to make a foreach loop

foreach($tags_array as $tag){
    $tag_obj = new Tag(null, $tag, $id_lang);
    $products = $tag_obj->getProducts();
    
    //...
}

HI, perfect work. I can get only name and id, i can get link product and image?

 

Array
(
    [name] =Album Portafoto Orsacchiotto Rosa - Ottaviani
    [id_product] = 5

}

Edited by Otaksone (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...