Przemysław Suszek Posted July 24, 2018 Share Posted July 24, 2018 I create my first module. I check the product classe and I don't any method to check if the product has already combinations by id or by name. For now I have something like this: $singleStock = $product->attributes()->stock->__toString(); $attrs = $product->attrs->attr[3]->__toString(); $product = new Product($checkUniqueID[0]['id_product']); $this->addAttributesToProduct($product, $singleStock, $attrs); This code add combinations, size of the clothes from XML to object product. I want to check if the product has already this combination. Thanks for any clue. Link to comment Share on other sites More sharing options...
ApoA Posted March 11, 2020 Share Posted March 11, 2020 Hi, to those who stumble in this question, here's some way: If you want to check if product has combination: use Product class hasAttributes() method, e.g. Product('id_product')->hasAttributes(). Regards 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