Page 1 of 1

Hide Prices / Customer Approval

Posted: Thu Apr 17, 2008 10:24 pm
by bruce
You will need to make the following change to the function index() in catalog\controller\account_create.php so that the address entered is linked correctly to the customer account. Some surrounding code is shown to help with location

Code: Select all

    	if (($request->isPost()) && ($this->validate())) {
      		$sql = "insert into customer set firstname = '?', lastname = '?', email = '?', telephone = '?', fax = '?', password = '?', newsletter = '?', status = '0', date_added = now()";
      		$database->query($database->parse($sql, $request->get('firstname', 'post'), $request->get('lastname', 'post'), $request->get('email', 'post'), $request->get('telephone', 'post'), $request->get('fax', 'post'), md5($request->get('password', 'post')), $request->get('newsletter', 'post')));
            $customerId = (int)$database->getLastId();
/*      		$customer->login($request->get('email', 'post'), $request->get('password', 'post'));
*/
      		$sql = "insert into address set customer_id = '?', firstname = '?', lastname = '?', company = '?', address_1 = '?', address_2 = '?', city = '?', postcode = '?', country_id = '?', zone_id = '?'";
      		$database->query($database->parse($sql, $customerId(), $request->get('firstname', 'post'), $request->get('lastname', 'post'), $request->get('company', 'post'), $request->get('address_1', 'post'), $request->get('address_2', 'post'), $request->get('city', 'post'), $request->get('postcode', 'post'), $request->get('country_id', 'post'), $request->get('zone_id', 'post')));
      		$database->query("update customer set address_id = '" . (int)$database->getLastId() . "' where customer_id = '" . $customerId . "'");
			
			$mail = $this->locator->create('mail');

Re: Hide Prices / Customer Approval

Posted: Fri Apr 18, 2008 12:21 am
by nowhinjing
Thank-you, Bruce for spotting this unexpected "feature" and posting the fix.  :-*

Most helpfull !

NWJ

Re: Hide Prices / Customer Approval

Posted: Sun Apr 20, 2008 5:28 pm
by nowhinjing
Revised and updated package loaded to the Contributions section.  :)

Thanks, again Bruce.

NWJ

Re: Hide Prices / Customer Approval

Posted: Thu Jun 26, 2008 7:18 am
by gibpat
After i installed this module its telling me when i view a product page in the price section that:
Notice: Undefined variable: price in /home/website/public_html/webstore/catalog/template/default/content/product.tpl on line 7

which is:

Code: Select all

<?php if ($price) { ?>
what may i need to change to correct this?

Re: Hide Prices / Customer Approval

Posted: Mon Jun 30, 2008 7:57 pm
by hm2k

Re: Hide Prices / Customer Approval

Posted: Tue Aug 12, 2008 10:31 pm
by bisam
Hi Gibpat, did you make any progress with this error? I have the same issue.

Re: Hide Prices / Customer Approval

Posted: Tue Aug 12, 2008 10:34 pm
by bruce
change from

Code: Select all

<?php if ($price) { ?>
to

Code: Select all

<?php if (isset($price)) { ?>

Re: Hide Prices / Customer Approval

Posted: Thu Aug 14, 2008 12:19 pm
by bisam
Thanks Bruce, fixed!
I also had to change



to

 

Why has no-one else hit on this problem? Did I stuff up the module install, or is the fix so obvious to all here that not thought worth commenting on?

Re: Hide Prices / Customer Approval

Posted: Wed Oct 22, 2008 6:05 pm
by Heilong
I'd like to use this contribution too.

But I already installed and modified the templates files and if I remember well some php files also.

Which lines need to be modified, cause in the readme it's just said to copy the files not really helpful for a previous installation.

Thanks for help

Re: Hide Prices / Customer Approval

Posted: Wed Oct 22, 2008 6:15 pm
by bruce
Unfortunately, you are stuck with the code review.

Re: Hide Prices / Customer Approval

Posted: Wed Oct 22, 2008 7:15 pm
by randomfactor
Heilong wrote: [...]
Which lines need to be modified, cause in the readme it's just said to copy the files not really helpful for a previous installation.
[...]
1. Started with a copy of v0.7.7 from http://open-cart.googlecode.com/svn/trunk/0.7.7/upload.

2. Copied contributed files over the source.

3. Created a patch file using TortoiseSVN.  Attached.

Heilong, if you haven't seen patch files before, google for "diff" and "patch" which are standard unix utilities from back in the day.