thanks for the codes gjh42, i'll look into it, as for what i did, i changed the code for the price per word calculation in the shopping_cart class and the function_prices.php files.. here's what i did:
in function_prices.php line 1166
////
// calculate words price
function zen_get_word_count_price([B]$products_id,[/B] $string, $free=0, $price) {
[B]$actual_price = zen_get_products_actual_price($products_id);[/B]
$squareFoot = explode("x",$string);
if($squareFoot[0]<0||$squareFoot[1]<0) {
return 0;
} else if($squareFoot[0]>50||$squareFoot[1]>10){
return 0;
} else if(count($squareFoot) == 1){
return 0;
}else{
$pricePerSqFoot = ($squareFoot[0] * $squareFoot[1] * $price -[B]$actual_price[/B]);
return $pricePerSqFoot;
}
}
here i add in the products_id variable to the function, if i add this it wont calculate correctly when added to the cart anymore, the calculation in the product page still works though. also, if i remove the $products_id it works, im guessing there's a function used somewhere that i have to add the variable to, i used the dev toolkit to find them all and changed them but it stil didnt work..
in the shopping_cart.php class line 520 i add in:
$text_words = zen_get_word_count_price([B]$product->fields['products_id'],[/B] $this->contents[$products_id]['attributes_values'][$attribute_price->fields['options_id']], $attribute_price->fields['attributes_price_words_free'], $attribute_price->fields['attributes_price_words']);
what can i do so that the function calculates correctly with the $oroducts_id?