Jump to content

seyi

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by seyi

  1. Best solution by far. Just for others, the code a little cleaned up, so you do not get a smarty parsing error: Redirect to previous page <input type="hidden" class="hidden" name="back" value="{$smarty.server.HTTP_REFERER}" /> Redirect to home page <input type="hidden" class="hidden" name="back" value="/" />
  2. Most frustrated I have ever been trying to setup a paypal account. I mean really????? I gave up and just read through the code, found if you run the queries directly in the db it works fine. For sandbox: UPDATE p_configuration SET value="***api password***" WHERE name="PAYPAL_PSWD_SANDBOX"; UPDATE p_configuration SET value="***api signature***" WHERE name="PAYPAL_SIGNATURE_SANDBOX"; UPDATE p_configuration SET value="***api username***" WHERE name="PAYPAL_USERNAME_SANDBOX"; UPDATE p_configuration SET value="***merchant id***" WHERE name="PAYPAL_MERCHANT_ID_SANDBOX"; UPDATE p_configuration SET value="1" WHERE name="PAYPAL_CONNECTION_EC_CONFIGURED"; For live: UPDATE p_configuration SET value="***api password***" WHERE name="PAYPAL_PSWD_LIVE"; UPDATE p_configuration SET value="***api signature***" WHERE name="PAYPAL_SIGNATURE_LIVE"; UPDATE p_configuration SET value="***api username***" WHERE name="PAYPAL_USERNAME_LIVE"; UPDATE p_configuration SET value="***merchant id***" WHERE name="PAYPAL_MERCHANT_ID_LIVE"; UPDATE p_configuration SET value="1" WHERE name="PAYPAL_CONNECTION_EC_CONFIGURED"; Merchant ID can be found in paypal > profile > business info. Updating PAYPAL_CONNECTION_EC_CONFIGURED to 1 is required, this is how it flags it connected.
  3. The more correct solution would be to make a new controller as the solution I created just piggy backed off the customer controller since most of the code would be the same. But in the end, it is really just preference, as long as the outcome is what you want.
  4. Hello, If you are using an seo extension, you could probably add the custom url and set the seo url yourself. Or another option is to add it to your htaccess file.
  5. Not using that version so cant be sure. Looking at the code though, it should work. Verify the wholesale email template is in the right location.
  6. Glad to hear it works. In your authentication_wholesale.tpl, is the form url as such? <form action="{$link->getPageLink('authentication', true, NULL, 'layout=wholesale')|escape:'html':'UTF-8'}" method="post" id="account-creation_form" class="std box"> The "layout=wholesale" is very important
  7. Hello, In your authentication_wholesale.tpl, did you update the form action and the submit button? For the override AuthController.php, you got that direct from the download right, not copied from the post? And you cleared the class cache by deleting or rename the file /cache/class_index.php
  8. Ok, I could not find any extensions that do this for prestashop 1.6, so ended up building the functionality myself. Please backup any files before attempting to making any changes detailed in this post. My needs: the functionality to create a separate registration page for a wholesale account. In processing the registration, the account is initially inactive and a notification email is sent to the admin to prompt him/her to approve. Here is the full code: wholesale_registration.zip Edit: Above link does not seem to work anymore, here is dropbox link: https://www.dropbox.com/s/hu6nc5yy91mupd7/wholesale_registration.zip?dl=0 1. Added the override file: /override/controllers/front/AuthController.php THIS IS NOT THE FULL CODE SO DO NOT COPY AND PASTE <?php class AuthController extends AuthControllerCore { public $wholesale_customer_group = 4; // // // more code here // // public function processSubmitAccountWholesale() { $this->processSubmitAccountWholesaleCreateAccount(); if(empty($this->errors)) { $customer = $this->context->customer; // add customer to wholesale group $customer->cleanGroups(); // delete all customer groups $customer->addGroups(array((int)$this->wholesale_customer_group)); // disable customer, needs approval if($customer->active==1) $customer->toggleStatus(); // send email to admin for approval Mail::Send( $this->context->language->id, 'wholesale_registration', Mail::l('Wholesale Registration'), array( '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME') ); // now log the customer out $customer->logout(); // // finishing touches from processSubmitAccount() // if (!$customer->is_guest) if (!$this->sendConfirmationMail($customer)) $this->errors[] = Tools::displayError('The email cannot be sent.'); if ($this->ajax) { $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, 'isSaved' => true, 'id_customer' => (int)$this->context->cookie->id_customer, 'id_address_delivery' => $this->context->cart->id_address_delivery, 'id_address_invoice' => $this->context->cart->id_address_invoice, 'token' => Tools::getToken(false) ); die(Tools::jsonEncode($return)); } Tools::redirect('index.php?controller=authentication&layout=wholesale_confirm'); } } // // // more code here // // } If you need to edit this file, the above are most likely what you need to edit. $wholesale_customer_group is the id of the wholesale customer group. Function processSubmitAccountWholesale adds the customer to the wholesale group, inactivates the account, logs out the user, and sends the notification email to the admin. One other note, if you are are adding this file for the first time, you will need to delete or rename the file /cache/class_index.php for the override to take effect. 2. Add the registration template file /themes/[YOUR_THEME]/authentication_wholesale.tpl This file is just a copy of /themes/[YOUR_THEME]/authentication.tpl, with 2 changes First I changed: <form action="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" method="post" id="account-creation_form" class="std box"> to this <form action="{$link->getPageLink('authentication', true, NULL, 'layout=wholesale')|escape:'html':'UTF-8'}" method="post" id="account-creation_form" class="std box"> And changed this <button type="submit" name="submitAccount" id="submitAccount" class="btn btn-default button button-medium"> to this: <button type="submit" name="SubmitAccountWholesale" id="SubmitAccountWholesale" class="btn btn-default button button-medium"> 3. Add the registration confirmation template /themes/[YOUR_THEME]/authentication_wholesale_confirm.php This is just the confirmation page that is shown after registering on the wholesale confirmation account 4. Add the mail templates /themes/[YOUR_THEME]/mails/[iSO]/wholesale_registration.html /themes/[YOUR_THEME]/mails/[iSO]/wholesale_registration.txt This is the email notification sent to the admin That is it. If everything is done correctly, you will be able to access the separate registration page here: [YOUR_WEBSITE_ADDRESS]/index.php?controller=authentication&layout=wholesale Here is the full code: wholesale_registration.zip Edit: Above link does not seem to work anymore, here is dropbox link: https://www.dropbox.com/s/hu6nc5yy91mupd7/wholesale_registration.zip?dl=0
  9. Hello, I get it too, but in my case, it is because I have outgoing emails disabled and I receive this warning instead, and it is never sent: ------------------------------------ Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in \tools\swift\Swift\Plugin\MailSend.php on line 160 freeorder:FAUEFWWGN:mail@mail.com ------------------------------------ If you want to find out the cause of what is causing it, go to this file: www/themes/default/js/order-opc.js, find function confirmFreeOrder, around line 261, and within the: success: function(html) { add this: alert('success'); alert(html); If you read the code further, you will see it is splitting on ":", and so it is finding the warning, instead of the returned text "freeorder:FAUEFWWGN:mail@mail.com". After you update the js file just make sure you browser loads the updated version and test it again.
  10. I get it too, but in my case, it is because I have outgoing emails disabled and I receive this warning instead, and it is never sent: ------------------------------------ Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in \tools\swift\Swift\Plugin\MailSend.php on line 160 freeorder:FAUEFWWGN:mail@mail.com ------------------------------------ If you want to find out the cause of what is causing it, go to this file: www/themes/default/js/order-opc.js, find function confirmFreeOrder, around line 261, and within the: success: function(html) { add this: alert('success'); alert(html); If you read the code further, you will see it is splitting on ":", and so it is finding the warning, instead of the returned text "freeorder:FAUEFWWGN:mail@mail.com". After you update the js file just make sure you browser loads the updated version and test it again.
  11. Just released a coupon module that also tracks gift certificate balance: http://awodev.com/product/awocoupon-prestashop
×
×
  • Create New...