Need someone to work out how to hack something
Posted: Mon Nov 09, 2009 6:37 pm
If you look at our site we've got it set up so that there are "members" prices shown - i.e. a price you'd get if you had paid a members fee. This works fine except for with product variations, as these are generated on the fly. See http://www.savant-health.com/products/U ... ganic.html - click on the cheaper bottle, and the members price doesn't change.
The members price is generated in includes/display/ProductDetails.php by this piece of code:
All this finally came to a head because someone "researched" the members price of a couple of products before signing up as a member, had managed to pick pretty much the only 2 products where the displayed price remained lower than it should of done
The members price is generated in includes/display/ProductDetails.php by this piece of code:
I've found the bit in includes/classes/class.product.php that generates the variation price:$product = $GLOBALS['ISC_CLASS_PRODUCT']->GetProduct();
$membersPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice']);
$membersPrice = CalcProdCustomerGroupPrice($product, $membersPrice, 2);
$membersPrice = FormatPrice(ConvertPriceToCurrency($membersPrice));
$GLOBALS['MembersPrice'] = $membersPrice;
<!-- this bit is here to handle specific cases where we don't to display the discounted price to the public, even though the members do get a better rate. Don't ask, lol!-->
$GLOBALS['HideMembersPrice'] = '';
$GLOBALS['HideCallForMembersPrice'] = 'display: none';
switch ($product['productid']) {
case 230:
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = '';
break;
case 231:
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = '';
break;
case 232:
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = '';
break;
case 233:
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = '';
break;
case 234:
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = '';
break;
}
if($membersPrice >= $GLOBALS['ISC_CLASS_PRODUCT']->GetCalculatedPrice()) {
$GLOBALS['HideMembersPrice'] = 'display: none';
$GLOBALS['HideCallForMembersPrice'] = 'display: none';
}
Can anyone sew the 2 together...???? The commented out bit up in the first part of code doesn't need translating through to this part of things, just left it there for completeness.$variationPrice = CurrencyConvertFormatPrice(CalcProductVariationPrice($variationBasePrice, $variation['vcpricediff'], $variation['vcprice'], $this->_product));
All this finally came to a head because someone "researched" the members price of a couple of products before signing up as a member, had managed to pick pretty much the only 2 products where the displayed price remained lower than it should of done
