[HACK] Login for price
-
- Posts: 4
- Joined: Tue Oct 12, 2010 9:17 am
- Location: England
Re: [HACK] Login for price
Hey I'm having problems with version 6.0.14 .
I can get the code to work on the home page but the product details page doesn't work and neither does the remove add to cart button.
I can find the code in the file as per the examples.
Any help or pointers would be greatly appreciated.
Thanks.
I can get the code to work on the home page but the product details page doesn't work and neither does the remove add to cart button.
I can find the code in the file as per the examples.
Any help or pointers would be greatly appreciated.
Thanks.
-
- Posts: 4
- Joined: Tue Oct 12, 2010 9:17 am
- Location: England
Re: [HACK] Login for price


I'll keep having a look too and let you know.
Keep me posted

Re: [HACK] Login for price
Hi Meules,
Have you had any success with the hack for Shopping Cart version 6.0.14?
Similar to KevinPebble, we are trying to setup the following scenario on Interspire Shopping Cart:
1) Retail customers can see products but not pricing, must see 'Login for Pricing' link/Approved Wholesellers can see products, pricing and place an order.
2) When a new customer signs up he/she must be approved by an ADMIN first before they view pricing and can order. After he/she signs up and prior to approval, the pricing will show something like 'Waitng for Approval' or similar.
I tried using the snippets of code in the forum but unfornuately it only half works and the retail customer can still order as they see 0.00 but the Buy Button is present. This also doesn't address the 'wholesaler needs to be approved' issue.
Have you had any success with the hack for Shopping Cart version 6.0.14?
Similar to KevinPebble, we are trying to setup the following scenario on Interspire Shopping Cart:
1) Retail customers can see products but not pricing, must see 'Login for Pricing' link/Approved Wholesellers can see products, pricing and place an order.
2) When a new customer signs up he/she must be approved by an ADMIN first before they view pricing and can order. After he/she signs up and prior to approval, the pricing will show something like 'Waitng for Approval' or similar.
I tried using the snippets of code in the forum but unfornuately it only half works and the retail customer can still order as they see 0.00 but the Buy Button is present. This also doesn't address the 'wholesaler needs to be approved' issue.
Re: [HACK] Login for price
That's exactly what this mod does
. But I'm still working on the product pages where indeed the buy buttons still appear. I can't figure out why the code doesn't work for v6... but I keep trying, until then you have to be patient 


ISC v6
Re: [HACK] Login for price
Hi
I'm using your hack for this module and thank you very much for your efforts.
I want to ask you something this is working but for example i m a new user and cant see the price it s right but when I click a category ,I saw top right filter dropdown box. and filter price asc or desc. I'm a wholeseller and some resellers can filter and can guess my min & max price of my products .Is there anyway to dı login for price and filter ?
This problem's very annoying me
Thank you.
EDİT : and also how can I hide this SideCategoryShopByPrice side panel to guests ,I just want to show this for approved resellers ?
I'm using your hack for this module and thank you very much for your efforts.
I want to ask you something this is working but for example i m a new user and cant see the price it s right but when I click a category ,I saw top right filter dropdown box. and filter price asc or desc. I'm a wholeseller and some resellers can filter and can guess my min & max price of my products .Is there anyway to dı login for price and filter ?
This problem's very annoying me

