[HACK] Login for price
-
- Posts: 7
- Joined: Thu Sep 23, 2010 12:23 pm
Re: [HACK] Login for price
Hi Painstik
I can see that you creates custom codes and hack for ISC
What I need i a hack quite simple to the one in the above thread. It should be like this:
- Guest cannot see prices, they get a "login for prices" message instead of the price
- Once a guest register and log in, they can see the prices immediately. No need for verification by the shop admin
Could you help me to do a hack like this, and give me a roughly quote on it? It's quite urgent
Currently running Shooping Cart version 5.5.4
Thanks in advance.
Stefan Johannsen, Denmark
I can see that you creates custom codes and hack for ISC
What I need i a hack quite simple to the one in the above thread. It should be like this:
- Guest cannot see prices, they get a "login for prices" message instead of the price
- Once a guest register and log in, they can see the prices immediately. No need for verification by the shop admin
Could you help me to do a hack like this, and give me a roughly quote on it? It's quite urgent
Currently running Shooping Cart version 5.5.4
Thanks in advance.
Stefan Johannsen, Denmark
Re: [HACK] Login for price
Isn't that exactly what this script does?? See the very first thread...
ISC v6
-
- Posts: 7
- Joined: Thu Sep 23, 2010 12:23 pm
Re: [HACK] Login for price
I sounds like yes. But I can't get it to work on version 5.5.4 ?
Re: [HACK] Login for price
'@ stefanjohannsen
The 'hack' does work in ISC 5.5.4, so its odd you are having problems..
Here (for a while) is a test site showing a working example ---http://www.ihost4u.co.uk/xcart2/
Try - Email address: test@test.com Password: test
The 'hack' does work in ISC 5.5.4, so its odd you are having problems..
Here (for a while) is a test site showing a working example ---http://www.ihost4u.co.uk/xcart2/
Try - Email address: test@test.com Password: test
Last edited by Snooper on Thu Apr 05, 2012 7:51 pm, edited 2 times in total.
ISC 5.5.4 Ultimate : Being used here -- http://www.kdklondon.com
-
- Posts: 7
- Joined: Thu Sep 23, 2010 12:23 pm
Re: [HACK] Login for price
As soon as I replace he code as described in the very first thread I get this error when accessing the shop in the front-end:
This is how the first lines in the file "pricing.php" looks:
Any help would be appreciated 
Code: Select all
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/XXXXX/httpdocs/lib/pricing.php on line 21
Code: Select all
<?php
if (!defined('ISC_BASE_PATH')) {
die(" ");
}
require_once(ISC_BASE_PATH."/lib/currency.php");
/**
* Calculate the final product price. This function will calculate the final product price, including all the group/category/individual discounts
*
* @param array The product record array
* @param boolean True to format price to the currency locale currency. Default is true
* @param boolean True to convert price to the currency locale currency exchange rate. Default is true
* @param boolean Set to true if we want to show a struck out version of the retail price if this product has one. Defaults to true
* @return string The converted price
*/
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 for price</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);
}

Re: [HACK] Login for price
Stefan,
Try this instead:
In pricing.php
In productdetails.php around line 59
This should work!!
Let me know
Try this instead:
In pricing.php
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 for price</a>';
}
###### LOGIN FOR PRICE HACK EOF#############
Code: Select all
$this->SetProductVariations();
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return;
}
###### LOGIN FOR PRICE HACK EOF#############
Let me know
ISC v6
-
- Posts: 7
- Joined: Thu Sep 23, 2010 12:23 pm
Re: [HACK] Login for price
I really appreciate your help - thank you.
But I stil get this error
Line 21 in pricing.php is this:
I don't get it?
But I stil get this error
Code: Select all
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/xxxxx.dk/httpdocs/lib/pricing.php on line 21
Code: Select all
$customerClass = GetClass('ISC_CUSTOMER');
Re: [HACK] Login for price
Do you have some other modifications made to one of the files?? Probably you have a misplaced comma or something like that...
Attached the two files. I tried it again and it worked seamless...
Let me know
Attached the two files. I tried it again and it worked seamless...
Let me know

- Attachments
-
- ProductDetails.php.txt
- (32.94 KiB) Downloaded 1062 times
-
- pricing.php.txt
- (17.17 KiB) Downloaded 1098 times
ISC v6
-
- Posts: 7
- Joined: Thu Sep 23, 2010 12:23 pm
Re: [HACK] Login for price
Thank you so much - now it works 
Thank you, thank you, you really made my day!

Thank you, thank you, you really made my day!