♥multimixer Posted April 18, 2010 Share Posted April 18, 2010 (edited) No word about the attribute id. Headache's next chapter: I think I was on the totally wrong way. Even using the attributes id cause the same mix up. In detail: In file attributeManagerInstant.class.php I did following where it is the case " * Updates the price and prefix in the products attribute table" starting at line about 240 1) I added one query to get the attributes id $mmAqueryString = "select products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id= '" . $this->intPID . "' and options_id='" . $optionId . "' and options_values_id='" . $optionValueId . "' "; $mmAquery = amDB::query($mmAqueryString); while($res = amDB::fetchArray($mmAquery)) $attrId = $res['products_attributes_id']; 2) I changed this amDB::perform(TABLE_PRODUCTS_ATTRIBUTES,$data, 'update',"products_id='$this->intPID' and options_id='$optionId' and options_values_id='$optionValueId'"); to this amDB::perform(TABLE_PRODUCTS_ATTRIBUTES,$data, 'update',"products_attributes_id='$attrId'"); So all selection go according to attribute id 3) To test that it picks the correct line I also write the attribute id into an other additional line of table products_attributes, so the array looks like this (just for testing) $data = array( 'options_values_price' => $price, 'price_prefix' => $prefix, 'options_price_calc' => $attrId ); What is the result? 1) Every price (or prefix update) goes to the correct line (I see always the matching attributes id written into my test field) 2) For all multi option options everything works perfectly 3) For text options it works only for the first option (of ie 3). When making changes to the second (according to option_id) then doesn't matter what I enter, the settings from previous option are copied into the next: price, prefix and sort order. It is not mixing the product_id's, but for sure the option id's Honestly I have no idea what to do now Edited April 18, 2010 by multimixer Quote My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.