Thank you.
EDİT : and also how can I hide this SideCategoryShopByPrice side panel to guests ,I just want to show this for approved resellers ?
Code: Select all
<div class="Block ShopByPrice Moveable Panel" id="SideCategoryShopByPrice" style="display:%%GLOBAL_HideSideCategoryShopByPricePanel%%">
<h2>%%LNG_ShopByPrice%%</h2>
<div class="BlockContent">
<ul>
%%SNIPPET_SideCategoryShopByPrice%%
</ul>
</div>
</div>
Re: [HACK] Login for price
Ok, finally I found a solution for V6. Basically the steps are the same but some of the code was changed and moved to different files. I've added all the necessary steps in this post.
STEP 1:
In includes\display\ProductDetails.php around line 70 find
Add after
STEP 2:
In \lib\Pricing.php find around line 19
Replace with:
A little further around line 75 find
Replace with
STEP 3:
We need to hide the "add to cart" button in all panels for people who are not logged in or are approved by the store owner.
in lib\templates\products_panel.php find around line 94:
Replace with
STEP 4:
In your admin panel create 3 customer groups. For example:
group 1: Accepted
group 2: With discount
group 3: Foreign
STEP 5 [OPTIONAL]
First of all credits go to Painstik who made this nice little addition.
If you want to send an (automatic) email to your customers, who you just have approved, we need to set up some things. Here we go...
1. First create a new html file in templates/__emails and name it verified_account.html
Add this in that file:
2. Open: language/admin/customers.ini
Add this:
3. Open: admin/includes/classes/class.customers.php
Find around line 2862
Add before:
Important note!!
The email is only send when you update the customer group in the edit panel for a customer. Go to the new signed up customer --> click "edit" --> update customer group and then hit "Save & Exit".
It doesn't work when you change customers group from customers grid at the dropdown menu.
STEP 1:
In includes\display\ProductDetails.php around line 70 find
Code: Select all
$this->SetMinMaxQty();
Code: Select all
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return;
}
$groupId = 0;
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
if($customer['custgroupid'] == 0) {
return;
}
###### LOGIN FOR PRICE HACK EOF#############
In \lib\Pricing.php find around line 19
Code: Select all
function formatProductCatalogPrice($product, array $options = array())
{
$displayFormat = getConfig('taxDefaultTaxDisplayCatalog');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
Code: Select all
function formatProductCatalogPrice($product, array $options = array())
{
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return '<a href="%%GLOBAL_ShopPathNormal%%/login.php">Login voor prijs</a>';
}
$groupId = 0;
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
if($customer['custgroupid'] == 0) {
return '<a href="#">waiting for verification</a>'; //
}
###### LOGIN FOR PRICE HACK EOF#############
$displayFormat = getConfig('taxDefaultTaxDisplayCatalog');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
Code: Select all
function formatProductDetailsPrice($product, array $options = array())
{
$displayFormat = getConfig('taxDefaultTaxDisplayProducts');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
Code: Select all
function formatProductDetailsPrice($product, array $options = array())
{
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return '<a href="%%GLOBAL_ShopPathNormal%%/login.php">Login voor prijs</a>';
}
$groupId = 0;
$customerClass = GetClass('ISC_CUSTOMER'); // get customer class
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) { // which group?
$groupId = $customer['custgroupid']; // Oh, that group
}
if($customer['custgroupid'] == 0) { // If customer is in the default group return message, 0 = default group, 1 = waiting for verification etc
return 'Waiting for verification'; //
}
###### LOGIN FOR PRICE HACK EOF#############
$displayFormat = getConfig('taxDefaultTaxDisplayProducts');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
We need to hide the "add to cart" button in all panels for people who are not logged in or are approved by the store owner.
in lib\templates\products_panel.php find around line 94:
Code: Select all
if (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired'] == 1) {
$GLOBALS['ProductURL'] = ProdLink($row['prodname']);
$GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
} else {
$GLOBALS['ProductURL'] = CartLink($row['productid']);
if ($GLOBALS['ProductPreOrder']) {
$GLOBALS['ProductAddText'] = GetLang('ProductPreOrderCartLink');
} else {
$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
}
}
Code: Select all
$customerClass = GetClass('ISC_CUSTOMER');
$groupId = 0;
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
if(!$customerClass->GetCustomerId()) {
$GLOBALS['HideActionAdd'] = 'none';
} elseif($customer['custgroupid'] == 0) {
$GLOBALS['HideActionAdd'] = 'none';
}
else {
if (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired'] == 1) {
$GLOBALS['ProductURL'] = ProdLink($row['prodname']);
$GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
} else {
$GLOBALS['ProductURL'] = CartLink($row['productid']);
if ($GLOBALS['ProductPreOrder']) {
$GLOBALS['ProductAddText'] = GetLang('ProductPreOrderCartLink');
} else {
$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
}
}
}
In your admin panel create 3 customer groups. For example:
group 1: Accepted
group 2: With discount
group 3: Foreign
STEP 5 [OPTIONAL]
First of all credits go to Painstik who made this nice little addition.
If you want to send an (automatic) email to your customers, who you just have approved, we need to set up some things. Here we go...
1. First create a new html file in templates/__emails and name it verified_account.html
Add this in that file:
Code: Select all
<html><body style="font-family:Arial; font-size:12px">
<div style="padding:0px 20px 20px 20px">
<h2 style="font-size:22px; height:30px; color:#cc6600; border-bottom:dashed 1px gray">%%LNG_ThanksForRegisteringAt%% %%GLOBAL_StoreName%%</h2>
<p>%%LNG_Hi%% %%GLOBAL_FirstName%%,</p>
<p>%%LNG_YourAccountIsVerified%%</a>
<p>%%LNG_ThanksForRegisteringEmailLogin%%</a>
<p>%%LNG_ThanksForRegisteringAtIntro%%</p>
%%GLOBAL_EmailFooter%%
</div>
</body></html>
Add this:
Code: Select all
YourAccountIsVerifiedIntro = "Your account is verified."
YourAccountIsVerified = "You account is verified blabla (text within content)."
ThanksForRegisteringAtIntro = "Thank you for registering on our site bla bla bla"
ThanksForRegisteringEmailLogin = "For login on your account please visit <a href='%s'>%s</a> or <a href='%s'>click here</a>."
Find around line 2862
Code: Select all
if (gzte11(ISC_MEDIUMPRINT)) {
$existingCustomer = $this->customerEntity->get($customerId);
if (isId($existingCustomer['custformsessionid'])) {
$GLOBALS['ISC_CLASS_FORM']->saveFormSession(FORMFIELDS_FORM_ACCOUNT, true, $existingCustomer['custformsessionid']);
} else {
$formSessionId = $GLOBALS['ISC_CLASS_FORM']->saveFormSession(FORMFIELDS_FORM_ACCOUNT);
if (isId($formSessionId)) {
$StoreCustomer['custformsessionid'] = $formSessionId;
}
}
}
Code: Select all
$GLOBALS['FirstName'] = isc_html_escape($StoreCustomer['firstname']);
$GLOBALS['ISC_LANG']['ThanksForRegisteringEmailLogin'] = sprintf(GetLang('ThanksForRegisteringEmailLogin'), $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php");
if ($StoreCustomer['customergroupid']) {
$store_name = GetConfig('StoreName');
$subject = GetLang('YourAccountIsVerifiedIntro');
$emailTemplate = FetchEmailTemplateParser();
$emailTemplate->SetTemplate("verified_account");
$message = $emailTemplate->ParseTemplate(true);
require_once(ISC_BASE_PATH . "/lib/email.php");
$obj_email = GetEmailClass();
$obj_email->Set('CharSet', GetConfig('CharacterSet'));
$obj_email->From(GetConfig('OrderEmail'), $store_name);
$obj_email->Set("Subject", $subject);
$obj_email->AddBody("html", $message);
$obj_email->AddRecipient($StoreCustomer['email'], "", "h");
$email_result = $obj_email->Send();
}
The email is only send when you update the customer group in the edit panel for a customer. Go to the new signed up customer --> click "edit" --> update customer group and then hit "Save & Exit".
It doesn't work when you change customers group from customers grid at the dropdown menu.
Last edited by meules on Tue Oct 26, 2010 10:34 pm, edited 1 time in total.
ISC v6
-
- Posts: 4
- Joined: Tue Oct 12, 2010 9:17 am
- Location: England
Re: [HACK] Login for price
Hey thats great thanks.
I have a slight problem though.
When you view a product it shows the price:
http://foodmakerdirect.co.uk/products.p ... n-Stuffing
Everywhere else it seems to be hidden like its suppose to be
great work on finding the fix
I have a slight problem though.
When you view a product it shows the price:
http://foodmakerdirect.co.uk/products.p ... n-Stuffing
Everywhere else it seems to be hidden like its suppose to be

great work on finding the fix

Re: [HACK] Login for price
I forgot to mention something in my previous post. Post is already edited.
What you have to do is
In /lib/pricing.php
Around line 75 find
replace with
Now it should work fine. Please let me know.
Cheers
What you have to do is
In /lib/pricing.php
Around line 75 find
Code: Select all
function formatProductDetailsPrice($product, array $options = array())
{
$displayFormat = getConfig('taxDefaultTaxDisplayProducts');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
Code: Select all
function formatProductCatalogPrice($product, array $options = array())
{
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return '<a href="%%GLOBAL_ShopPathNormal%%/login.php">Login voor prijs</a>';
}
$groupId = 0;
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
if($customer['custgroupid'] == 0) {
return '<a href="#">waiting for verification</a>'; //
}
###### LOGIN FOR PRICE HACK EOF#############
$displayFormat = getConfig('taxDefaultTaxDisplayCatalog');
$options['displayInclusive'] = $displayFormat;
if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
return formatProductPrice($product, $product['prodcalculatedprice'], $options);
}
Cheers
ISC v6