[HACK] Login for price

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
KevinPebbleLTD
Posts: 4
Joined: Tue Oct 12, 2010 9:17 am
Location: England

Re: [HACK] Login for price

Post by KevinPebbleLTD »

Great thanks.

Seems to be working beautifully :D thanks for the great work :)
nella
Posts: 2
Joined: Wed Oct 20, 2010 1:46 am
Location: Australia

Re: [HACK] Login for price

Post by nella »

You're a legend Meules, well done mate, works like a charm.

:D :mrgreen:
dwrs
Posts: 16
Joined: Wed Feb 03, 2010 5:30 pm

Re: [HACK] Login for price

Post by dwrs »

Thank you so much :)
meules
Confirmed
Confirmed
Posts: 95
Joined: Wed Jun 17, 2009 8:56 pm
Location: NL

Re: [HACK] Login for price

Post by meules »

This is a small update to get the automatic email function to work in V6.

IN ADMIN/INCLUDES/CLASSES/CLASS.CUSTOMER.PHP AROUND LINE 2895 FIND

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;
					}
				}
			}
BEFORE ADD

Code: Select all

################### HACK LOGIN FOR PRICE BOF #####################################
			$GLOBALS['FirstName'] = isc_html_escape($StoreCustomer['custconfirstname']);
			$GLOBALS['ISC_LANG']['ThanksForRegisteringEmailLogin'] = sprintf(GetLang('ThanksForRegisteringEmailLogin'), $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php", $GLOBALS['ShopPathSSL']."/account.php");
             
             if ($StoreCustomer['custgroupid']) {
                $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 . $store_name);
				$obj_email->AddBody("html", $message);
				$obj_email->AddRecipient($StoreCustomer['custconemail'], "", "h");
				$email_result = $obj_email->Send();        
             }
################## HACK LOGIN FOR PRICE EOF #####################################
Now the email function should work again, the rest of the steps stay the same.
ISC v6
zokstar
Posts: 3
Joined: Fri Oct 14, 2011 1:00 pm
Location: Sydney

Re: [HACK] Login for price

Post by zokstar »

Worked great!! thank you very much!! Really appreciated!
lucaswagland
Posts: 1
Joined: Thu Jun 03, 2010 6:53 am

Re: [HACK] Login for price

Post by lucaswagland »

Hello,

I have been using this module for a while for a client, and they love it. I have had a bit of a scan through the code and appreciate just how much work goes into a mod/hack like this.

I have discovered a bit of an issue with it and hope you can help me find where to fix it. If you search for a product, on the search results page the add to cart button is displaying, and in the theme that I am using, shows the quantity boxes as well.

If you add the products to the cart, then pricing is shown.

I can manually cut out the quantity boxes, but I cannot get rid of the add to cart button. Any ideas?
meules
Confirmed
Confirmed
Posts: 95
Joined: Wed Jun 17, 2009 8:56 pm
Location: NL

Re: [HACK] Login for price

Post by meules »

Hi,

That's strange. I tested it on my site and it works on the search result pages. Have you included the step 3 of the instructions? Perhaps you have manually coded some sort of "add to cart" button? Whiich version are you on?

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:

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');
             }
          }

Replace with

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');
             }
          }
       }
This code hides all the "add to cart" buttons on the category pages and search pages.

Let me know...
ISC v6
catalinux
Posts: 6
Joined: Fri Jan 27, 2012 12:09 pm
Location: Romania

Re: [HACK] Login for price

Post by catalinux »

The same thing happened to me. I use ISC 6.1.1, I did all the modifications but in search results and when viewing products in any category as a list (not as grid) it's still showing the Quantity Box and Add to cart button at the bottom of the list.
When viewing the products in category as grid it's working the way it's supposed to.
Any ideas?
Any help would be very appreciate.
Thank you.
catalinux
Posts: 6
Joined: Fri Jan 27, 2012 12:09 pm
Location: Romania

Re: [HACK] Login for price

Post by catalinux »

I use default template from Interspire. I also tested a few other templates and it's just the same.
Thanks.
catalinux
Posts: 6
Joined: Fri Jan 27, 2012 12:09 pm
Location: Romania

Re: [HACK] Login for price

Post by catalinux »

Anyone ? Is this forum dead :cry: ?
Post Reply