Jump to content

th233u

Members
  • Content count

    1
  • Joined

  • Last visited

  1. Simple noninvasive implementation of Price-Multiplicative product attributes ( was missing from oscommerce ... eg. *1.1 was interpreted as -1.1). I found the "bof-eof" contrib too difficult to apply and review. shopping_cart.php in the shopping_cart.php_MULTIPLICATIVE_attributes_cleanly.zip has the .diff (also included) already applied. The diff adds only about +10 codelines, and another 10 lines rewritten for readability (avoiding some copypaste in the orig code). If product has multiple (sets of) attributes, avoid mixing *M and +A (except +0.0 which should be fine), otherwise operator precedence might not be deterministic/consistent as the order of product options sometimes gets messed up in oscommerce orders (which does not effect result if only + - used as traditionally; or only *,* options with this patch). The main part of the code is: $ovp = $attribute_price[$n]['options_values_price']; $pp = $attribute_price[$n]['price_prefix']; if ($pp == '+') { $attributes_price += $ovp; } elseif($pp == '-') { $attributes_price -= $ovp; } elseif($pp == '*') { $attributes_price += $this->last_products_price * ($ovp-1.0); $this->last_products_price *= $ovp; } shopping_cart.php_MULTIPLICATIVE_attributes_cleanly.zip
×