I used this hack for a B2B site. I wanted my customers to be approved before they can order anything, but give potential customers an idea what we have to offer. So what I needed was just this simple hack. It's quick and very easy to "install".
1.Open /LIB/PRICING.PHP
2.Find at the top of the file around line 21
Code: Select all
function CalculateProductPrice($product, $doLocaleFormat=true, $doCurrencyConvert=true, $strikeOutRetail=true)
{
if (!GetConfig('ShowProductPrice') || $product['prodhideprice'] == 1) {
return '';
}
$actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
$actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice);
Code: Select all
function CalculateProductPrice($product, $doLocaleFormat=true, $doCurrencyConvert=true, $strikeOutRetail=true)
{
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return '<a href="%%GLOBAL_ShopPathNormal%%/login.php">Login voor prijs</a>';
}
###### LOGIN FOR PRICE HACK EOF#############
if (!GetConfig('ShowProductPrice') || $product['prodhideprice'] == 1) {
return '';
}
$actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
$actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice);
5. Find somewhere at the bottom around line 302
Code: Select all
if(GetConfig('AddToCartButtonPosition') == 'middle' && $GLOBALS['ISC_CLASS_PRODUCT']->IsPurchasingAllowed()) {
require_once ISC_BASE_PATH.'/includes/display/SideProductAddToCart.php';
ISC_SIDEPRODUCTADDTOCART_PANEL::LoadAddToCartOptions('middle');
$GLOBALS['SNIPPETS']['ProductAddToCart'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductAddToCart");
}
Code: Select all
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return;
}
###### LOGIN FOR PRICE HACK EOF#############
if(GetConfig('AddToCartButtonPosition') == 'middle' && $GLOBALS['ISC_CLASS_PRODUCT']->IsPurchasingAllowed()) {
require_once ISC_BASE_PATH.'/includes/display/SideProductAddToCart.php';
ISC_SIDEPRODUCTADDTOCART_PANEL::LoadAddToCartOptions('middle');
$GLOBALS['SNIPPETS']['ProductAddToCart'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductAddToCart");
}

Regards,
Meules