removeProductFromCategory-- removes all catagories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

removeProductFromCategory-- removes all catagories

BJ Freeman
I may be miss reading this so checking
        <!-- If the associated category was the primary category for the
product, clear that field -->
        <entity-one entity-name="Product" value-name="product"
auto-field-map="true"/>
        <if-compare-field field-name="product.primaryProductCategoryId"
operator="equals" to-field-name="parameters.productCategoryId">
            <clear-field field-name="product.primaryProductCategoryId"/>
            <store-value value-name="product"/>
        </if-compare-field>

        <make-value value-name="lookupPKMap"
entity-name="ProductCategoryMember"/>
        <set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
        <find-by-primary-key entity-name="ProductCategoryMember"
map-name="lookupPKMap" value-name="lookedUpValue"/>
        <remove-value value-name="lookedUpValue"/>

I interpret this as the primaryProductCategoryId is made null

the relationships show one.

so if you have multiple product stores that link to this product all
category links are lost in  ProductCategory.


is would seem that there would need to be a walking list to pick he next
 primaryProductCategoryId and fill   product.primaryProductCategoryId

or atleast give an error if more than one ProductCategory is listed for
the product.primaryProductCategoryId and not do anything.