I need help dealing with all the options in multi usage.
I use the product category, a new multiplier characteristic called "product_properties", I need a function to check that the option ID on which the user has selected on front-end, an option in the list Matches, and if any match is found then correct.
In this way I can check whether the user has chosen "Red" as a "color" on a product.
I need this in a phishing code:
Parameter: PostOptid, Current Object ID
-
2.1 If PostOffident == Option ID
2.1.1 Returns Correct
thanks
I finally find a way Has been :)
- $ product_properties_name is the name of a class-attribute, which is 'aspiration' -day Type is. In my case it is called 'product_properties' and there is a feature on 'product-class'.
Get all the properties of the object first: $ contentObjectAttributes = $ contentObject-> Version ($ ContentObject-> Attribute ('Current_ Circle')) - & gt; Content object properties ();
And then loop each one and find 'product_properties':
// loop All property objects (array_keys ($ content object properties) of the class forte $ key ) {$ ContentObjectAttribute = $ contentObjectAttributes [$ key]; $ ContentClassAttribute = $ contentObjectAttribute-> Content Class Attribute (); $ AttributeIdentifier = $ contentClassAttribute-> Attribute ("identifier"); // get 'product_properties'-attribute if ($ attributeIdentifier == $ product_properties_name) {// Get MultiPoint $ multioption_list = $ contentObjectAttribute-> material (); // All multi-select lists (color, make, brand etc.) Loop loop ($ multioption_list-> attribute ('multioption_list') $ index = & gt; $ as option) {// through this multivitch loop and Get all the options (get 'color', 'blue', 'red', 'green' etc.) foreach ($ option ['option list'] $ option) {$ optionValue = trim ($ option [ 'value']); // If there is a match on any $ option value, then something interesting ...}}}}}
- $ product_properties_name is the name of a class-attribute, which is 'aspiration' -day Type is. In my case it is called 'product_properties' and there is a feature on 'product-class'.
In "Products_proports", type "color" For each option
Comments
Post a Comment