Page 7 of 8

Re: [HACK] Login for price

Posted: Wed Oct 27, 2010 12:34 am
by KevinPebbleLTD
Great thanks.

Seems to be working beautifully :D thanks for the great work :)

Re: [HACK] Login for price

Posted: Wed Oct 27, 2010 8:25 am
by nella
You're a legend Meules, well done mate, works like a charm.

:D :mrgreen:

Re: [HACK] Login for price

Posted: Thu Oct 28, 2010 1:28 pm
by dwrs
Thank you so much :)

Re: [HACK] Login for price

Posted: Sun Feb 06, 2011 8:46 pm
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.

Re: [HACK] Login for price

Posted: Fri Oct 14, 2011 1:09 pm
by zokstar
Worked great!! thank you very much!! Really appreciated!

Re: [HACK] Login for price

Posted: Wed Nov 16, 2011 3:31 am
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?

Re: [HACK] Login for price

Posted: Thu Dec 15, 2011 9:23 pm
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...

Re: [HACK] Login for price

Posted: Wed Feb 01, 2012 10:45 pm
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.

Re: [HACK] Login for price

Posted: Wed Feb 01, 2012 10:48 pm
by catalinux
I use default template from Interspire. I also tested a few other templates and it's just the same.
Thanks.

Re: [HACK] Login for price

Posted: Sat Feb 11, 2012 8:13 am
by catalinux
Anyone ? Is this forum dead :cry: ?