Version Notes
"Billing/Shipping" address on wholesale registration form
Allow .pdf files to upload in the registration page
Download this release
Release Info
Developer | developer |
Extension | Wholesale_Customer_Activation |
Version | 9.0.0 |
Comparing to | |
See all releases |
Code changes from version 8.0.0 to 9.0.0
- app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Widget/Grid/Column/Renderer/Boolean.php +8 -1
- app/code/community/Exinent/CustomerActivation/Block/Orderproduct.php +2 -1
- app/code/community/Exinent/CustomerActivation/Helper/Data.php +12 -1
- app/code/community/Exinent/CustomerActivation/Model/Resource/Attribute/Source/Customershippingmethods.php +1 -1
- app/code/community/Exinent/CustomerActivation/controllers/AccountController.php +322 -74
- app/code/community/Exinent/CustomerActivation/controllers/productOrderController.php +3 -0
- app/code/community/Exinent/CustomerActivation/etc/config.xml +23 -7
- app/code/community/Exinent/CustomerActivation/etc/system.xml +8 -20
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/install-0.1.0.php +0 -9
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.3-0.2.4.php → mysql4-upgrade-0.1.0-0.1.1.php} +0 -0
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.4-0.2.5.php → mysql4-upgrade-0.1.1-0.1.2.php} +0 -0
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.7-0.2.8.php → mysql4-upgrade-0.1.2-0.1.3.php} +0 -0
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.8-0.2.9.php → mysql4-upgrade-0.1.3-0.1.4.php} +1 -0
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.3.1-0.3.2.php → mysql4-upgrade-0.1.4-0.1.5.php} +0 -0
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.9-0.3.0.php +0 -10
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.0-0.3.1.php +0 -24
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.2-0.3.3.php +0 -14
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.3-0.3.4.php +0 -33
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.4-0.3.5.php +0 -28
- app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.5-0.3.6.php +0 -3
- app/design/adminhtml/default/default/template/customerActivation/fieldset.phtml +9 -3
- app/design/frontend/base/default/layout/customerActivation.xml +7 -3
- app/design/frontend/base/default/template/customerActivation/checkout/onepage/payment/methods.phtml +3 -3
- app/design/frontend/base/default/template/customerActivation/checkout/onepage/shipping_method/available.phtml +106 -93
- app/design/frontend/base/default/template/customerActivation/quickorderproduct.phtml +13 -3
- app/design/frontend/base/default/template/customerActivation/wholesaleRegister.phtml +131 -71
- package.xml +12 -10
app/code/community/Exinent/CustomerActivation/Block/Adminhtml/Widget/Grid/Column/Renderer/Boolean.php
CHANGED
@@ -9,9 +9,16 @@ class Exinent_CustomerActivation_Block_Adminhtml_Widget_Grid_Column_Renderer_Boo
|
|
9 |
switch ($data) {
|
10 |
case 1:
|
11 |
return $this->__('Approved');
|
|
|
|
|
|
|
|
|
12 |
case 3:
|
13 |
return $this->__('New');
|
14 |
-
|
|
|
|
|
|
|
15 |
}
|
16 |
}
|
17 |
|
9 |
switch ($data) {
|
10 |
case 1:
|
11 |
return $this->__('Approved');
|
12 |
+
case 2:
|
13 |
+
return $this->__('Pending');
|
14 |
+
case 0:
|
15 |
+
return $this->__('Rejected');
|
16 |
case 3:
|
17 |
return $this->__('New');
|
18 |
+
case 4:
|
19 |
+
return $this->__('In Active');
|
20 |
+
case 5:
|
21 |
+
return $this->__('On Hold');
|
22 |
}
|
23 |
}
|
24 |
|
app/code/community/Exinent/CustomerActivation/Block/Orderproduct.php
CHANGED
@@ -63,7 +63,7 @@ class Exinent_CustomerActivation_Block_Orderproduct extends Mage_Core_Block_Temp
|
|
63 |
$orderProduct[$i]['product_id'] = $product->getId();
|
64 |
$orderProduct[$i]['product_url'] = $product->getUrlKey();
|
65 |
$orderProduct[$i]['name'] = $product->getName();
|
66 |
-
$orderProduct[$i]['price'] = $product->
|
67 |
$orderProduct[$i]['sku'] = $product->getSku();
|
68 |
$orderProduct[$i]['image'] = $product->getImageUrl();
|
69 |
$i++;
|
@@ -73,6 +73,7 @@ class Exinent_CustomerActivation_Block_Orderproduct extends Mage_Core_Block_Temp
|
|
73 |
}
|
74 |
|
75 |
public function getOrderProduct() {
|
|
|
76 |
$orderProducts = array();
|
77 |
$categoryArray = array();
|
78 |
$data = array();
|
63 |
$orderProduct[$i]['product_id'] = $product->getId();
|
64 |
$orderProduct[$i]['product_url'] = $product->getUrlKey();
|
65 |
$orderProduct[$i]['name'] = $product->getName();
|
66 |
+
$orderProduct[$i]['price'] = $product->getFinalPrice();
|
67 |
$orderProduct[$i]['sku'] = $product->getSku();
|
68 |
$orderProduct[$i]['image'] = $product->getImageUrl();
|
69 |
$i++;
|
73 |
}
|
74 |
|
75 |
public function getOrderProduct() {
|
76 |
+
// Mage::log('getOrderProduct',null,'yams.log');
|
77 |
$orderProducts = array();
|
78 |
$categoryArray = array();
|
79 |
$data = array();
|
app/code/community/Exinent/CustomerActivation/Helper/Data.php
CHANGED
@@ -162,7 +162,18 @@ class Exinent_CustomerActivation_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
162 |
}
|
163 |
|
164 |
public function getCustomerGroupId() {
|
165 |
-
return Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS_GROUPS);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
}
|
167 |
|
168 |
}
|
162 |
}
|
163 |
|
164 |
public function getCustomerGroupId() {
|
165 |
+
return Mage::getStoreConfig(self::XML_PATH_DEFAULT_STATUS_GROUPS, Mage::app()->getStore());
|
166 |
+
}
|
167 |
+
public function sendCustomer1NotificationEmail(Mage_Customer_Model_Customer $customer)
|
168 |
+
{
|
169 |
+
if (Mage::getStoreConfig(self::XML_PATH_ALERT_CUSTOMER, $this->getCustomerStoreId($customer))) {
|
170 |
+
$to = array(array(
|
171 |
+
'name' => $customer->getName(),
|
172 |
+
'email' => $customer->getEmail(),
|
173 |
+
));
|
174 |
+
$this->_sendNotificationEmail($to, $customer, self::XML_PATH_EMAIL_CUSTOMER_NOTIFICATION_TEMPLATE1);
|
175 |
+
}
|
176 |
+
return $this;
|
177 |
}
|
178 |
|
179 |
}
|
app/code/community/Exinent/CustomerActivation/Model/Resource/Attribute/Source/Customershippingmethods.php
CHANGED
@@ -6,7 +6,7 @@ class Exinent_CustomerActivation_Model_Resource_Attribute_Source_Customershippin
|
|
6 |
if (is_null($this->_options)) {
|
7 |
$activeCarriers = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
8 |
foreach ($activeCarriers as $carrierCode => $carrierModel) {
|
9 |
-
$allCarriers[$carrierCode] = array('value' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title'), 'label' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title'));
|
10 |
}
|
11 |
return $allCarriers;
|
12 |
}
|
6 |
if (is_null($this->_options)) {
|
7 |
$activeCarriers = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
8 |
foreach ($activeCarriers as $carrierCode => $carrierModel) {
|
9 |
+
$allCarriers[$carrierCode] = array('value' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title', Mage::app()->getStore()), 'label' => Mage::getStoreConfig('carriers/' . $carrierCode . '/title', Mage::app()->getStore()));
|
10 |
}
|
11 |
return $allCarriers;
|
12 |
}
|
app/code/community/Exinent/CustomerActivation/controllers/AccountController.php
CHANGED
@@ -1,133 +1,337 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
include_once "Mage/Customer/controllers/AccountController.php";
|
4 |
|
5 |
class Exinent_CustomerActivation_AccountController extends Mage_Customer_AccountController {
|
6 |
-
|
7 |
public function createPostAction() {
|
8 |
-
|
9 |
/** @var $session Mage_Customer_Model_Session */
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
$session->setEscapeMessages(true); // prevent XSS injection in user input
|
17 |
-
if (!$this->getRequest()->isPost()) {
|
18 |
|
19 |
-
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
20 |
-
$this->_redirectError($errUrl);
|
21 |
-
return;
|
22 |
-
}
|
23 |
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if ($this->getRequest()->getPost('group_id')) {
|
30 |
$customer->setGroupId($this->getRequest()->getPost('group_id'));
|
31 |
} else {
|
32 |
$customer->getGroupId();
|
33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
$
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
45 |
|
46 |
-
|
47 |
-
$customer->setUpsNumber($this->getRequest()->getPost('upsnumber'));
|
48 |
-
$customer->setFedexNumber($this->getRequest()->getPost('fedexnumber'));
|
49 |
-
$customer->setAccountspayableEmail($this->getRequest()->getPost('accountpayble_email'));
|
50 |
-
$customer->setStoreType($this->getRequest()->getPost('storetype'));
|
51 |
-
$customer->setWebsiteUrl($this->getRequest()->getPost('website_url'));
|
52 |
-
$customer->setIswebsiteLive($this->getRequest()->getPost('iswebsitelive'));
|
53 |
-
$customer->setDateFounded($this->getRequest()->getPost('datefounded'));
|
54 |
-
$customer->setPaymentmethods($this->getRequest()->getPost('paymentterms'));
|
55 |
-
$brandsCarry = $this->getRequest()->getPost('brandsyoucarry');
|
56 |
$brands = implode(',', $brandsCarry);
|
57 |
$customer->setBrandsCarry($brands);
|
|
|
|
|
58 |
try {
|
59 |
-
|
60 |
$logoImage='';
|
61 |
$uploader = new Varien_File_Uploader('attachment');
|
62 |
$uploader->setFilesDispersion(true);
|
63 |
$uploader->setFilenamesCaseSensitivity(false);
|
64 |
-
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
|
65 |
$uploader->setAllowRenameFiles(true);
|
66 |
$path = Mage::getBaseDir('media') . DS . 'customerlogs' . DS;
|
67 |
$uploader->save($path, $_FILES['attachment']['name']);
|
68 |
$fileName = $uploader->getUploadedFileName();
|
69 |
$logoImage = 'customerlogs/' . $fileName;
|
70 |
-
|
71 |
-
|
72 |
-
} catch (Exception $e) {
|
73 |
-
echo $e->getMessage();
|
74 |
-
Mage::log($e->getMessage());
|
75 |
-
}
|
76 |
$customer->setLogoImage($logoImage);
|
77 |
-
|
78 |
-
$paymentreferenceImage='';
|
79 |
-
$paymentreference = new Varien_File_Uploader('net30reference');
|
80 |
-
$uploader->setAllowedExtensions(array('doc', 'pdf', 'txt', 'docx', 'jpg', 'jpeg', 'gif', 'png'));
|
81 |
-
$paymentreference->setAllowRenameFiles(true);
|
82 |
-
$paymentreferencepath = Mage::getBaseDir('media') . DS . 'net30Reference' . DS;
|
83 |
-
$imgpath = $paymentreference->save($paymentreferencepath, $_FILES['net30reference']['name']);
|
84 |
-
$paymentreferenceImage = 'net30Reference/' . $_FILES['net30reference']['name'];
|
85 |
} catch (Exception $e) {
|
86 |
echo $e->getMessage();
|
87 |
Mage::log($e->getMessage());
|
88 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
$customer->setNet30Reference($paymentreferenceImage);
|
90 |
-
|
91 |
-
$
|
92 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
return;
|
94 |
} else {
|
95 |
$this->_addSessionError($errors);
|
96 |
}
|
97 |
} catch (Mage_Core_Exception $e) {
|
98 |
-
$variable = $this->getRequest()->getPost('customer_activation');
|
99 |
$session->setCustomerFormData($this->getRequest()->getPost());
|
100 |
if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
|
101 |
$url = $this->_getUrl('customer/account/forgotpassword');
|
102 |
-
|
103 |
-
$message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
|
104 |
-
}
|
105 |
$session->setEscapeMessages(false);
|
106 |
} else {
|
107 |
$message = $e->getMessage();
|
108 |
}
|
109 |
-
|
110 |
-
$session->addError($message);
|
111 |
-
}
|
112 |
} catch (Exception $e) {
|
113 |
$session->setCustomerFormData($this->getRequest()->getPost())
|
114 |
->addException($e, $this->__('Cannot save the customer.'));
|
115 |
}
|
116 |
-
|
117 |
-
$errUrl = $this->_getUrl('customerActivation/index/wholesale', array('_secure' => true));
|
118 |
-
$emailError = 'emailerror';
|
119 |
-
Mage::getSingleton('core/session')->setEmailError($emailError);
|
120 |
-
} else {
|
121 |
-
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
122 |
-
}
|
123 |
-
|
124 |
$this->_redirectError($errUrl);
|
125 |
}
|
126 |
|
127 |
public function loginPostAction() {
|
128 |
-
|
129 |
$groupid = $this->getRequest()->getParam('groupname');
|
130 |
-
|
|
|
131 |
Mage::register('groupId', $groupid);
|
132 |
if (!$this->_validateFormKey()) {
|
133 |
$this->_redirect('*/*/');
|
@@ -142,7 +346,6 @@ class Exinent_CustomerActivation_AccountController extends Mage_Customer_Account
|
|
142 |
|
143 |
if ($this->getRequest()->isPost()) {
|
144 |
$login = $this->getRequest()->getPost('login');
|
145 |
-
|
146 |
if (!empty($login['username']) && !empty($login['password'])) {
|
147 |
try {
|
148 |
$session->login($login['username'], $login['password']);
|
@@ -170,10 +373,55 @@ class Exinent_CustomerActivation_AccountController extends Mage_Customer_Account
|
|
170 |
$session->addError($this->__('Login and password are required.'));
|
171 |
}
|
172 |
}
|
173 |
-
|
174 |
$this->_loginPostRedirect();
|
175 |
}
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
178 |
|
179 |
?>
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Fontis Recaptcha Extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Fontis
|
17 |
+
* @package Fontis_Recaptcha
|
18 |
+
* @author Denis Margetic
|
19 |
+
* @author Chris Norton
|
20 |
+
* @copyright Copyright (c) 2011 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
21 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
+
*/
|
23 |
include_once "Mage/Customer/controllers/AccountController.php";
|
24 |
|
25 |
class Exinent_CustomerActivation_AccountController extends Mage_Customer_AccountController {
|
26 |
+
const XML_PATH_ACTIVATION_STATUS = 'customer/customeractivation/activation_status_default';
|
27 |
public function createPostAction() {
|
|
|
28 |
/** @var $session Mage_Customer_Model_Session */
|
29 |
+
if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/customer", Mage::app()->getStore()) && !($this->getRequest()->getPost('group_id'))) { // check that recaptcha is actually enabled
|
30 |
+
$privatekey = Mage::getStoreConfig("fontis_recaptcha/setup/private_key", Mage::app()->getStore());
|
31 |
|
32 |
+
// check response
|
33 |
+
$resp = Mage::helper("fontis_recaptcha")->recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]
|
34 |
+
);
|
|
|
|
|
35 |
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
if ($resp == true) { // if recaptcha response is correct, use core functionality
|
38 |
+
$this->getgeneralCustomer();
|
39 |
+
parent::createPostAction();
|
40 |
+
} else {
|
41 |
|
42 |
+
$this->_getSession()->addError($this->__('Your reCAPTCHA entry is incorrect. Please try again.'));
|
43 |
+
$this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
|
44 |
+
$this->_redirectReferer();
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
} else { // if recaptcha is not enabled, use core function
|
48 |
+
$session = $this->_getSession();
|
49 |
+
if ($session->isLoggedIn()) {
|
50 |
+
$this->_redirect('*/*/');
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
$session->setEscapeMessages(true); // prevent XSS injection in user input
|
54 |
+
if (!$this->getRequest()->isPost()) {
|
55 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
56 |
+
$this->_redirectError($errUrl);
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
|
60 |
+
$customer = $this->_getCustomer();
|
61 |
+
$default_address = $this->getRequest()->getPost('default_shipping');
|
62 |
+
|
63 |
+
$shipping_address = $this->getRequest()->getPost('shipping');
|
64 |
+
//echo "<pre>";print_r($this->getRequest()->getPost());
|
65 |
+
//echo "<pre>";print_r($this->getRequest()->getPost('shipping'));die();
|
66 |
+
//Billing & shipping address both are same
|
67 |
+
if ($default_address != "on") {
|
68 |
+
$customer = Mage::getModel('customer/customer');
|
69 |
+
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
|
70 |
+
$customer->loadByEmail($this->getRequest()->getPost('email'));
|
71 |
+
$street = $this->getRequest()->getPost('street');
|
72 |
+
|
73 |
+
if (!$customer->getId()) {
|
74 |
+
$customer->setEmail($this->getRequest()->getPost('email'));
|
75 |
+
$customer->setFirstname($this->getRequest()->getPost('firstname'));
|
76 |
+
$customer->setLastname($this->getRequest()->getPost('lastname'));
|
77 |
+
$customer->setPassword($this->getRequest()->getPost('password'));
|
78 |
+
}
|
79 |
+
|
80 |
+
try {
|
81 |
+
$customer->save(); //// Akash saved customer
|
82 |
+
$customer->setConfirmation(null);
|
83 |
+
// $customer->save();
|
84 |
+
|
85 |
+
//Make a "login" of new customer
|
86 |
+
Mage::getSingleton('customer/session')->loginById($customer->getId());
|
87 |
+
} catch (Exception $ex) {
|
88 |
+
//Zend_Debug::dump($ex->getMessage());
|
89 |
+
}
|
90 |
+
|
91 |
+
//create customer address array & set billing and shipping as same
|
92 |
+
$_custom_address = array(
|
93 |
+
'firstname' => $this->getRequest()->getPost('firstname'),
|
94 |
+
'lastname' => $this->getRequest()->getPost('lastname'),
|
95 |
+
'street' => array(
|
96 |
+
'0' => $street[0],
|
97 |
+
'1' => $street[1],
|
98 |
+
),
|
99 |
+
'city' => $this->getRequest()->getPost('city'),
|
100 |
+
'region_id' => $this->getRequest()->getPost('region_id'),
|
101 |
+
'region' => $this->getRequest()->getPost('region'),
|
102 |
+
'postcode' => $this->getRequest()->getPost('postcode'),
|
103 |
+
'country_id' => $this->getRequest()->getPost('country_id'),
|
104 |
+
'telephone' => $this->getRequest()->getPost('telephone'),
|
105 |
+
);
|
106 |
+
|
107 |
+
$customAddress = Mage::getModel('customer/address');
|
108 |
+
$customAddress->setData($_custom_address)
|
109 |
+
->setCustomerId($customer->getId())
|
110 |
+
->setIsDefaultBilling('1')
|
111 |
+
->setIsDefaultShipping('1')
|
112 |
+
->setSaveInAddressBook('1');
|
113 |
|
114 |
+
try {
|
115 |
+
$customAddress->save();
|
116 |
+
} catch (Exception $ex) {
|
117 |
+
//Zend_Debug::dump($ex->getMessage());
|
118 |
+
}
|
119 |
+
} else { //Billing & shipping address both are not same
|
120 |
+
$customer = Mage::getModel('customer/customer');
|
121 |
+
|
122 |
+
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
|
123 |
+
$customer->loadByEmail($this->getRequest()->getPost('email'));
|
124 |
+
|
125 |
+
$street = $this->getRequest()->getPost('street');
|
126 |
+
if (!$customer->getId()) {
|
127 |
+
$customer->setEmail($this->getRequest()->getPost('email'));
|
128 |
+
$customer->setFirstname($this->getRequest()->getPost('firstname'));
|
129 |
+
$customer->setLastname($this->getRequest()->getPost('lastname'));
|
130 |
+
$customer->setPassword($this->getRequest()->getPost('password'));
|
131 |
+
}
|
132 |
+
|
133 |
+
try {
|
134 |
+
$customer->setConfirmation(null);
|
135 |
+
$customer->save();
|
136 |
+
//Make a "login" of new customer
|
137 |
+
Mage::getSingleton('customer/session')->loginById($customer->getId());
|
138 |
+
} catch (Exception $ex) {
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
//Billing address array and save customer address
|
143 |
+
$_custom_billing_address = array(
|
144 |
+
'firstname' => $this->getRequest()->getPost('firstname'),
|
145 |
+
'lastname' => $this->getRequest()->getPost('lastname'),
|
146 |
+
'street' => array(
|
147 |
+
'0' => $street[0],
|
148 |
+
'1' => $street[1],
|
149 |
+
),
|
150 |
+
'city' => $this->getRequest()->getPost('city'),
|
151 |
+
'region_id' => $this->getRequest()->getPost('region_id'),
|
152 |
+
'region' => $this->getRequest()->getPost('region'),
|
153 |
+
'postcode' => $this->getRequest()->getPost('postcode'),
|
154 |
+
'country_id' => $this->getRequest()->getPost('country_id'),
|
155 |
+
'telephone' => $this->getRequest()->getPost('telephone'),
|
156 |
+
);
|
157 |
+
|
158 |
+
$customAddress_billing = Mage::getModel('customer/address');
|
159 |
+
$customAddress_billing->setData($_custom_billing_address)
|
160 |
+
->setCustomerId($customer->getId())
|
161 |
+
->setIsDefaultBilling('1')
|
162 |
+
->setSaveInAddressBook('1');
|
163 |
+
|
164 |
+
try {
|
165 |
+
$customAddress_billing->save();
|
166 |
+
} catch (Exception $ex) {
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
//Shipping address array and save customer address
|
171 |
+
$_custom_shipping_address = array(
|
172 |
+
'firstname' => $this->getRequest()->getPost('firstname'),
|
173 |
+
'lastname' => $this->getRequest()->getPost('lastname'),
|
174 |
+
'street' => array(
|
175 |
+
'0' => $shipping_address['street'][0],
|
176 |
+
'1' => $shipping_address['street'][1],
|
177 |
+
),
|
178 |
+
'city' => $shipping_address['city'],
|
179 |
+
'region_id' => $shipping_address['region'],
|
180 |
+
'region' => $shipping_address['region'],
|
181 |
+
'postcode' => $shipping_address['postcode'],
|
182 |
+
'country_id' => $shipping_address['country_id'],
|
183 |
+
'telephone' => $shipping_address['telephone'],
|
184 |
+
);
|
185 |
+
|
186 |
+
$customAddress_shipping = Mage::getModel('customer/address');
|
187 |
+
$customAddress_shipping->setData($_custom_shipping_address)
|
188 |
+
->setCustomerId($customer->getId())
|
189 |
+
->setIsDefaultShipping('1')
|
190 |
+
->setSaveInAddressBook('1');
|
191 |
+
|
192 |
+
try {
|
193 |
+
$customAddress_shipping->save();
|
194 |
+
} catch (Exception $ex) {
|
195 |
+
$message = $ex->getMessage();
|
196 |
+
print_r($message);
|
197 |
+
}
|
198 |
+
//die();
|
199 |
+
}
|
200 |
+
|
201 |
+
//set extra parameters and save customer
|
202 |
+
|
203 |
+
//// Akash
|
204 |
if ($this->getRequest()->getPost('group_id')) {
|
205 |
$customer->setGroupId($this->getRequest()->getPost('group_id'));
|
206 |
} else {
|
207 |
$customer->getGroupId();
|
208 |
}
|
209 |
+
$storeId = Mage::helper('customeractivation')->getCustomerStoreId($customer);
|
210 |
+
$defaultStatus = Mage::helper('customeractivation')->getDefaultActivationStatus($this->getRequest()->getPost('group_id'), $storeId);
|
211 |
+
if (Mage::getStoreConfig(self::XML_PATH_ACTIVATION_STATUS, Mage::app()->getStore()) == 1) {
|
212 |
+
$customer->setCustomerActivated('1');
|
213 |
+
}else{
|
214 |
+
$customer->setCustomerActivated('New');
|
215 |
+
}
|
216 |
+
//// Akash
|
217 |
|
218 |
+
$customer->setUniqueloginId(Mage::helper('core')->getRandomString(9, '0123456789'));
|
219 |
+
$customer->setUpsNumber($this->getRequest()->getPost('upsnumber'));
|
220 |
+
$customer->setFedexNumber($this->getRequest()->getPost('fedexnumber'));
|
221 |
+
$customer->setAccountspayableEmail($this->getRequest()->getPost('accountpayble_email'));
|
222 |
+
$customer->setStoreType($this->getRequest()->getPost('storetype'));
|
223 |
+
$customer->setWebsiteUrl($this->getRequest()->getPost('website_url'));
|
224 |
+
$customer->setIswebsiteLive($this->getRequest()->getPost('iswebsitelive'));
|
225 |
+
$customer->setDateFounded($this->getRequest()->getPost('datefounded'));
|
226 |
+
$customer->setPaymentmethods($this->getRequest()->getPost('paymentterms'));
|
227 |
+
$customer->setRepresentativeEmail($this->getRequest()->getPost('representative_email'));
|
228 |
+
$brandsCarry = $this->getRequest()->getPost('brandsyoucarry');
|
229 |
|
230 |
+
if ($customer->getGroupId() == 2) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
$brands = implode(',', $brandsCarry);
|
232 |
$customer->setBrandsCarry($brands);
|
233 |
+
}
|
234 |
+
|
235 |
try {
|
|
|
236 |
$logoImage='';
|
237 |
$uploader = new Varien_File_Uploader('attachment');
|
238 |
$uploader->setFilesDispersion(true);
|
239 |
$uploader->setFilenamesCaseSensitivity(false);
|
240 |
+
$uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png', 'pdf'));
|
241 |
$uploader->setAllowRenameFiles(true);
|
242 |
$path = Mage::getBaseDir('media') . DS . 'customerlogs' . DS;
|
243 |
$uploader->save($path, $_FILES['attachment']['name']);
|
244 |
$fileName = $uploader->getUploadedFileName();
|
245 |
$logoImage = 'customerlogs/' . $fileName;
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
$customer->setLogoImage($logoImage);
|
247 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
} catch (Exception $e) {
|
249 |
echo $e->getMessage();
|
250 |
Mage::log($e->getMessage());
|
251 |
}
|
252 |
+
|
253 |
+
|
254 |
+
/*try {
|
255 |
+
$paymentreferenceImage = null;
|
256 |
+
$paymentreference = new Varien_File_Uploader('net30reference');
|
257 |
+
$uploader->setAllowedExtensions(array('doc', 'pdf', 'txt', 'docx', 'jpg', 'jpeg', 'gif', 'png'));
|
258 |
+
$paymentreference->setAllowRenameFiles(true);
|
259 |
+
$paymentreferencepath = Mage::getBaseDir('media') . DS . 'net30Reference' . DS;
|
260 |
+
$imgpath = $paymentreference->save($paymentreferencepath, $_FILES['net30reference']['name']);
|
261 |
+
$paymentreferenceImage = 'net30Reference/' . $_FILES['net30reference']['name'];
|
262 |
$customer->setNet30Reference($paymentreferenceImage);
|
263 |
+
} catch (Exception $e) {
|
264 |
+
echo $e->getMessage();
|
265 |
+
Mage::log($e->getMessage());
|
266 |
+
}*/
|
267 |
+
|
268 |
+
$customer->save();
|
269 |
+
|
270 |
+
$this->_dispatchRegisterSuccess($customer);
|
271 |
+
$this->_successProcessRegistration($customer);
|
272 |
+
//send email to customer
|
273 |
+
if ($customer->getGroupId() == 2) {
|
274 |
+
Mage::helper('customeractivation')->sendCustomer1NotificationEmail($customer);
|
275 |
+
}
|
276 |
+
|
277 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
278 |
+
$this->_redirectError($errUrl);
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
public function getgeneralCustomer() {
|
283 |
+
/** @var $session Mage_Customer_Model_Session */
|
284 |
+
$session = $this->_getSession();
|
285 |
+
if ($session->isLoggedIn()) {
|
286 |
+
$this->_redirect('*/*/');
|
287 |
+
return;
|
288 |
+
}
|
289 |
+
$session->setEscapeMessages(true); // prevent XSS injection in user input
|
290 |
+
if (!$this->getRequest()->isPost()) {
|
291 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
292 |
+
$this->_redirectError($errUrl);
|
293 |
+
return;
|
294 |
+
}
|
295 |
+
|
296 |
+
$customer = $this->_getCustomer();
|
297 |
+
|
298 |
+
try {
|
299 |
+
$errors = $this->_getCustomerErrors($customer);
|
300 |
+
|
301 |
+
if (empty($errors)) {
|
302 |
+
//$customer->save();
|
303 |
+
//$this->_dispatchRegisterSuccess($customer);
|
304 |
+
//$this->_successProcessRegistration($customer);
|
305 |
+
|
306 |
+
Mage::helper('customeractivation')->sendCustomerNotificationEmail($customer);
|
307 |
+
|
308 |
+
|
309 |
return;
|
310 |
} else {
|
311 |
$this->_addSessionError($errors);
|
312 |
}
|
313 |
} catch (Mage_Core_Exception $e) {
|
|
|
314 |
$session->setCustomerFormData($this->getRequest()->getPost());
|
315 |
if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
|
316 |
$url = $this->_getUrl('customer/account/forgotpassword');
|
317 |
+
$message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
|
|
|
|
|
318 |
$session->setEscapeMessages(false);
|
319 |
} else {
|
320 |
$message = $e->getMessage();
|
321 |
}
|
322 |
+
$session->addError($message);
|
|
|
|
|
323 |
} catch (Exception $e) {
|
324 |
$session->setCustomerFormData($this->getRequest()->getPost())
|
325 |
->addException($e, $this->__('Cannot save the customer.'));
|
326 |
}
|
327 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
$this->_redirectError($errUrl);
|
329 |
}
|
330 |
|
331 |
public function loginPostAction() {
|
|
|
332 |
$groupid = $this->getRequest()->getParam('groupname');
|
333 |
+
Mage::getSingleton('customer/session')->unsetMygroupId();
|
334 |
+
Mage::getSingleton('customer/session')->setMygroupId($groupid);
|
335 |
Mage::register('groupId', $groupid);
|
336 |
if (!$this->_validateFormKey()) {
|
337 |
$this->_redirect('*/*/');
|
346 |
|
347 |
if ($this->getRequest()->isPost()) {
|
348 |
$login = $this->getRequest()->getPost('login');
|
|
|
349 |
if (!empty($login['username']) && !empty($login['password'])) {
|
350 |
try {
|
351 |
$session->login($login['username'], $login['password']);
|
373 |
$session->addError($this->__('Login and password are required.'));
|
374 |
}
|
375 |
}
|
|
|
376 |
$this->_loginPostRedirect();
|
377 |
}
|
378 |
|
379 |
+
protected function _loginPostRedirect() {
|
380 |
+
$mygroupId = Mage::getSingleton('customer/session')->getMygroupId();
|
381 |
+
$session = $this->_getSession();
|
382 |
+
if ($mygroupId != 2 || $session->getId() != null) {
|
383 |
+
Mage::getModel('core/session')->setMessages(Mage::getModel('core/message_collection'));
|
384 |
+
return parent::_loginPostRedirect();
|
385 |
+
} elseif ($mygroupId == 2 && $session->getId() == null) {
|
386 |
+
Mage::getModel('core/session')->addError('AccountId or Password is Invalid');
|
387 |
+
$this->_redirect('customerActivation/index/wholesalelogin/');
|
388 |
+
}
|
389 |
+
if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
|
390 |
+
// Set default URL to redirect customer to
|
391 |
+
$session->setBeforeAuthUrl($this->_getHelper('customer')->getAccountUrl());
|
392 |
+
// Redirect customer to the last page visited after logging in
|
393 |
+
if ($session->isLoggedIn()) {
|
394 |
+
if (!Mage::getStoreConfigFlag(
|
395 |
+
Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
|
396 |
+
)) {
|
397 |
+
$referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
|
398 |
+
if ($referer) {
|
399 |
+
// Rebuild referer URL to handle the case when SID was changed
|
400 |
+
$referer = $this->_getModel('core/url')
|
401 |
+
->getRebuiltUrl($this->_getHelper('core')->urlDecode($referer));
|
402 |
+
if ($this->_isUrlInternal($referer)) {
|
403 |
+
$session->setBeforeAuthUrl($referer);
|
404 |
+
}
|
405 |
+
}
|
406 |
+
} else if ($session->getAfterAuthUrl()) {
|
407 |
+
$session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
|
408 |
+
}
|
409 |
+
} else {
|
410 |
+
$session->setBeforeAuthUrl($this->_getHelper('customer')->getLoginUrl());
|
411 |
+
}
|
412 |
+
} else if ($session->getBeforeAuthUrl() == $this->_getHelper('customer')->getLogoutUrl()) {
|
413 |
+
|
414 |
+
$session->setBeforeAuthUrl($this->_getHelper('customer')->getDashboardUrl());
|
415 |
+
} else {
|
416 |
+
if (!$session->getAfterAuthUrl()) {
|
417 |
+
$session->setAfterAuthUrl($session->getBeforeAuthUrl());
|
418 |
+
}
|
419 |
+
if ($session->isLoggedIn()) {
|
420 |
+
$session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
|
421 |
+
}
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
}
|
426 |
|
427 |
?>
|
app/code/community/Exinent/CustomerActivation/controllers/productOrderController.php
CHANGED
@@ -34,14 +34,17 @@ class Exinent_CustomerActivation_productOrderController extends Mage_Core_Contro
|
|
34 |
}
|
35 |
|
36 |
public function quickorderproductAction() {
|
|
|
37 |
$this->loadLayout();
|
38 |
$this->renderLayout();
|
39 |
}
|
40 |
|
41 |
public function submitorderbySimpleproductAction() {
|
|
|
42 |
$minQty = Mage::getStoreConfig('customer/customeractivation/min_qty', Mage::app()->getStore());
|
43 |
|
44 |
$params = $this->getRequest()->getParams();
|
|
|
45 |
$cart = Mage::getModel('checkout/cart');
|
46 |
foreach ($params as $sku => $qty) {
|
47 |
|
34 |
}
|
35 |
|
36 |
public function quickorderproductAction() {
|
37 |
+
Mage::log('quickorderproductAction',null,'yams.log');
|
38 |
$this->loadLayout();
|
39 |
$this->renderLayout();
|
40 |
}
|
41 |
|
42 |
public function submitorderbySimpleproductAction() {
|
43 |
+
//Mage::log('tsfdsf',null,'yams.log');
|
44 |
$minQty = Mage::getStoreConfig('customer/customeractivation/min_qty', Mage::app()->getStore());
|
45 |
|
46 |
$params = $this->getRequest()->getParams();
|
47 |
+
|
48 |
$cart = Mage::getModel('checkout/cart');
|
49 |
foreach ($params as $sku => $qty) {
|
50 |
|
app/code/community/Exinent/CustomerActivation/etc/config.xml
CHANGED
@@ -2,11 +2,10 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Exinent_CustomerActivation>
|
5 |
-
<version>0.
|
6 |
</Exinent_CustomerActivation>
|
7 |
</modules>
|
8 |
<global>
|
9 |
-
|
10 |
<rewrite>
|
11 |
<customeractivation>
|
12 |
<from><![CDATA[#^/customer/account/createpost/#]]></from>
|
@@ -46,12 +45,16 @@
|
|
46 |
<html_topmenu>Exinent_CustomerActivation_Block_Page_Html_Topmenu</html_topmenu>
|
47 |
</rewrite>
|
48 |
</page>
|
49 |
-
|
|
|
50 |
<adminhtml>
|
51 |
<rewrite>
|
52 |
<widget_form_renderer_fieldset>Exinent_CustomerActivation_Block_Adminhtml_Rewrite_Fieldset</widget_form_renderer_fieldset>
|
53 |
</rewrite>
|
54 |
-
</adminhtml>
|
|
|
|
|
|
|
55 |
</blocks>
|
56 |
<resources>
|
57 |
<customeractivation_setup>
|
@@ -61,7 +64,20 @@
|
|
61 |
</setup>
|
62 |
</customeractivation_setup>
|
63 |
</resources>
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
<events>
|
66 |
|
67 |
|
@@ -154,7 +170,7 @@
|
|
154 |
</customeractivation>
|
155 |
</observers>
|
156 |
</customer_login>
|
157 |
-
|
158 |
<observers>
|
159 |
<customeractivation>
|
160 |
<type>singleton</type>
|
@@ -162,7 +178,7 @@
|
|
162 |
<method>salesCovertQuoteAddressToOrder</method>
|
163 |
</customeractivation>
|
164 |
</observers>
|
165 |
-
</sales_convert_quote_address_to_order>
|
166 |
</events>
|
167 |
<translate>
|
168 |
<modules>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Exinent_CustomerActivation>
|
5 |
+
<version>0.1.5</version>
|
6 |
</Exinent_CustomerActivation>
|
7 |
</modules>
|
8 |
<global>
|
|
|
9 |
<rewrite>
|
10 |
<customeractivation>
|
11 |
<from><![CDATA[#^/customer/account/createpost/#]]></from>
|
45 |
<html_topmenu>Exinent_CustomerActivation_Block_Page_Html_Topmenu</html_topmenu>
|
46 |
</rewrite>
|
47 |
</page>
|
48 |
+
|
49 |
+
|
50 |
<adminhtml>
|
51 |
<rewrite>
|
52 |
<widget_form_renderer_fieldset>Exinent_CustomerActivation_Block_Adminhtml_Rewrite_Fieldset</widget_form_renderer_fieldset>
|
53 |
</rewrite>
|
54 |
+
</adminhtml>
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
</blocks>
|
59 |
<resources>
|
60 |
<customeractivation_setup>
|
64 |
</setup>
|
65 |
</customeractivation_setup>
|
66 |
</resources>
|
67 |
+
<template>
|
68 |
+
<email>
|
69 |
+
<customer_customeractivation_registration_admin_template translate="label" module="customeractivation">
|
70 |
+
<label>Customer Registration Admin Notification</label>
|
71 |
+
<file>Exinent/customeractivation/customer_registration_admin.html</file>
|
72 |
+
<type>html</type>
|
73 |
+
</customer_customeractivation_registration_admin_template>
|
74 |
+
<customer_customeractivation_activation_template translate="label" module="customeractivation">
|
75 |
+
<label>Customer Activation Notification</label>
|
76 |
+
<file>Exinent/customeractivation/customer_activation.html</file>
|
77 |
+
<type>html</type>
|
78 |
+
</customer_customeractivation_activation_template>
|
79 |
+
</email>
|
80 |
+
</template>
|
81 |
<events>
|
82 |
|
83 |
|
170 |
</customeractivation>
|
171 |
</observers>
|
172 |
</customer_login>
|
173 |
+
<sales_convert_quote_address_to_order>
|
174 |
<observers>
|
175 |
<customeractivation>
|
176 |
<type>singleton</type>
|
178 |
<method>salesCovertQuoteAddressToOrder</method>
|
179 |
</customeractivation>
|
180 |
</observers>
|
181 |
+
</sales_convert_quote_address_to_order>
|
182 |
</events>
|
183 |
<translate>
|
184 |
<modules>
|
app/code/community/Exinent/CustomerActivation/etc/system.xml
CHANGED
@@ -94,28 +94,16 @@
|
|
94 |
<show_in_store>1</show_in_store>
|
95 |
</require_aunthenticate_products>
|
96 |
|
97 |
-
|
98 |
-
<label>
|
99 |
-
|
100 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
101 |
-
<sort_order>18</sort_order>
|
102 |
<show_in_default>1</show_in_default>
|
103 |
<show_in_website>1</show_in_website>
|
104 |
<show_in_store>1</show_in_store>
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
<frontend_type>multiselect</frontend_type>
|
110 |
-
<source_model>customeractivation/adminhtml_system_config_source_products_price_multiselect</source_model>
|
111 |
-
<sort_order>19</sort_order>
|
112 |
-
<show_in_default>1</show_in_default>
|
113 |
-
<show_in_website>1</show_in_website>
|
114 |
-
<show_in_store>1</show_in_store>
|
115 |
-
<depends>
|
116 |
-
<price_field>1</price_field>
|
117 |
-
</depends>
|
118 |
-
</price_hide_products>-->
|
119 |
|
120 |
<activation_status_default translate="label" module="customeractivation">
|
121 |
<label>Activate Wholesaler Accounts by Default</label>
|
@@ -139,7 +127,7 @@
|
|
139 |
</depends>
|
140 |
</date_start>
|
141 |
|
142 |
-
|
143 |
<label>End Date</label>
|
144 |
<frontend_type>text</frontend_type>
|
145 |
<frontend_model>customeractivation/adminhtml_system_config_date</frontend_model>
|
94 |
<show_in_store>1</show_in_store>
|
95 |
</require_aunthenticate_products>
|
96 |
|
97 |
+
<activation_template1 translate="label" module="customeractivation">
|
98 |
+
<label>Customer Notification Email Template(WholeSale)</label>
|
99 |
+
|
|
|
|
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
102 |
<show_in_store>1</show_in_store>
|
103 |
+
<sort_order>17</sort_order>
|
104 |
+
<frontend_type>select</frontend_type>
|
105 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
106 |
+
</activation_template1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
<activation_status_default translate="label" module="customeractivation">
|
109 |
<label>Activate Wholesaler Accounts by Default</label>
|
127 |
</depends>
|
128 |
</date_start>
|
129 |
|
130 |
+
<date_end>
|
131 |
<label>End Date</label>
|
132 |
<frontend_type>text</frontend_type>
|
133 |
<frontend_model>customeractivation/adminhtml_system_config_date</frontend_model>
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/install-0.1.0.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->run("
|
6 |
-
ALTER TABLE `{$installer->getTable('sales/quote_payment')}` ADD `cancel_date` VARCHAR( 255 ) NOT NULL ;
|
7 |
-
ALTER TABLE `{$installer->getTable('sales/order_payment')}` ADD `cancel_date` VARCHAR( 255 ) NOT NULL ;
|
8 |
-
");
|
9 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.3-0.2.4.php → mysql4-upgrade-0.1.0-0.1.1.php}
RENAMED
File without changes
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.4-0.2.5.php → mysql4-upgrade-0.1.1-0.1.2.php}
RENAMED
File without changes
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.7-0.2.8.php → mysql4-upgrade-0.1.2-0.1.3.php}
RENAMED
File without changes
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.2.8-0.2.9.php → mysql4-upgrade-0.1.3-0.1.4.php}
RENAMED
@@ -10,6 +10,7 @@ $installer->addAttribute("customer", "paymentmethods", array(
|
|
10 |
"label" => "Payment Methods",
|
11 |
"input" => "multiselect",
|
12 |
"source" => "customeractivation/resource_attribute_source_Customerpayment",
|
|
|
13 |
"user_defined" => "1",
|
14 |
"visible" => true,
|
15 |
"required" => false,
|
10 |
"label" => "Payment Methods",
|
11 |
"input" => "multiselect",
|
12 |
"source" => "customeractivation/resource_attribute_source_Customerpayment",
|
13 |
+
"backend" => "",
|
14 |
"user_defined" => "1",
|
15 |
"visible" => true,
|
16 |
"required" => false,
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/{mysql4-upgrade-0.3.1-0.3.2.php → mysql4-upgrade-0.1.4-0.1.5.php}
RENAMED
File without changes
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.2.9-0.3.0.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*$installer = new Mage_Sales_Model_Resource_Setup('core_setup');
|
3 |
-
$installer ->addAttribute('order', 'rep_name', array(
|
4 |
-
'label' => 'Rep Name',
|
5 |
-
'type' => 'text',
|
6 |
-
'input' => 'text',
|
7 |
-
'visible' => true,
|
8 |
-
'required' => false,
|
9 |
-
));
|
10 |
-
$installer->endSetup();*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.0-0.3.1.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*$installer = $this;
|
3 |
-
$installer->startSetup();
|
4 |
-
Mage::register('isSecureArea', 1);
|
5 |
-
|
6 |
-
// Force the store to be admin
|
7 |
-
Mage::app()->setUpdateMode(false);
|
8 |
-
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
9 |
-
|
10 |
-
$category = Mage::getModel('catalog/category');
|
11 |
-
$category->setPath('1/2') // set parent to be root category
|
12 |
-
->setStoreId(Mage_Core_Model_App::ADMIN_STORE_ID)
|
13 |
-
->setName('Wholesale')
|
14 |
-
->setUrlKey('wholesale')
|
15 |
-
->setDescription('Description')
|
16 |
-
->setIsActive(1)
|
17 |
-
->setIsAnchor(1)
|
18 |
-
->setIncludeInMenu(1)
|
19 |
-
->setInfinitescroll(1)
|
20 |
-
->setDisplayMode('PRODUCTS')
|
21 |
-
->save();
|
22 |
-
$installer->endSetup();*/
|
23 |
-
|
24 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.2-0.3.3.php
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*$installer = $this;
|
3 |
-
$installer->startSetup();
|
4 |
-
$installer->getConnection()->addColumn(
|
5 |
-
$this->getTable('sales/order_grid'),
|
6 |
-
'rep_name',
|
7 |
-
"varchar(255) DEFAULT NULL"
|
8 |
-
);
|
9 |
-
|
10 |
-
$installer->getConnection()->addKey(
|
11 |
-
$this->getTable('sales/order_grid'),
|
12 |
-
'rep_name',
|
13 |
-
'rep_name');
|
14 |
-
$installer->endSetup();*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.3-0.3.4.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$installer = $this;
|
4 |
-
$installer->startSetup();
|
5 |
-
|
6 |
-
$installer->addAttribute("customer", "shippingmethods", array(
|
7 |
-
"type" => "varchar",
|
8 |
-
"backend" => "",
|
9 |
-
"label" => "Shipping Methods",
|
10 |
-
"input" => "multiselect",
|
11 |
-
"source" => "customeractivation/resource_attribute_source_Customershippingmethods",
|
12 |
-
"user_defined" => "1",
|
13 |
-
"visible" => true,
|
14 |
-
"required" => false,
|
15 |
-
"default" => "",
|
16 |
-
"frontend" => "",
|
17 |
-
"unique" => false,
|
18 |
-
"note" => ""
|
19 |
-
));
|
20 |
-
|
21 |
-
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "shippingmethods");
|
22 |
-
|
23 |
-
$used_in_forms = array();
|
24 |
-
$used_in_forms[] = "adminhtml_customer";
|
25 |
-
$attribute->setData("used_in_forms", $used_in_forms)
|
26 |
-
->setData("is_used_for_customer_segment", true)
|
27 |
-
->setData("is_system", 0)
|
28 |
-
->setData("is_user_defined", 1)
|
29 |
-
->setData("is_visible", 1)
|
30 |
-
->setData("sort_order", 100);
|
31 |
-
|
32 |
-
$attribute->save();
|
33 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.4-0.3.5.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @category BusinessKing
|
4 |
-
* @package BusinessKing_OutofStockSubscription
|
5 |
-
*/
|
6 |
-
|
7 |
-
$installer = $this;
|
8 |
-
/* @var $installer Mage_Core_Model_Resource_Setup */
|
9 |
-
|
10 |
-
$installer->startSetup();
|
11 |
-
|
12 |
-
$installer->run("
|
13 |
-
|
14 |
-
-- DROP TABLE IF EXISTS `{$this->getTable('outofstocksubscription_info')}`;
|
15 |
-
CREATE TABLE `{$this->getTable('outofstocksubscription_info')}` (
|
16 |
-
`id` INTEGER unsigned NOT NULL auto_increment,
|
17 |
-
`product_id` INTEGER unsigned NOT NULL,
|
18 |
-
`email` TEXT NOT NULL default '',
|
19 |
-
`is_active` ENUM('0','1') NOT NULL DEFAULT '0',
|
20 |
-
`date` DATETIME default '0000-00-00 00:00:00',
|
21 |
-
PRIMARY KEY (`id`),
|
22 |
-
KEY `FK_OUTOFSTOCKSUBSCRIPTION_PRODUCT_ID` (`product_id`),
|
23 |
-
CONSTRAINT `FK_OUTOFSTOCKSUBSCRIPTION_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `{$this->getTable('catalog_product_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
24 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
25 |
-
|
26 |
-
");
|
27 |
-
|
28 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Exinent/CustomerActivation/sql/customeractivation_setup/mysql4-upgrade-0.3.5-0.3.6.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
3 |
-
$setup->updateAttribute('customer', 'customer_activated', 'used_in_forms', 'adminhtml_customer');
|
|
|
|
|
|
app/design/adminhtml/default/default/template/customerActivation/fieldset.phtml
CHANGED
@@ -43,11 +43,17 @@
|
|
43 |
$model = Mage::getModel('customer/customer')->load($customerId);
|
44 |
$logoImage = $model->getData('logo_image');
|
45 |
if($logoImage!=''){
|
46 |
-
|
47 |
?>
|
48 |
-
<span><b>Logo
|
|
|
49 |
<a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>">View Full Image</a>
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
51 |
</div>
|
52 |
<div> </div>
|
53 |
<?php endif;?>
|
43 |
$model = Mage::getModel('customer/customer')->load($customerId);
|
44 |
$logoImage = $model->getData('logo_image');
|
45 |
if($logoImage!=''){
|
46 |
+
$userfile_extn = substr($logoImage, strrpos($logoImage, '.')+1);
|
47 |
?>
|
48 |
+
<span><b>Store Logo/PDF:</b> </span>
|
49 |
+
<?php if($userfile_extn!='pdf'){ ?><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>" title="yamini" height="150"/>
|
50 |
<a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>">View Full Image</a>
|
51 |
+
|
52 |
+
<?php }else{ ?>
|
53 |
+
|
54 |
+
<a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);echo $logoImage;?>">View PDF File</a>
|
55 |
+
|
56 |
+
<?php }} ?>
|
57 |
</div>
|
58 |
<div> </div>
|
59 |
<?php endif;?>
|
app/design/frontend/base/default/layout/customerActivation.xml
CHANGED
@@ -1,13 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
<customer_account_login>
|
|
|
|
|
|
|
|
|
|
|
4 |
<reference name="customer_form_login">
|
5 |
<action method="setTemplate">
|
6 |
<template>customerActivation/customerActivation.phtml</template>
|
7 |
</action>
|
8 |
</reference>
|
9 |
</customer_account_login>
|
10 |
-
|
11 |
<reference name="catalog.topnav">
|
12 |
<action method="addLink" translate="label">
|
13 |
<label>Quick Order</label>
|
@@ -15,7 +20,7 @@
|
|
15 |
<path>customeractivation/productorder/quickorderproduct/</path>
|
16 |
</action>
|
17 |
</reference>
|
18 |
-
</default>
|
19 |
|
20 |
<customer_logged_out>
|
21 |
<reference name="top.links">
|
@@ -67,5 +72,4 @@
|
|
67 |
<block type="customeractivation/orderproduct" name="ordermgt" template="customerActivation/quickorderproduct.phtml"/>
|
68 |
</reference>
|
69 |
</customeractivation_productorder_quickorderproduct>
|
70 |
-
|
71 |
</layout>
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
<customer_account_login>
|
4 |
+
<reference name="root">
|
5 |
+
<action method="setTemplate">
|
6 |
+
<template>page/1column.phtml</template>
|
7 |
+
</action>
|
8 |
+
</reference>
|
9 |
<reference name="customer_form_login">
|
10 |
<action method="setTemplate">
|
11 |
<template>customerActivation/customerActivation.phtml</template>
|
12 |
</action>
|
13 |
</reference>
|
14 |
</customer_account_login>
|
15 |
+
<default>
|
16 |
<reference name="catalog.topnav">
|
17 |
<action method="addLink" translate="label">
|
18 |
<label>Quick Order</label>
|
20 |
<path>customeractivation/productorder/quickorderproduct/</path>
|
21 |
</action>
|
22 |
</reference>
|
23 |
+
</default>
|
24 |
|
25 |
<customer_logged_out>
|
26 |
<reference name="top.links">
|
72 |
<block type="customeractivation/orderproduct" name="ordermgt" template="customerActivation/quickorderproduct.phtml"/>
|
73 |
</reference>
|
74 |
</customeractivation_productorder_quickorderproduct>
|
|
|
75 |
</layout>
|
app/design/frontend/base/default/template/customerActivation/checkout/onepage/payment/methods.phtml
CHANGED
@@ -54,10 +54,10 @@
|
|
54 |
foreach ($methods as $_method):
|
55 |
$_code='';
|
56 |
$_code = $_method->getCode($_code);
|
57 |
-
|
58 |
-
if($customerGroupId != 2 && ($_code == 'net30' || $_code == 'net15' || $_code=='purchaseorder')):
|
59 |
continue;
|
60 |
-
elseif(($_code == 'net30' || $_code == 'net15' ) && !in_array($_code,$paymentMethods)):
|
61 |
continue;
|
62 |
endif;
|
63 |
?>
|
54 |
foreach ($methods as $_method):
|
55 |
$_code='';
|
56 |
$_code = $_method->getCode($_code);
|
57 |
+
|
58 |
+
if($customerGroupId != 2 && ($_code == 'net30' || $_code == 'net15' || $_code == 'net60' || $_code=='purchaseorder')):
|
59 |
continue;
|
60 |
+
elseif(($_code == 'net30' || $_code == 'net15' || $_code == 'net60') && !in_array($_code,$paymentMethods)):
|
61 |
continue;
|
62 |
endif;
|
63 |
?>
|
app/design/frontend/base/default/template/customerActivation/checkout/onepage/shipping_method/available.phtml
CHANGED
@@ -1,113 +1,126 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<?php /** @var $this Mage_Checkout_Block_Onepage_Shipping_Method_Available */ ?>
|
3 |
<?php $_shippingRateGroups = $this->getShippingRates(); ?>
|
4 |
<?php
|
5 |
$flag = 0;
|
6 |
-
|
7 |
$customerObj = Mage::getModel('customer/customer')->load($customer->getId());
|
8 |
-
|
9 |
-
$customerShippingmethods = $customerObj->getShippingmethods();
|
10 |
-
$shippingMethods = explode(',', $customerShippingmethods);
|
11 |
-
$customerGroupIdconfig = Mage::helper('customeractivation')->getCustomerGroupId();
|
12 |
-
$cofigGroupsIds = explode(',', $customerGroupIdconfig);*/
|
13 |
?>
|
14 |
<?php if (!$_shippingRateGroups): ?>
|
15 |
<p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
|
16 |
<?php else: ?>
|
17 |
<dl class="sp-methods">
|
18 |
<?php $shippingCodePrice = array(); ?>
|
19 |
-
<?php
|
20 |
-
$_sole = count($_shippingRateGroups) == 1;
|
21 |
foreach ($_shippingRateGroups as $code => $_rates):
|
22 |
-
if
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
?>
|
26 |
-
|
27 |
-
<
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
?>
|
|
|
|
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
<?php endif; ?>
|
52 |
-
<?php endif; ?>
|
53 |
-
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
|
54 |
-
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
55 |
-
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
56 |
-
<?php echo $_excl; ?>
|
57 |
-
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
58 |
-
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
59 |
-
<?php endif; ?>
|
60 |
-
</label>
|
61 |
-
<?php endif ?>
|
62 |
-
</li>
|
63 |
|
64 |
-
<?php endforeach; ?>
|
65 |
-
</ul>
|
66 |
-
</dd>
|
67 |
-
<?php
|
68 |
-
} endforeach;
|
69 |
-
}else {
|
70 |
-
?>
|
71 |
-
<dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
|
72 |
-
<dd>
|
73 |
-
<ul>
|
74 |
-
<?php
|
75 |
-
$_sole = $_sole && count($_rates) == 1;
|
76 |
-
foreach ($_rates as $_rate):
|
77 |
-
?>
|
78 |
-
<?php $shippingCodePrice[] = "'" . $_rate->getCode() . "':" . (float) $_rate->getPrice(); ?>
|
79 |
-
<li>
|
80 |
-
<?php if ($_rate->getErrorMessage()): ?>
|
81 |
-
<ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
|
82 |
-
<?php else: ?>
|
83 |
-
<?php if ($_sole) : ?>
|
84 |
-
<span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
|
85 |
-
<?php else: ?>
|
86 |
-
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
//<![CDATA[
|
91 |
-
lastPrice = <?php echo (float) $_rate->getPrice(); ?>;
|
92 |
-
//]]>
|
93 |
-
</script>
|
94 |
-
<?php endif; ?>
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
</dl>
|
112 |
<script type="text/javascript">
|
113 |
//<![CDATA[
|
@@ -115,8 +128,8 @@ $cofigGroupsIds = explode(',', $customerGroupIdconfig);*/
|
|
115 |
var shippingCodePrice = {<?php echo implode(',', $shippingCodePrice); ?>};
|
116 |
<?php endif; ?>
|
117 |
|
118 |
-
$$('input[type="radio"][name="shipping_method"]').each(function(el) {
|
119 |
-
Event.observe(el, 'click', function() {
|
120 |
if (el.checked == true) {
|
121 |
var getShippingCode = el.getValue();
|
122 |
<?php if (!empty($shippingCodePrice)): ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
<?php /** @var $this Mage_Checkout_Block_Onepage_Shipping_Method_Available */ ?>
|
28 |
<?php $_shippingRateGroups = $this->getShippingRates(); ?>
|
29 |
<?php
|
30 |
$flag = 0;
|
31 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
32 |
$customerObj = Mage::getModel('customer/customer')->load($customer->getId());
|
33 |
+
|
|
|
|
|
|
|
|
|
34 |
?>
|
35 |
<?php if (!$_shippingRateGroups): ?>
|
36 |
<p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
|
37 |
<?php else: ?>
|
38 |
<dl class="sp-methods">
|
39 |
<?php $shippingCodePrice = array(); ?>
|
40 |
+
<?php $_sole = count($_shippingRateGroups) == 1;
|
|
|
41 |
foreach ($_shippingRateGroups as $code => $_rates):
|
42 |
+
if($customerObj->getUpsNumber() == "") {
|
43 |
+
if($code == 'thirdpartyups' ){continue;} }
|
44 |
+
if($customerObj->getFedexNumber() == ""){
|
45 |
+
if($code == 'thirdpartyfedex'){continue;}
|
46 |
+
}
|
47 |
+
if($customerObj->getGroupId() == 2 && ($code == 'freeshipping' || $code == 'usps' || $code == 'flatrate')) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
?>
|
51 |
+
<dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
|
52 |
+
<dd>
|
53 |
+
<ul>
|
54 |
+
<?php $_sole = $_sole && count($_rates) == 1;
|
55 |
+
foreach ($_rates as $_rate):
|
56 |
?>
|
57 |
+
<?php $shippingCodePrice[] = "'" . $_rate->getCode() . "':" . (float) $_rate->getPrice(); ?>
|
58 |
+
<li>
|
59 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
60 |
+
<ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
|
61 |
+
<?php else: ?>
|
62 |
+
<?php if ($_sole) : ?>
|
63 |
+
<span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
|
64 |
+
<?php else: ?>
|
65 |
+
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if ($_rate->getCode() === $this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
|
66 |
|
67 |
+
<?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
|
68 |
+
<script type="text/javascript">
|
69 |
+
//<![CDATA[
|
70 |
+
lastPrice = <?php echo (float) $_rate->getPrice(); ?>;
|
71 |
+
//]]>
|
72 |
+
</script>
|
73 |
+
<?php endif; ?>
|
74 |
|
75 |
+
<?php endif; ?>
|
76 |
+
<?php
|
77 |
+
if ($_rate->getCode() == 'thirdpartyfedex_standand') {
|
78 |
+
$shippingAccNo = " Acct # " . $customerObj->getFedexNumber();
|
79 |
+
$flag = 1;
|
80 |
+
}
|
81 |
+
?>
|
|
|
82 |
|
83 |
+
<?php
|
84 |
+
if ($_rate->getCode() == 'thirdpartyups_standand') {
|
85 |
+
$shippingAccNo = " Acct # " . $customerObj->getUpsNumber();
|
86 |
+
$flag = 1;
|
87 |
+
}
|
88 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
92 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
+
<label for="s_method_<?php echo $_rate->getCode() ?>">
|
95 |
+
<?php echo $this->escapeHtml($this->getCarrierName($code)); ?><?php
|
96 |
+
if ($_excl == '<span class="price">$0.00</span>') {
|
97 |
+
|
98 |
+
} else {
|
99 |
+
echo $this->escapeHtml($_rate->getMethodTitle());
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
|
103 |
+
<?php
|
104 |
+
if ($_excl == '<span class="price">$0.00</span>') {
|
105 |
+
|
106 |
+
} else {
|
107 |
+
echo $_excl;
|
108 |
+
}
|
109 |
+
if ($flag == 1) {
|
110 |
+
echo $shippingAccNo;
|
111 |
+
$flag = 0;
|
112 |
+
}
|
113 |
+
?>
|
114 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
115 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
116 |
+
<?php endif; ?>
|
117 |
+
</label>
|
118 |
+
<?php endif ?>
|
119 |
+
</li>
|
120 |
+
<?php endforeach; ?>
|
121 |
+
</ul>
|
122 |
+
</dd>
|
123 |
+
<?php endforeach; ?>
|
124 |
</dl>
|
125 |
<script type="text/javascript">
|
126 |
//<![CDATA[
|
128 |
var shippingCodePrice = {<?php echo implode(',', $shippingCodePrice); ?>};
|
129 |
<?php endif; ?>
|
130 |
|
131 |
+
$$('input[type="radio"][name="shipping_method"]').each(function (el) {
|
132 |
+
Event.observe(el, 'click', function () {
|
133 |
if (el.checked == true) {
|
134 |
var getShippingCode = el.getValue();
|
135 |
<?php if (!empty($shippingCodePrice)): ?>
|
app/design/frontend/base/default/template/customerActivation/quickorderproduct.phtml
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
|
|
2 |
$orderSimpleProductsCollection = $this->getOrderSimpleProducts();
|
|
|
3 |
$baseUrl = Mage::getBaseUrl();
|
4 |
$minQty = Mage::getStoreConfig('customer/customeractivation/min_qty', Mage::app()->getStore());
|
5 |
if($minQty){
|
@@ -9,20 +11,28 @@ if($minQty){
|
|
9 |
<div class="order_prodct_collection inner-container">
|
10 |
<form name="" id="" method="post" action="<?php echo Mage::getUrl('*/*/submitorderbySimpleproduct') ?>">
|
11 |
<div class="third-block grid12-12">
|
12 |
-
<?php $i=0;
|
|
|
|
|
13 |
<?php //if ($typeCategory == $orderProduct['category']): ?>
|
14 |
<div class="order_product grid12-3">
|
15 |
<img src="<?php echo $orderProduct['image']; ?>" />
|
16 |
<div class="order_product_sku">
|
17 |
-
<div class="order_product_name"><a href="<?php echo $baseUrl.$orderProduct['product_url'].'html';
|
|
|
|
|
18 |
<div class="order_product_name"><?php echo $orderProduct['price']; ?></div>
|
19 |
<span class="attr-width cart-table">
|
20 |
<label>Quantity</label>
|
|
|
|
|
|
|
|
|
21 |
<?php $sku = $orderProduct['sku']; ?>
|
22 |
<input type="text" class="input-text qty" onchange="qtyCalculate('<?php echo $skureplace . '_' . $i; ?>', '<?php echo count($orderProduct['sku']); ?>')" name="<?php echo $orderProduct['product_id'] ?>_<?php echo $sku; ?>" id="<?php echo $skureplace . '_' . $i; ?>" value=""/>
|
23 |
</span>
|
24 |
|
25 |
-
<b><span class="totalcount" name="total" id="<?php echo $skureplace; ?>"></span></b>
|
26 |
|
27 |
</div>
|
28 |
|
1 |
<?php
|
2 |
+
|
3 |
$orderSimpleProductsCollection = $this->getOrderSimpleProducts();
|
4 |
+
|
5 |
$baseUrl = Mage::getBaseUrl();
|
6 |
$minQty = Mage::getStoreConfig('customer/customeractivation/min_qty', Mage::app()->getStore());
|
7 |
if($minQty){
|
11 |
<div class="order_prodct_collection inner-container">
|
12 |
<form name="" id="" method="post" action="<?php echo Mage::getUrl('*/*/submitorderbySimpleproduct') ?>">
|
13 |
<div class="third-block grid12-12">
|
14 |
+
<?php $i=0;
|
15 |
+
foreach ($orderSimpleProductsCollection as $orderProduct):
|
16 |
+
?>
|
17 |
<?php //if ($typeCategory == $orderProduct['category']): ?>
|
18 |
<div class="order_product grid12-3">
|
19 |
<img src="<?php echo $orderProduct['image']; ?>" />
|
20 |
<div class="order_product_sku">
|
21 |
+
<div class="order_product_name"><a href="<?php echo $baseUrl.$orderProduct['product_url'].'html';
|
22 |
+
?>"><?php
|
23 |
+
echo $orderProduct['name']; ?></a></div>
|
24 |
<div class="order_product_name"><?php echo $orderProduct['price']; ?></div>
|
25 |
<span class="attr-width cart-table">
|
26 |
<label>Quantity</label>
|
27 |
+
<?php $skureplace = str_replace(' ', '', $orderProduct['sku']);
|
28 |
+
$skureplace = str_replace("'", "", $skureplace);
|
29 |
+
?>
|
30 |
+
|
31 |
<?php $sku = $orderProduct['sku']; ?>
|
32 |
<input type="text" class="input-text qty" onchange="qtyCalculate('<?php echo $skureplace . '_' . $i; ?>', '<?php echo count($orderProduct['sku']); ?>')" name="<?php echo $orderProduct['product_id'] ?>_<?php echo $sku; ?>" id="<?php echo $skureplace . '_' . $i; ?>" value=""/>
|
33 |
</span>
|
34 |
|
35 |
+
<b><span class="totalcount" name="total" id="<?php //echo $skureplace; ?>"></span></b>
|
36 |
|
37 |
</div>
|
38 |
|
app/design/frontend/base/default/template/customerActivation/wholesaleRegister.phtml
CHANGED
@@ -13,6 +13,7 @@
|
|
13 |
}
|
14 |
?>
|
15 |
<?php echo $this->getChildHtml('form_fields_before') ?>
|
|
|
16 |
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" onsubmit="return Validate(this);" name="frmSample" enctype="multipart/form-data">
|
17 |
<div class="fieldset">
|
18 |
<input type="hidden" name="customer_activation" value="customerActivation" />
|
@@ -101,10 +102,10 @@
|
|
101 |
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
102 |
</select>
|
103 |
<script type="text/javascript">
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
109 |
</div>
|
110 |
</div>
|
@@ -125,21 +126,88 @@
|
|
125 |
</li>
|
126 |
<li class="control">
|
127 |
<input type="hidden" name="default_billing" value="1" />
|
128 |
-
<input class="checkbox" id="termas" type="
|
129 |
-
<
|
130 |
-
|
131 |
-
|
132 |
-
if (terms == true) {
|
133 |
-
document.getElementById('termas').value = 1;
|
134 |
-
}
|
135 |
-
else
|
136 |
-
{
|
137 |
-
document.getElementById('termas').value = 0;
|
138 |
-
}
|
139 |
-
}
|
140 |
-
</script>
|
141 |
-
<label for="termas"><?php echo $this->__('Box if Billing and Shipping address are the same') ?></label>
|
142 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
<?php endfor; ?>
|
144 |
<?php endif; ?>
|
145 |
<li class="fields">
|
@@ -196,14 +264,14 @@
|
|
196 |
</div>
|
197 |
</li>
|
198 |
<li>
|
199 |
-
<label for="datefounded"
|
200 |
<div class="input-box">
|
201 |
<input type="text" id="datefounded" name="datefounded" class="input-text" />
|
202 |
</div>
|
203 |
<div id="dateerror"></div>
|
204 |
</li>
|
205 |
<li>
|
206 |
-
<label for="uploadimage"
|
207 |
<input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
|
208 |
<input name="attachment" id="attachment" type="file" />
|
209 |
<div id="imgerror"></div>
|
@@ -246,7 +314,7 @@
|
|
246 |
<!-- <li class="control">
|
247 |
<input class="checkbox required-entry" id="termas" name="termas" type="checkbox" value="1" />
|
248 |
<label for="termas" class="required" ><?php echo $this->__('Terms and Conditions') ?></label>
|
249 |
-
|
250 |
</ul>
|
251 |
</div>
|
252 |
<?php if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/customer", Mage::app()->getStore())): ?>
|
@@ -259,53 +327,36 @@
|
|
259 |
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
260 |
</div>
|
261 |
</form>
|
|
|
262 |
<script type="text/javascript">
|
263 |
jQuery.noConflict();
|
264 |
var _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"];
|
265 |
function Validate() {
|
266 |
|
267 |
var dt = document.frmSample.datefounded
|
268 |
-
if (
|
269 |
-
dt.
|
270 |
-
|
|
|
|
|
271 |
}
|
272 |
-
|
273 |
var fup = document.getElementById('attachment');
|
274 |
-
var fileName = fup.value;
|
275 |
-
var imagename = fileName.substring(0,fileName.lastIndexOf('.'));
|
276 |
-
var ck_username = /^[0-9a-zA-Z\.\_\-]*$/;
|
277 |
-
|
278 |
-
|
279 |
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
{
|
289 |
-
|
290 |
-
jQuery('#imgerror').addClass( 'validation-advice' );
|
291 |
-
document.getElementById("imgerror").innerHTML="Upload PNG or JPG Images only";
|
292 |
-
//alert("Upload PNG or JPG Images only");
|
293 |
-
return false;
|
294 |
}
|
295 |
-
/* if (ck_username.test(imagename)) {
|
296 |
-
jQuery('#imgerror').removeClass( 'validation-advice' );
|
297 |
-
document.getElementById("imgerror").innerHTML="";
|
298 |
-
//alert("Upload PNG or JPG Images only");
|
299 |
-
return true;;
|
300 |
-
|
301 |
-
}else
|
302 |
-
{
|
303 |
-
jQuery('#imgerror').addClass( 'validation-advice' );
|
304 |
-
document.getElementById("imgerror").innerHTML="Please upload valid FileName";
|
305 |
-
return false;
|
306 |
-
|
307 |
-
}*/
|
308 |
-
|
309 |
}
|
310 |
var paymentterms = jQuery('#paymentterms').val();
|
311 |
jQuery(document).ready(function () {
|
@@ -320,8 +371,17 @@
|
|
320 |
//<![CDATA[
|
321 |
var dataForm = new VarienForm('form-validate', true);
|
322 |
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
<style type="text/css">
|
326 |
#payment-terms, #brandsyoucarry, #ups{display: none;}
|
327 |
</style>
|
@@ -394,33 +454,33 @@
|
|
394 |
day = parseInt(strDay)
|
395 |
year = parseInt(strYr)
|
396 |
if (pos1 == -1 || pos2 == -1) {
|
397 |
-
|
398 |
-
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
399 |
//alert("The date format should be : mm/dd/yyyy")
|
400 |
return false
|
401 |
}
|
402 |
if (strMonth.length < 1 || month < 1 || month > 12) {
|
403 |
-
|
404 |
-
|
405 |
return false
|
406 |
}
|
407 |
if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {
|
408 |
-
|
409 |
-
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
410 |
return false
|
411 |
}
|
412 |
if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {
|
413 |
-
|
414 |
-
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
415 |
return false
|
416 |
}
|
417 |
if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {
|
418 |
-
|
419 |
-
document.getElementById("dateerror").innerHTML="The date format should be : mm/dd/yyyy";
|
420 |
return false
|
421 |
}
|
422 |
-
jQuery('#dateerror').removeClass(
|
423 |
-
|
424 |
return true
|
425 |
}
|
426 |
</script>
|
13 |
}
|
14 |
?>
|
15 |
<?php echo $this->getChildHtml('form_fields_before') ?>
|
16 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
17 |
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" onsubmit="return Validate(this);" name="frmSample" enctype="multipart/form-data">
|
18 |
<div class="fieldset">
|
19 |
<input type="hidden" name="customer_activation" value="customerActivation" />
|
102 |
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
103 |
</select>
|
104 |
<script type="text/javascript">
|
105 |
+
//<![CDATA[
|
106 |
+
$('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
|
107 |
+
//]]>
|
108 |
+
</script>
|
109 |
<input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
110 |
</div>
|
111 |
</div>
|
126 |
</li>
|
127 |
<li class="control">
|
128 |
<input type="hidden" name="default_billing" value="1" />
|
129 |
+
<input class="checkbox" id="termas" type="radio" name="default_shipping" onClick="shippingCheck()" />
|
130 |
+
<label for="termas"><?php echo $this->__('Select if Billing and Shipping address are same') ?></label><br/><br/>
|
131 |
+
<input class="checkbox" id="notcheck" type="radio" name="default_shipping" onclick="showMe('div_1', this)"/>
|
132 |
+
<label for="notcheck"><?php echo $this->__('Select if Billing and Shipping address are not same') ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
</li>
|
134 |
+
<div id="div_1" class="fieldset" style="display:none">
|
135 |
+
<div>
|
136 |
+
<label for="shipping_address">Default Shipping Address</label>
|
137 |
+
</div>
|
138 |
+
<br/>
|
139 |
+
<div>
|
140 |
+
<ul class="form-list">
|
141 |
+
<li class="fields">
|
142 |
+
<div class="field">
|
143 |
+
<label for="company"class="required"><em>*</em><?php echo $this->__('Company') ?></label>
|
144 |
+
<div class="input-box">
|
145 |
+
<input type="text" name="shipping[company]" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text required-entry" />
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<div class="field">
|
149 |
+
<label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
150 |
+
<div class="input-box">
|
151 |
+
<input type="text" name="shipping[telephone]" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
</li>
|
155 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
156 |
+
<li class="wide">
|
157 |
+
<label for="street_1" class="required"><em>*</em><?php echo $this->__('Address line 1') ?></label>
|
158 |
+
<div class="input-box">
|
159 |
+
<input type="text" name="shipping[street][]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
|
160 |
+
</div>
|
161 |
+
</li>
|
162 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
163 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
164 |
+
<li class="wide">
|
165 |
+
<label for="street_1"><?php echo $this->__('Address line 2') ?></label>
|
166 |
+
<div class="input-box">
|
167 |
+
<input type="text" name="shipping[street][]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
168 |
+
</div>
|
169 |
+
</li>
|
170 |
+
<?php endfor; ?>
|
171 |
+
<li class="fields">
|
172 |
+
<div class="field">
|
173 |
+
<label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
174 |
+
<div class="input-box">
|
175 |
+
<input type="text" name="shipping[city]" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<div class="field">
|
180 |
+
<label for="shipping[region_id]" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
181 |
+
<div class="input-box">
|
182 |
+
<select id="shipping[region_id]" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
183 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
184 |
+
</select>
|
185 |
+
<script type="text/javascript">
|
186 |
+
//<![CDATA[
|
187 |
+
$('shipping[region_id]').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
|
188 |
+
//]]>
|
189 |
+
</script>
|
190 |
+
<input type="text" id="shipping[region]" name="shipping[region]" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
</li>
|
194 |
+
<li class="fields">
|
195 |
+
<div class="field">
|
196 |
+
<label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
197 |
+
<div class="input-box">
|
198 |
+
<input type="text" name="shipping[postcode]" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
<div class="field">
|
202 |
+
<label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
203 |
+
<div class="input-box">
|
204 |
+
<?php echo $this->getCountryHtmlSelect(null, 'shipping[country_id]', 'shipping[country_id]', 'Shipping Country') ?>
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
</li>
|
208 |
+
</ul>
|
209 |
+
</div>
|
210 |
+
</div>
|
211 |
<?php endfor; ?>
|
212 |
<?php endif; ?>
|
213 |
<li class="fields">
|
264 |
</div>
|
265 |
</li>
|
266 |
<li>
|
267 |
+
<label for="datefounded"><?php echo $this->__("Date Founded")." (mm/dd/yyyy)";?></label>
|
268 |
<div class="input-box">
|
269 |
<input type="text" id="datefounded" name="datefounded" class="input-text" />
|
270 |
</div>
|
271 |
<div id="dateerror"></div>
|
272 |
</li>
|
273 |
<li>
|
274 |
+
<label for="uploadimage"><?php echo $this->__('Upload Image of store') ?></label>
|
275 |
<input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
|
276 |
<input name="attachment" id="attachment" type="file" />
|
277 |
<div id="imgerror"></div>
|
314 |
<!-- <li class="control">
|
315 |
<input class="checkbox required-entry" id="termas" name="termas" type="checkbox" value="1" />
|
316 |
<label for="termas" class="required" ><?php echo $this->__('Terms and Conditions') ?></label>
|
317 |
+
</li> -->
|
318 |
</ul>
|
319 |
</div>
|
320 |
<?php if (Mage::getStoreConfig("fontis_recaptcha/recaptcha/customer", Mage::app()->getStore())): ?>
|
327 |
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
328 |
</div>
|
329 |
</form>
|
330 |
+
</div>
|
331 |
<script type="text/javascript">
|
332 |
jQuery.noConflict();
|
333 |
var _validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"];
|
334 |
function Validate() {
|
335 |
|
336 |
var dt = document.frmSample.datefounded
|
337 |
+
if (dt.value != '') {
|
338 |
+
if (isDate(dt.value) == false) {
|
339 |
+
dt.focus()
|
340 |
+
return false
|
341 |
+
}
|
342 |
}
|
|
|
343 |
var fup = document.getElementById('attachment');
|
344 |
+
var fileName = fup.value;
|
|
|
|
|
|
|
|
|
345 |
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
|
346 |
+
if (fileName != ''){
|
347 |
+
if (ext == "png" || ext == "PNG" || ext == "JPG" || ext == "jpg" || ext == "JPEG" || ext == "jpeg" || ext == "pdf")
|
348 |
+
{
|
349 |
+
jQuery('#imgerror').removeClass('validation-advice');
|
350 |
+
document.getElementById("imgerror").innerHTML = "";
|
351 |
|
352 |
+
}
|
353 |
+
else
|
354 |
+
{
|
355 |
+
jQuery('#imgerror').addClass('validation-advice');
|
356 |
+
document.getElementById("imgerror").innerHTML = "Upload PNG or JPG or PDF Files only";
|
357 |
+
return false;
|
358 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
}
|
361 |
var paymentterms = jQuery('#paymentterms').val();
|
362 |
jQuery(document).ready(function () {
|
371 |
//<![CDATA[
|
372 |
var dataForm = new VarienForm('form-validate', true);
|
373 |
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
|
374 |
+
new RegionUpdater('country', 'shipping[region]', 'shipping[region_id]', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip'); </script>
|
375 |
+
|
376 |
+
<script type="text/javascript" src="<?php echo Mage::getBaseUrl(); ?>js/jquery-ui-main.js"></script>
|
377 |
+
<script type="text/javascript">
|
378 |
+
function showMe() {
|
379 |
+
jQuery("#div_1").css("display", "block");
|
380 |
+
}
|
381 |
+
function shippingCheck() {
|
382 |
+
jQuery("#div_1").css("display", "none");
|
383 |
+
}
|
384 |
+
</script>
|
385 |
<style type="text/css">
|
386 |
#payment-terms, #brandsyoucarry, #ups{display: none;}
|
387 |
</style>
|
454 |
day = parseInt(strDay)
|
455 |
year = parseInt(strYr)
|
456 |
if (pos1 == -1 || pos2 == -1) {
|
457 |
+
jQuery('#dateerror').addClass('validation-advice');
|
458 |
+
document.getElementById("dateerror").innerHTML = "The date format should be : mm/dd/yyyy";
|
459 |
//alert("The date format should be : mm/dd/yyyy")
|
460 |
return false
|
461 |
}
|
462 |
if (strMonth.length < 1 || month < 1 || month > 12) {
|
463 |
+
jQuery('#dateerror').addClass('validation-advice');
|
464 |
+
document.getElementById("dateerror").innerHTML = "The date format should be : mm/dd/yyyy";
|
465 |
return false
|
466 |
}
|
467 |
if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {
|
468 |
+
jQuery('#dateerror').addClass('validation-advice');
|
469 |
+
document.getElementById("dateerror").innerHTML = "The date format should be : mm/dd/yyyy";
|
470 |
return false
|
471 |
}
|
472 |
if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {
|
473 |
+
jQuery('#dateerror').addClass('validation-advice');
|
474 |
+
document.getElementById("dateerror").innerHTML = "The date format should be : mm/dd/yyyy";
|
475 |
return false
|
476 |
}
|
477 |
if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {
|
478 |
+
jQuery('#dateerror').addClass('validation-advice');
|
479 |
+
document.getElementById("dateerror").innerHTML = "The date format should be : mm/dd/yyyy";
|
480 |
return false
|
481 |
}
|
482 |
+
jQuery('#dateerror').removeClass('validation-advice');
|
483 |
+
document.getElementById("dateerror").innerHTML = "";
|
484 |
return true
|
485 |
}
|
486 |
</script>
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wholesale_Customer_Activation</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
-
<license>Open Software License
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Added
|
10 |
-
<description>
|
11 |
-
|
12 |
-
<
|
13 |
-
|
14 |
-
<
|
15 |
-
<
|
|
|
|
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Wholesale_Customer_Activation</name>
|
4 |
+
<version>9.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>Open Software License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Added Features</summary>
|
10 |
+
<description>"Billing/Shipping" address on wholesale registration form 
|
11 |
+
Allow .pdf files to upload in the registration page </description>
|
12 |
+
<notes>"Billing/Shipping" address on wholesale registration form 
|
13 |
+
Allow .pdf files to upload in the registration page </notes>
|
14 |
+
<authors><author><name>developer</name><user>exinent</user><email>developer@exinent.com</email></author></authors>
|
15 |
+
<date>2015-04-24</date>
|
16 |
+
<time>11:03:19</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Exinent"><dir name="CustomerActivation"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Customerimages.php" hash="ec2737955a76186f2b87bcaf6d6343f8"/></dir></dir></dir><dir name="Rewrite"><file name="Fieldset.php" hash="321e2819e5846b44669cef7a1b66d341"/></dir><dir name="System"><dir name="Config"><file name="Date.php" hash="d2f7482b63e9737fd0974828fd644ab5"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Boolean.php" hash="52734afb3fac7f81717aa83842371d1d"/></dir></dir></dir></dir></dir><file name="Orderproduct.php" hash="21ecc76706f6fc27a61f495f8fcf683f"/><dir name="Page"><dir name="Html"><file name="Topmenu.php" hash="1d16a8414ad816faeb1c41bb813acb4e"/></dir></dir><file name="Purchaseorder.php" hash="523393a9a08456231a552576f9a9623d"/><file name="Purchaseorderinfo.php" hash="0f21876ad1e1d7870a56e842e34b2c79"/><dir name="Rewrite"><file name="Fieldset.php" hash="d796319c6cde74e5cfa1934c5263b7d8"/></dir><dir name="collection"><file name="toobar.php" hash="413b12a74f97d71ef9a5da03364dc2e3"/></dir><file name="toobar.php" hash="413b12a74f97d71ef9a5da03364dc2e3"/></dir><dir name="Helper"><file name="Data.php" hash="1b519a518dbee60d63f3aaf0b9694008"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Categories"><dir name="Group"><file name="Multiselect.php" hash="a8dc5c2fbff41fa315043ec348ca360b"/></dir></dir><dir name="Customer"><dir name="Group"><file name="Multiselect.php" hash="21f9f4f675cf60dce1a8ce945084f1bd"/></dir></dir><dir name="Pages"><dir name="Group"><file name="Multiselect.php" hash="9bdf2acc492fe0b8c924f2fb41c3afcd"/></dir></dir><dir name="Products"><dir name="Group"><file name="Multiselect.php" hash="ad4f5f67ef290444e6bc8c617da013c1"/></dir><dir name="Price"><file name="Multiselect.php" hash="490373ac424eade10f0479a5e14d2a9c"/></dir></dir></dir></dir></dir></dir><file name="Customer.php" hash="4124537f87d8f57809525875c79d5eb2"/><file name="Info.php" hash="156b808fd5aaeb2b6efa1aba81460218"/><dir name="Mysql4"><file name="Info.php" hash="07051efccbacd7f0c81307bf9fcc23e7"/><dir name="Subscriber"><file name="Collection.php" hash="56da157699fd0627ddc9f991b41fd613"/></dir><file name="Subscriber.php" hash="bfffd406f9eddba5ed714fba7ad99a25"/></dir><file name="Net15.php" hash="bcb24ede3b498f7488a1986b3a33acb5"/><file name="Net30.php" hash="2dcface31c58114c204db5aca3ca65f8"/><file name="Observer.php" hash="a002c8697faf763fb9d9c0bbf9c722ee"/><file name="Order.php" hash="7eaebf565655776cd7bcba2fce39b641"/><dir name="Resource"><dir name="Attribute"><dir name="Source"><file name="Customeractivation.php" hash="ac458e05c1bb963d73cbd19d3c2aecd9"/><file name="Customerpayment.php" hash="a3f52ad5f8f57cd16aaa08644d224dc8"/><file name="Customershippingmethods.php" hash="d14e9cf9e072978c2a46b521c42f653b"/><file name="Iswebsitelive.php" hash="7d8ae067b8885639e6dd5f4f443226b1"/><file name="StoreType.php" hash="8bd57ac868cb24486a9361d8146a965d"/></dir></dir><file name="Customer.php" hash="d4909a22628e2c448a7be2f98cb4a011"/></dir><file name="Subscriber.php" hash="5ae9d8289a4a9d031154250e6ea6e636"/><file name="Thirdparty.php" hash="ad9ba9fe7110b8ef640f4ddc7aad51ee"/><file name="Thirdpartyfed.php" hash="f29004693ca109b35e26a1ede67a7e1b"/><file name="Thirdpartyfedex.php" hash="9074b87a23c4648ecb76e4c7faee211e"/><file name="Thirdpartyups.php" hash="13898e8a383d27fd33c6f587e574228d"/></dir><dir name="controllers"><file name="AccountController.php" hash="c4b7735b1e347fc5707b1cc6923ce639"/><file name="AdminController.php" hash="d585098ce860d3644d28852d9ffe1526"/><file name="CategoryController.php" hash="bcbabbc5c65c1d666def8c36228bead4"/><file name="IndexController.php" hash="b70c9967c7099b3b90a29d5d0571bba2"/><file name="PageController.php" hash="95aaac064dfaa6e4f072e57c47e308bd"/><file name="ProductController.php" hash="a74507f5ebdb32f4fb30af77aeee78d5"/><file name="productOrderController.php" hash="dc5893cde2b0efe19862deedbd58e794"/></dir><dir name="etc"><file name="config.xml" hash="481783e681609eb304722a77e04ff7dc"/><file name="system.xml" hash="68c075d9c52d37da1a6530ccbc091f20"/></dir><dir name="sql"><dir name="customeractivation_setup"><file name="mysql4-install-0.1.0.php" hash="0b688c4f0c39efb95d4031c632f6b14d"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="d0739de5c91381e11828a033cb496659"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="3be30bef278024b66199c2df6526784d"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="086ef43b26c39e14e7d1211ad444576a"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="857f64d31b13d5c7954591bcad4b45e2"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="80cf342b3125b4411ffb038446aa25c2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="customerActivation.xml" hash="3e8b4f8041c225a3e16c825ffa9deb42"/></dir><dir name="template"><dir name="customerActivation"><file name="customerActivation.phtml" hash="617232d6030f4d5dc8f115886f576009"/><file name="customerImages.phtml" hash="40df0fb4b7eddfec77faf04f91284117"/><file name="fieldset.phtml" hash="7afaa32a0710c041158f3688b5efa0c2"/><dir name="info"><file name="purchaseorder.phtml" hash="8288341954620536133ce8f388b1864c"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="customerActivation.xml" hash="fb798ab498bf2aec1cc72524ad4d815c"/></dir><dir name="template"><dir name="customerActivation"><dir name="checkout"><dir name="onepage"><dir name="payment"><file name="methods.phtml" hash="57aede1686f0be16fd9d1f9475dbb3ba"/></dir><dir name="shipping_method"><file name="available.phtml" hash="7289757a18a0275e7c166201b06a040a"/></dir></dir></dir><file name="customerActivation.phtml" hash="83d6ecadd3dfbb95d4cf37ff22261bc1"/><dir name="form"><file name="purchaseorder.phtml" hash="94707f241d7203a08860891c909142dd"/></dir><dir name="info"><file name="purchaseorder.phtml" hash="d3f2a08ee55199680d563929493d0973"/></dir><dir name="onepage"><dir name="shipping_method"><file name="available.phtml" hash="343efe739dab39cd62da8d80c591f8e5"/></dir></dir><file name="quickorderproduct.phtml" hash="03b5890c6d477ebd665f55b98314c326"/><file name="wholesaleLogin.phtml" hash="16455d9db43ab72c1b385d0ab8e8caee"/><file name="wholesaleRegister.phtml" hash="71904237cd3ecc3e58a5f8df48cce910"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Exinent_CustomerActivation.xml" hash="1c70d1597abb1a6401935436754cfc50"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|