Version Notes
Updated the extension to improve code quality and extension speed.
Download this release
Release Info
Developer | Sitewards Magento Team |
Extension | Sitewards_B2BProfessional |
Version | 3.0.0 |
Comparing to | |
See all releases |
Code changes from version 2.5.2 to 3.0.0
- app/code/community/Sitewards/B2BProfessional/Block/Adminhtml/Order.php +0 -19
- app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/List.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/New.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/Widget/New.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Checkout/Links.php +0 -28
- app/code/community/Sitewards/B2BProfessional/Block/Order.php +0 -47
- app/code/community/Sitewards/B2BProfessional/Block/Order/Form.php +0 -12
- app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Compared.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Viewed.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Widget/Compared.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Widget/Viewed.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Helper/Catalog/Product/Compare.php +0 -23
- app/code/community/Sitewards/B2BProfessional/Helper/Category.php +166 -218
- app/code/community/Sitewards/B2BProfessional/Helper/Core.php +19 -28
- app/code/community/Sitewards/B2BProfessional/Helper/Customer.php +189 -168
- app/code/community/Sitewards/B2BProfessional/Helper/Data.php +201 -182
- app/code/community/Sitewards/B2BProfessional/Helper/Messages.php +0 -72
- app/code/community/Sitewards/B2BProfessional/Helper/Redirects.php +119 -29
- app/code/community/Sitewards/B2BProfessional/Helper/Replacements.php +0 -274
- app/code/community/Sitewards/B2BProfessional/Model/Customer.php +0 -57
- app/code/community/Sitewards/B2BProfessional/Model/Observer.php +241 -447
- app/code/community/Sitewards/B2BProfessional/Model/Order.php +0 -39
- app/code/community/Sitewards/B2BProfessional/Model/Quote.php +0 -24
- app/code/community/Sitewards/B2BProfessional/Model/Resource/Order.php +0 -46
- app/code/community/Sitewards/B2BProfessional/Model/Resource/Order/Collection.php +0 -8
- app/code/community/Sitewards/B2BProfessional/Model/Resource/Quote.php +0 -37
- app/code/community/Sitewards/B2BProfessional/Model/Resource/Quote/Collection.php +0 -8
- app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Category.php +32 -29
- app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Identifiers.php +0 -42
- app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Page.php +27 -24
- app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Tags.php +0 -50
- app/code/community/Sitewards/B2BProfessional/Test/Helper/Data.php +15 -14
- app/code/community/Sitewards/B2BProfessional/controllers/CartController.php +0 -115
- app/code/community/Sitewards/B2BProfessional/controllers/OrderController.php +0 -45
- app/code/community/Sitewards/B2BProfessional/controllers/ProductController.php +0 -64
- app/code/community/Sitewards/B2BProfessional/etc/adminhtml.xml +22 -22
- app/code/community/Sitewards/B2BProfessional/etc/config.xml +97 -306
- app/code/community/Sitewards/B2BProfessional/etc/system.xml +149 -421
- app/code/community/Sitewards/B2BProfessional/sql/sitewards_b2bprofessional/upgrade-2.3.0-2.4.0.php +0 -20
- app/design/adminhtml/default/default/layout/sitewards/b2bprofessional.xml +0 -13
- app/design/adminhtml/default/default/template/sitewards/b2bprofessional/order.phtml +0 -22
- app/design/adminhtml/default/default/template/sitewards/b2bprofessional/sales/order/info.phtml +0 -2
- app/design/frontend/base/default/layout/sitewards/b2bprofessional.xml +0 -77
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/checkbox.phtml +0 -52
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/multi.phtml +0 -49
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/radio.phtml +0 -74
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/select.phtml +0 -63
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/checkbox.phtml +0 -34
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/multi.phtml +0 -31
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/radio.phtml +0 -47
- app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/select.phtml +0 -37
- app/design/frontend/base/default/template/sitewards/b2bprofessional/checkout/billing/extra.phtml +0 -31
- app/design/frontend/base/default/template/sitewards/b2bprofessional/order.phtml +0 -21
- app/design/frontend/base/default/template/sitewards/b2bprofessional/order/form.phtml +0 -37
- app/etc/modules/Sitewards_B2BProfessional.xml +15 -18
- app/locale/de_DE/Sitewards_B2BProfessional.csv +1 -40
- app/locale/en_US/Sitewards_B2BProfessional.csv +17 -3
- js/sitewards/b2bprofessional.js +0 -358
- package.xml +6 -6
- skin/frontend/base/default/css/sitewards/b2bprofessional.css +0 -22
- skin/frontend/base/default/images/sitewards/loading.gif +0 -0
app/code/community/Sitewards/B2BProfessional/Block/Adminhtml/Order.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Adminhtml_Order
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
class Sitewards_B2BProfessional_Block_Adminhtml_Order extends Mage_Adminhtml_Block_Sales_Order_Abstract {
|
10 |
-
/**
|
11 |
-
* @return array
|
12 |
-
*/
|
13 |
-
public function getB2BProfessionalVars () {
|
14 |
-
$oModel = Mage::getModel('b2bprofessional/order');
|
15 |
-
return $oModel->getByOrder(
|
16 |
-
$this->getOrder()
|
17 |
-
->getId());
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/List.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Catalog_Product_List
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Catalog_Product_List extends Mage_Catalog_Block_Product_List {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/New.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Catalog_Product_New
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Catalog_Product_New extends Mage_Catalog_Block_Product_New {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Catalog/Product/Widget/New.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Catalog_Product_Widget_New
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Catalog_Product_Widget_New extends Mage_Catalog_Block_Product_Widget_New {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Checkout/Links.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Checkout_Links
|
4 |
-
* - Override the addCheckoutLink to validate the current cart
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Checkout_Links extends Mage_Checkout_Block_Links {
|
11 |
-
/**
|
12 |
-
* Validate the user's cart
|
13 |
-
* - when inactive remove the link
|
14 |
-
* - when active continue to the parent function
|
15 |
-
*
|
16 |
-
* @return Mage_Checkout_Block_Links
|
17 |
-
*/
|
18 |
-
public function addCheckoutLink() {
|
19 |
-
/* @var $oB2BHelper Sitewards_B2BProfessional_Helper_Data */
|
20 |
-
$oB2BHelper = Mage::helper('b2bprofessional');
|
21 |
-
|
22 |
-
if (!$oB2BHelper->hasValidCart()) {
|
23 |
-
return $this;
|
24 |
-
} else {
|
25 |
-
return parent::addCheckoutLink();
|
26 |
-
}
|
27 |
-
}
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Order.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Order
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
class Sitewards_B2BProfessional_Block_Order extends Mage_Core_Block_Template {
|
10 |
-
/**
|
11 |
-
* return special b2bprof vars
|
12 |
-
*
|
13 |
-
* @return mixed
|
14 |
-
*/
|
15 |
-
public function getB2BProfessionalVars() {
|
16 |
-
$oModel = Mage::getModel('b2bprofessional/order');
|
17 |
-
return $oModel->getByOrder(
|
18 |
-
$this->getOrder()
|
19 |
-
->getId()
|
20 |
-
);
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @return Mage_Sales_Model_Order
|
25 |
-
*/
|
26 |
-
public function getOrder () {
|
27 |
-
return Mage::registry('current_order');
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @return bool
|
32 |
-
*/
|
33 |
-
public function canCancel() {
|
34 |
-
$oModel = Mage::getModel('b2bprofessional/order');
|
35 |
-
return $oModel->canCancel(
|
36 |
-
$this->getOrder()
|
37 |
-
->getId()
|
38 |
-
);
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @return string
|
43 |
-
*/
|
44 |
-
public function getCancelUrl() {
|
45 |
-
return $this->getUrl('b2bprofessional/order/cancel', array('id' => $this->getOrder()->getId()));
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Order/Form.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Order_Form
|
4 |
-
* - content of New Order Form page
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Order_Form extends Mage_Core_Block_Template {
|
11 |
-
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Compared.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Reports_Product_Compared
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Reports_Product_Compared extends Mage_Reports_Block_Product_Compared {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Viewed.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Reports_Product_Viewed
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Reports_Product_Viewed extends Mage_Reports_Block_Product_Viewed {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Widget/Compared.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Reports_Product_Widget_Compared
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Reports_Product_Widget_Compared extends Mage_Reports_Block_Product_Widget_Compared {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Block/Reports/Product/Widget/Viewed.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Block_Reports_Product_Widget_Viewed
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Block_Reports_Product_Widget_Viewed extends Mage_Reports_Block_Product_Widget_Viewed {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @param array $aAdditional
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getAddToCartUrl($oProduct, $aAdditional = array()) {
|
20 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
21 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
22 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct, $aAdditional));
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Helper/Catalog/Product/Compare.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Helper_Catalog_Product_Compare
|
4 |
-
* - rewrite the getAddToCartUrl function to check if the product is active
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Helper_Catalog_Product_Compare extends Mage_Catalog_Helper_Product_Compare {
|
11 |
-
/**
|
12 |
-
* Check if the product is valid
|
13 |
-
* - return the replacement text for the add to cart url when required
|
14 |
-
*
|
15 |
-
* @param Mage_Catalog_Model_Product $oProduct
|
16 |
-
* @return string
|
17 |
-
*/
|
18 |
-
public function getAddToCartUrl($oProduct) {
|
19 |
-
/* @var $oB2BReplacementsHelper Sitewards_B2BProfessional_Helper_Replacements */
|
20 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
21 |
-
return $oB2BReplacementsHelper->replaceAddToCart($oProduct->getId(), parent::getAddToCartUrl($oProduct));
|
22 |
-
}
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Helper/Category.php
CHANGED
@@ -1,225 +1,173 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
-
* -
|
5 |
-
*
|
6 |
-
*
|
7 |
-
* - function to get the current category id and all children ids
|
8 |
-
* - function to get the category ids of each category filter set
|
9 |
-
* - function to check that at least one of the given category ids is active
|
10 |
-
* - function to get the current category object
|
11 |
-
* - function to get all category ids activated via the system config
|
12 |
-
* - function to get an array of category ids activated via the admin config section
|
13 |
-
* - function to load all child category ids into an array from a given category id
|
14 |
*
|
15 |
* @category Sitewards
|
16 |
* @package Sitewards_B2BProfessional
|
17 |
-
* @copyright Copyright (c)
|
18 |
*/
|
19 |
-
class Sitewards_B2BProfessional_Helper_Category extends
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Loop through each activated category ids and add children category ids
|
182 |
-
*/
|
183 |
-
$aSubActiveCategories = array();
|
184 |
-
foreach ($aCurrentActiveCategories as $iCategoryId) {
|
185 |
-
$aSubActiveCategories = $this->addCategoryChildren($iCategoryId, $aSubActiveCategories);
|
186 |
-
}
|
187 |
-
return array_unique($aSubActiveCategories);
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Get an array of category ids activated via the admin config section
|
192 |
-
*
|
193 |
-
* @return array
|
194 |
-
*/
|
195 |
-
private function getActivatedCategoryIds() {
|
196 |
-
/*
|
197 |
-
* Category Ids are saved in the config in format
|
198 |
-
* - "category1,category2"
|
199 |
-
*/
|
200 |
-
$sActivatedCategoryIds = Mage::getStoreConfig(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . Sitewards_B2BProfessional_Helper_Core::CONFIG_CATEGORY_SETTINGS_NODE . '/activecategories');
|
201 |
-
return explode(',', $sActivatedCategoryIds);
|
202 |
-
}
|
203 |
-
|
204 |
-
/**
|
205 |
-
* From given category id load all child ids into an array
|
206 |
-
*
|
207 |
-
* @param int $iCategoryId
|
208 |
-
* @param array $aCurrentCategories
|
209 |
-
* array(
|
210 |
-
* cat_id_1,
|
211 |
-
* cat_id_2
|
212 |
-
* )
|
213 |
-
* @return array
|
214 |
-
* array(
|
215 |
-
* cat_id_1,
|
216 |
-
* cat_id_2
|
217 |
-
* )
|
218 |
-
*/
|
219 |
-
private function addCategoryChildren($iCategoryId, $aCurrentCategories = array()) {
|
220 |
-
/* @var $oCurrentCategory Mage_Catalog_Model_Category */
|
221 |
-
$oCurrentCategory = Mage::getModel('catalog/category');
|
222 |
-
$oCurrentCategory = $oCurrentCategory->load($iCategoryId);
|
223 |
-
return array_merge($aCurrentCategories, $oCurrentCategory->getAllChildren(true));
|
224 |
-
}
|
225 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* Sitewards_B2BProfessional_Helper_Category
|
5 |
+
* - Helper containing the checks for
|
6 |
+
* - if extension is activated by category
|
7 |
+
* - checking if a category is active from a given product
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
*
|
9 |
* @category Sitewards
|
10 |
* @package Sitewards_B2BProfessional
|
11 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
12 |
*/
|
13 |
+
class Sitewards_B2BProfessional_Helper_Category extends Sitewards_B2BProfessional_Helper_Core
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Path for the config for extension active by category
|
17 |
+
*/
|
18 |
+
const CONFIG_EXTENSION_ACTIVE_BY_CATEGORY = 'b2bprofessional/activatebycategorysettings/activebycategory';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Path for the config for activated categories
|
22 |
+
*/
|
23 |
+
const CONFIG_EXTENSION_ACTIVATED_CATEGORIES = 'b2bprofessional/activatebycategorysettings/activecategories';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Variable for if the extension is active by category
|
27 |
+
*
|
28 |
+
* @var bool
|
29 |
+
*/
|
30 |
+
protected $bExtensionActiveByCategory;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Check to see if the website is set-up to require a user login to view pages
|
34 |
+
*
|
35 |
+
* @return bool
|
36 |
+
*/
|
37 |
+
public function isExtensionActivatedByCategory()
|
38 |
+
{
|
39 |
+
return $this->getStoreFlag(self::CONFIG_EXTENSION_ACTIVE_BY_CATEGORY, 'bExtensionActiveByCategory');
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* For a product get all the parent and children product ids when they are set
|
44 |
+
*
|
45 |
+
* @param Mage_Catalog_Model_Product $oProduct
|
46 |
+
* @return int[]
|
47 |
+
*/
|
48 |
+
protected function getChildrenAndParentIds(Mage_Catalog_Model_Product $oProduct)
|
49 |
+
{
|
50 |
+
$oProductType = $oProduct->getTypeInstance();
|
51 |
+
$aLinkedProductIds = $oProductType->getParentIdsByChild($oProduct->getId());
|
52 |
+
$aChildProductIdsByGroups = $oProductType->getChildrenIds($oProduct->getId());
|
53 |
+
foreach ($aChildProductIdsByGroups as $aChildProductIds) {
|
54 |
+
$aLinkedProductIds = array_unique(array_merge($aLinkedProductIds, $aChildProductIds));
|
55 |
+
}
|
56 |
+
return $aLinkedProductIds;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Validate that the category of a give product is activated in the module
|
61 |
+
*
|
62 |
+
* @param Mage_Catalog_Model_Product $oProduct
|
63 |
+
* @return bool
|
64 |
+
*/
|
65 |
+
public function isCategoryActiveByProduct(Mage_Catalog_Model_Product $oProduct)
|
66 |
+
{
|
67 |
+
$aCurrentCategories = $oProduct->getCategoryIds();
|
68 |
+
|
69 |
+
$aLinkedProductIds = array();
|
70 |
+
if ($oProduct->isSuper()) {
|
71 |
+
$aLinkedProductIds = $this->getChildrenAndParentIds($oProduct);
|
72 |
+
}
|
73 |
+
|
74 |
+
if (!empty($aLinkedProductIds)) {
|
75 |
+
$aCurrentCategories = $this->getAllCategoryIds($aLinkedProductIds, $aCurrentCategories);
|
76 |
+
}
|
77 |
+
|
78 |
+
if (!is_array($aCurrentCategories)) {
|
79 |
+
$aCurrentCategories = array(
|
80 |
+
$aCurrentCategories
|
81 |
+
);
|
82 |
+
}
|
83 |
+
return $this->hasActiveCategory($aCurrentCategories);
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Check that at least one of the given category ids is active
|
88 |
+
*
|
89 |
+
* @param int[] $aCategoryIds
|
90 |
+
* @return bool
|
91 |
+
*/
|
92 |
+
public function hasActiveCategory($aCategoryIds)
|
93 |
+
{
|
94 |
+
$aActiveCategoryIds = $this->getActiveCategories();
|
95 |
+
foreach ($aCategoryIds as $iCategoryId) {
|
96 |
+
if (in_array($iCategoryId, $aActiveCategoryIds)) {
|
97 |
+
return true;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
return false;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Get all category ids activated via the system config
|
105 |
+
* - Include the children category ids
|
106 |
+
*
|
107 |
+
* @return int[]
|
108 |
+
*/
|
109 |
+
protected function getActiveCategories()
|
110 |
+
{
|
111 |
+
$aCurrentActiveCategories = $this->getExtensionActivatedCategoryIds();
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Loop through each activated category ids and add children category ids
|
115 |
+
*/
|
116 |
+
$aSubActiveCategories = $this->addCategoryChildren($aCurrentActiveCategories);
|
117 |
+
return array_unique(array_merge($aCurrentActiveCategories, $aSubActiveCategories));
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Get an array of category ids activated via the admin config section
|
122 |
+
*
|
123 |
+
* @return int[]
|
124 |
+
*/
|
125 |
+
protected function getExtensionActivatedCategoryIds()
|
126 |
+
{
|
127 |
+
/*
|
128 |
+
* Category Ids are saved in the config in format
|
129 |
+
* - "category1,category2"
|
130 |
+
*/
|
131 |
+
$sActivatedCategoryIds = Mage::getStoreConfig(self::CONFIG_EXTENSION_ACTIVATED_CATEGORIES);
|
132 |
+
return explode(',', $sActivatedCategoryIds);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* From given category id load all child ids into an array
|
137 |
+
*
|
138 |
+
* @param int[] $aCategoryIds
|
139 |
+
* @return int[]
|
140 |
+
*/
|
141 |
+
protected function addCategoryChildren($aCategoryIds)
|
142 |
+
{
|
143 |
+
$oCategoryResource = Mage::getResourceModel('catalog/category');
|
144 |
+
$oAdapter = $oCategoryResource->getReadConnection();
|
145 |
+
|
146 |
+
$oSelect = $oAdapter->select();
|
147 |
+
$oSelect->from(array('m' => $oCategoryResource->getEntityTable()), 'entity_id');
|
148 |
+
|
149 |
+
foreach ($aCategoryIds as $iCategoryId) {
|
150 |
+
$oSelect->orWhere($oAdapter->quoteIdentifier('path') . ' LIKE ?', '%/' . $iCategoryId . '/%');
|
151 |
+
}
|
152 |
+
return $oAdapter->fetchCol($oSelect);
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* From an array of all product ids get all unique entries in the product category table
|
157 |
+
*
|
158 |
+
* @param int[] $aProductIds
|
159 |
+
* @param int[] $aCurrentCategories
|
160 |
+
* @return int[]
|
161 |
+
*/
|
162 |
+
protected function getAllCategoryIds($aProductIds, $aCurrentCategories)
|
163 |
+
{
|
164 |
+
$oProductResource = Mage::getResourceModel('catalog/product');
|
165 |
+
$oAdapter = $oProductResource->getReadConnection();
|
166 |
+
|
167 |
+
$oSelect = $oAdapter->select();
|
168 |
+
$oSelect->from($oProductResource->getTable('catalog/category_product'), 'category_id');
|
169 |
+
$oSelect->where('product_id IN (?)', $aProductIds);
|
170 |
+
|
171 |
+
return array_unique(array_merge($aCurrentCategories, $oAdapter->fetchCol($oSelect)));
|
172 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
}
|
app/code/community/Sitewards/B2BProfessional/Helper/Core.php
CHANGED
@@ -1,35 +1,26 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
-
* - define the reusable sections of the config file
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c)
|
9 |
*/
|
10 |
-
class Sitewards_B2BProfessional_Helper_Core extends Mage_Core_Helper_Abstract
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* The category settings node of the b2b professional configuration
|
28 |
-
*/
|
29 |
-
const CONFIG_CATEGORY_SETTINGS_NODE = 'activatebycategorysettings';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The customer settings node of the b2b professional configuration
|
33 |
-
*/
|
34 |
-
const CONFIG_CUSTOMER_SETTINGS_NODE = 'activatebycustomersettings';
|
35 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* Sitewards_B2BProfessional_Helper_Core
|
|
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
*/
|
10 |
+
class Sitewards_B2BProfessional_Helper_Core extends Mage_Core_Helper_Abstract
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Get a store flag value and set to against the object
|
14 |
+
*
|
15 |
+
* @param string $sStoreFlagPath
|
16 |
+
* @param string $sStoreFlagAttribute
|
17 |
+
* @return bool
|
18 |
+
*/
|
19 |
+
public function getStoreFlag($sStoreFlagPath, $sStoreFlagAttribute)
|
20 |
+
{
|
21 |
+
if ($this->$sStoreFlagAttribute === null) {
|
22 |
+
$this->$sStoreFlagAttribute = Mage::getStoreConfigFlag($sStoreFlagPath);
|
23 |
+
}
|
24 |
+
return $this->$sStoreFlagAttribute;
|
25 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
app/code/community/Sitewards/B2BProfessional/Helper/Customer.php
CHANGED
@@ -1,175 +1,196 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
-
* -
|
5 |
-
*
|
6 |
-
*
|
7 |
-
* - function to check if customer is allowed in the current store
|
8 |
-
* - function to check if customers are activated globally
|
9 |
-
* - function to check if customer is active for store
|
10 |
-
* - function to check if customer was created via the admin section
|
11 |
-
* - function to get the extension's activated customer groups
|
12 |
*
|
13 |
* @category Sitewards
|
14 |
* @package Sitewards_B2BProfessional
|
15 |
-
* @copyright Copyright (c)
|
16 |
*/
|
17 |
-
class Sitewards_B2BProfessional_Helper_Customer extends
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
+
* Sitewards_B2BProfessional_Helper_Customer
|
5 |
+
* - Helper containing the checks for
|
6 |
+
* - customer is active
|
7 |
+
* - if login is required
|
|
|
|
|
|
|
|
|
|
|
8 |
*
|
9 |
* @category Sitewards
|
10 |
* @package Sitewards_B2BProfessional
|
11 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
12 |
*/
|
13 |
+
class Sitewards_B2BProfessional_Helper_Customer extends Sitewards_B2BProfessional_Helper_Core
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Path for the config for extension requires login
|
17 |
+
*/
|
18 |
+
const CONFIG_EXTENSION_REQUIRES_LOGIN = 'b2bprofessional/requirelogin/requirelogin';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Path for the config for extension is active by customer group
|
22 |
+
*/
|
23 |
+
const CONFIG_EXTENSION_ACTIVE_BY_CUSTOMER_GROUP = 'b2bprofessional/activatebycustomersettings/activebycustomer';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Path for the config for customer groups that are activated
|
27 |
+
*/
|
28 |
+
const CONFIG_EXTENSION_ACTIVE_CUSTOMER_GROUPS = 'b2bprofessional/activatebycustomersettings/activecustomers';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Path for the config for customer groups that are activated
|
32 |
+
*/
|
33 |
+
const CONFIG_EXTENSION_ACTIVE_CUSTOMER_GLOBALLY = 'b2bprofessional/generalsettings/activecustomers';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Flag if the extension is set to require login
|
37 |
+
*
|
38 |
+
* @var bool
|
39 |
+
*/
|
40 |
+
protected $bLoginRequired;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Flag if the extension is active by customer group
|
44 |
+
*
|
45 |
+
* @var bool
|
46 |
+
*/
|
47 |
+
protected $bExtensionActiveByCustomerGroup;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Array of activated customer group ids
|
51 |
+
*
|
52 |
+
* @var int[]
|
53 |
+
*/
|
54 |
+
protected $aActivatedCustomerGroupIds = array();
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Check to see if the customer is logged in
|
58 |
+
* - Is the session logged in,
|
59 |
+
* - Are customers activated globally,
|
60 |
+
* - Is this one customer active for the current store,
|
61 |
+
*
|
62 |
+
* @return bool
|
63 |
+
*/
|
64 |
+
public function isCustomerLoggedIn()
|
65 |
+
{
|
66 |
+
if (Mage::helper('customer')->isLoggedIn() === true) {
|
67 |
+
/*
|
68 |
+
* If customer activation is global
|
69 |
+
* - then any customer can access any store
|
70 |
+
*/
|
71 |
+
if ($this->isCustomerActivationGlobal()) {
|
72 |
+
return true;
|
73 |
+
}
|
74 |
+
|
75 |
+
/* @var $oCustomerSession Mage_Customer_Model_Session */
|
76 |
+
$oCustomerSession = Mage::getSingleton('customer/session');
|
77 |
+
/* @var $oCustomer Mage_Customer_Model_Customer */
|
78 |
+
$oCustomer = $oCustomerSession->getCustomer();
|
79 |
+
if($this->isCustomerActiveForStore($oCustomer)) {
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Check if the extension has customers activated globally
|
88 |
+
*
|
89 |
+
* @return bool
|
90 |
+
*/
|
91 |
+
private function isCustomerActivationGlobal()
|
92 |
+
{
|
93 |
+
return Mage::getStoreConfigFlag(self::CONFIG_EXTENSION_ACTIVE_CUSTOMER_GLOBALLY);
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Check if a given customer is allowed for the current store
|
98 |
+
* - NOTE: users created via the admin section cannot be attached to a front end store and so are globally active
|
99 |
+
*
|
100 |
+
* @param Mage_Customer_Model_Customer $oCustomer
|
101 |
+
* @return bool
|
102 |
+
*/
|
103 |
+
private function isCustomerActiveForStore(Mage_Customer_Model_Customer $oCustomer)
|
104 |
+
{
|
105 |
+
/*
|
106 |
+
* Check to see if the user was created via the admin section
|
107 |
+
* - Note: users created via the admin section cannot be attached to a front end store
|
108 |
+
*/
|
109 |
+
if ($this->isCustomerAdminCreation($oCustomer)) {
|
110 |
+
return true;
|
111 |
+
}
|
112 |
+
|
113 |
+
/*
|
114 |
+
* Get user's store and current store for comparison
|
115 |
+
*/
|
116 |
+
$iUserStoreId = $oCustomer->getStoreId();
|
117 |
+
$iCurrentStoreId = Mage::app()->getStore()->getId();
|
118 |
+
|
119 |
+
/*
|
120 |
+
* Return true if:
|
121 |
+
* - the user's store id matches the current store id
|
122 |
+
*/
|
123 |
+
return $iUserStoreId === $iCurrentStoreId;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Check to see if the user has been created via the admin section
|
128 |
+
*
|
129 |
+
* @param Mage_Customer_Model_Customer $oCustomer
|
130 |
+
* @return bool
|
131 |
+
*/
|
132 |
+
private function isCustomerAdminCreation(Mage_Customer_Model_Customer $oCustomer)
|
133 |
+
{
|
134 |
+
return $oCustomer->getStoreId() === Mage_Core_Model_App::ADMIN_STORE_ID;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Check to see if the customer's group is active
|
139 |
+
* - If they are not logged in then we do not need to check any further
|
140 |
+
*
|
141 |
+
* @return bool
|
142 |
+
*/
|
143 |
+
public function isCustomerGroupActive()
|
144 |
+
{
|
145 |
+
/* @var $oCustomerSession Mage_Customer_Model_Session */
|
146 |
+
$oCustomerSession = Mage::getModel('customer/session');
|
147 |
+
$iCurrentCustomerGroupId = $oCustomerSession->getCustomerGroupId();
|
148 |
+
$aActiveCustomerGroupIds = $this->getActivatedCustomerGroupIds();
|
149 |
+
|
150 |
+
return in_array($iCurrentCustomerGroupId, $aActiveCustomerGroupIds);
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Check to see if the website is set-up to require a user login to view pages
|
155 |
+
*
|
156 |
+
* @return bool
|
157 |
+
*/
|
158 |
+
public function isLoginRequired()
|
159 |
+
{
|
160 |
+
return $this->getStoreFlag(self::CONFIG_EXTENSION_REQUIRES_LOGIN, 'bLoginRequired');
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Check to see if the extension is activated by customer group
|
165 |
+
*
|
166 |
+
* @return bool
|
167 |
+
*/
|
168 |
+
public function isExtensionActivatedByCustomerGroup()
|
169 |
+
{
|
170 |
+
return $this->getStoreFlag(self::CONFIG_EXTENSION_ACTIVE_BY_CUSTOMER_GROUP, 'bExtensionActiveByCustomerGroup');
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Get an array of all the activated customer group ids
|
175 |
+
* - always include the 'NOT LOGGED IN' group
|
176 |
+
*
|
177 |
+
* @return int[]
|
178 |
+
*/
|
179 |
+
private function getActivatedCustomerGroupIds()
|
180 |
+
{
|
181 |
+
if (empty($this->aActivatedCustomerGroupIds)) {
|
182 |
+
/*
|
183 |
+
* Customer group ids are saved in the config in format
|
184 |
+
* - "group1,group2"
|
185 |
+
*/
|
186 |
+
$sActivatedCustomerGroups = Mage::getStoreConfig(self::CONFIG_EXTENSION_ACTIVE_CUSTOMER_GROUPS);
|
187 |
+
$this->aActivatedCustomerGroupIds = explode(',', $sActivatedCustomerGroups);
|
188 |
+
|
189 |
+
/*
|
190 |
+
* Always add the guest user group id when activated by customer group
|
191 |
+
*/
|
192 |
+
$this->aActivatedCustomerGroupIds[] = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID;
|
193 |
+
}
|
194 |
+
return $this->aActivatedCustomerGroupIds;
|
195 |
+
}
|
196 |
}
|
app/code/community/Sitewards/B2BProfessional/Helper/Data.php
CHANGED
@@ -1,189 +1,208 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Sitewards_B2BProfessional_Helper_Data
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* - Check module global flag,
|
9 |
-
* - Check that customer is logged in and active,
|
10 |
-
* - Check that the product/customer is activated,
|
11 |
-
* - Check that the current cart is valid,
|
12 |
*
|
13 |
* @category Sitewards
|
14 |
* @package Sitewards_B2BProfessional
|
15 |
-
* @copyright Copyright (c)
|
16 |
*/
|
17 |
-
class Sitewards_B2BProfessional_Helper_Data extends
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional_Helper_Data
|
5 |
+
* - Helper containing the checks for
|
6 |
+
* - extension is active,
|
7 |
+
* - product is active,
|
8 |
+
* - is the category active,
|
|
|
|
|
|
|
|
|
9 |
*
|
10 |
* @category Sitewards
|
11 |
* @package Sitewards_B2BProfessional
|
12 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
13 |
*/
|
14 |
+
class Sitewards_B2BProfessional_Helper_Data extends Sitewards_B2BProfessional_Helper_Core
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Path for the config for extension active status
|
18 |
+
*/
|
19 |
+
const CONFIG_EXTENSION_ACTIVE = 'b2bprofessional/generalsettings/active';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Path for the config for price block class names
|
23 |
+
*/
|
24 |
+
const CONFIG_EXTENSION_PRICE_BLOCKS = 'b2bprofessional/generalsettings/priceblocks';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Variable for if the extension is active
|
28 |
+
*
|
29 |
+
* @var bool
|
30 |
+
*/
|
31 |
+
protected $bExtensionActive;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Variable for if the extension is active by category
|
35 |
+
*
|
36 |
+
* @var bool
|
37 |
+
*/
|
38 |
+
protected $bExtensionActiveByCategory;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Variable for if the extension is active by customer group
|
42 |
+
*
|
43 |
+
* @var bool
|
44 |
+
*/
|
45 |
+
protected $bExtensionActiveByCustomerGroup;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Variable for the extension's price blocks
|
49 |
+
*
|
50 |
+
* @var string[]
|
51 |
+
*/
|
52 |
+
protected $aPriceBlockClassNames;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Check to see if the extension is active
|
56 |
+
*
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isExtensionActive()
|
60 |
+
{
|
61 |
+
return $this->getStoreFlag(self::CONFIG_EXTENSION_ACTIVE, 'bExtensionActive');
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Check to see if the extension is active by category
|
66 |
+
*
|
67 |
+
* @return bool
|
68 |
+
*/
|
69 |
+
protected function isExtensionActiveByCategory()
|
70 |
+
{
|
71 |
+
if ($this->bExtensionActiveByCategory === null) {
|
72 |
+
$this->bExtensionActiveByCategory = Mage::helper(
|
73 |
+
'sitewards_b2bprofessional/category'
|
74 |
+
)->isExtensionActivatedByCategory();
|
75 |
+
}
|
76 |
+
return $this->bExtensionActiveByCategory;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Check to see if the extension is active by user group
|
81 |
+
*
|
82 |
+
* @return bool
|
83 |
+
*/
|
84 |
+
protected function isExtensionActivatedByCustomerGroup()
|
85 |
+
{
|
86 |
+
if ($this->bExtensionActiveByCustomerGroup === null) {
|
87 |
+
$this->bExtensionActiveByCustomerGroup = Mage::helper(
|
88 |
+
'sitewards_b2bprofessional/customer'
|
89 |
+
)->isExtensionActivatedByCustomerGroup();
|
90 |
+
}
|
91 |
+
return $this->bExtensionActiveByCustomerGroup;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Check to see if the block is a price block
|
96 |
+
*
|
97 |
+
* @param Mage_Core_Block_Template $oBlock
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
public function isBlockPriceBlock($oBlock)
|
101 |
+
{
|
102 |
+
$aPriceBlockClassNames = $this->getPriceBlocks();
|
103 |
+
return in_array(get_class($oBlock), $aPriceBlockClassNames);
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Check to see if the given product is active
|
108 |
+
* - In this case active means product behaves as normal in a magento shop
|
109 |
+
*
|
110 |
+
* @param Mage_Catalog_Model_Product $oProduct
|
111 |
+
* @return bool
|
112 |
+
*/
|
113 |
+
public function isProductActive(Mage_Catalog_Model_Product $oProduct)
|
114 |
+
{
|
115 |
+
$bIsProductActive = true;
|
116 |
+
if ($this->isExtensionActive() === true) {
|
117 |
+
$bCheckCategory = $this->isExtensionActiveByCategory();
|
118 |
+
$bCheckUser = $this->isExtensionActivatedByCustomerGroup();
|
119 |
+
$bIsCustomerLoggedIn = $this->isCustomerLoggedIn();
|
120 |
+
|
121 |
+
/** @var Sitewards_B2BProfessional_Helper_Category $oCategoryHelper */
|
122 |
+
$oCategoryHelper = Mage::helper('sitewards_b2bprofessional/category');
|
123 |
+
/** @var Sitewards_B2BProfessional_Helper_Customer $oCustomerHelper */
|
124 |
+
$oCustomerHelper = Mage::helper('sitewards_b2bprofessional/customer');
|
125 |
+
|
126 |
+
$bIsCategoryEnabled = $oCategoryHelper->isCategoryActiveByProduct($oProduct);
|
127 |
+
$bIsCustomerGroupEnabled = $oCustomerHelper->isCustomerGroupActive();
|
128 |
+
|
129 |
+
if ($bCheckCategory && $bCheckUser) {
|
130 |
+
$bIsProductActive = !($bIsCategoryEnabled && $bIsCustomerGroupEnabled);
|
131 |
+
} elseif ($bCheckUser) {
|
132 |
+
$bIsProductActive = !$bIsCustomerGroupEnabled;
|
133 |
+
} elseif ($bCheckCategory) {
|
134 |
+
if ($bIsCustomerLoggedIn) {
|
135 |
+
$bIsProductActive = true;
|
136 |
+
} else {
|
137 |
+
$bIsProductActive = !$bIsCategoryEnabled;
|
138 |
+
}
|
139 |
+
} else {
|
140 |
+
$bIsProductActive = $bIsCustomerLoggedIn;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
return $bIsProductActive;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* From an array of category ids check to see if any are enabled via the extension to hide prices
|
149 |
+
*
|
150 |
+
* @param int[] $aCategoryIds
|
151 |
+
* @return bool
|
152 |
+
*/
|
153 |
+
public function hasEnabledCategories($aCategoryIds)
|
154 |
+
{
|
155 |
+
$bHasCategories = false;
|
156 |
+
if ($this->isExtensionActive() === true) {
|
157 |
+
$bCheckCategory = $this->isExtensionActiveByCategory();
|
158 |
+
$bCheckUser = $this->isExtensionActivatedByCustomerGroup();
|
159 |
+
$bIsCustomerLoggedIn = $this->isCustomerLoggedIn();
|
160 |
+
|
161 |
+
/** @var Sitewards_B2BProfessional_Helper_Category $oCategoryHelper */
|
162 |
+
$oCategoryHelper = Mage::helper('sitewards_b2bprofessional/category');
|
163 |
+
/** @var Sitewards_B2BProfessional_Helper_Customer $oCustomerHelper */
|
164 |
+
$oCustomerHelper = Mage::helper('sitewards_b2bprofessional/customer');
|
165 |
+
|
166 |
+
$bHasActiveCategories = $oCategoryHelper->hasActiveCategory($aCategoryIds);
|
167 |
+
$bIsUserGroupActive = $oCustomerHelper->isCustomerGroupActive();
|
168 |
+
|
169 |
+
if ($bCheckCategory && $bCheckUser) {
|
170 |
+
$bHasCategories = $bHasActiveCategories && $bIsUserGroupActive;
|
171 |
+
} elseif ($bCheckUser) {
|
172 |
+
$bHasCategories = $bIsUserGroupActive;
|
173 |
+
} elseif ($bCheckCategory) {
|
174 |
+
if ($bIsCustomerLoggedIn) {
|
175 |
+
$bHasCategories = false;
|
176 |
+
} else {
|
177 |
+
$bHasCategories = $bHasActiveCategories;
|
178 |
+
}
|
179 |
+
} else {
|
180 |
+
$bHasCategories = !$bIsCustomerLoggedIn;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
return $bHasCategories;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Check if the customer is logged in
|
188 |
+
*
|
189 |
+
* @return bool
|
190 |
+
*/
|
191 |
+
protected function isCustomerLoggedIn()
|
192 |
+
{
|
193 |
+
return Mage::helper('sitewards_b2bprofessional/customer')->isCustomerLoggedIn();
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Get the price blocks as defined in the xml
|
198 |
+
*
|
199 |
+
* @return string[]
|
200 |
+
*/
|
201 |
+
protected function getPriceBlocks()
|
202 |
+
{
|
203 |
+
if ($this->aPriceBlockClassNames === null) {
|
204 |
+
$this->aPriceBlockClassNames = Mage::getStoreConfig(self::CONFIG_EXTENSION_PRICE_BLOCKS);
|
205 |
+
}
|
206 |
+
return $this->aPriceBlockClassNames;
|
207 |
+
}
|
208 |
+
}
|
app/code/community/Sitewards/B2BProfessional/Helper/Messages.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Class Sitewards_B2BProfessional_Helper_Messages
|
4 |
-
* - contains each message type constant
|
5 |
-
* - checkout = 0
|
6 |
-
* - price = 1
|
7 |
-
* - login = 2
|
8 |
-
* - contains an array with all messages
|
9 |
-
* - configuration path to override message
|
10 |
-
* - default message
|
11 |
-
* - function that takes in message type and returns the valid message
|
12 |
-
*
|
13 |
-
* @category Sitewards
|
14 |
-
* @package Sitewards_B2BProfessional
|
15 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
16 |
-
*/
|
17 |
-
class Sitewards_B2BProfessional_Helper_Messages extends Mage_Core_Helper_Abstract {
|
18 |
-
/**
|
19 |
-
* Array id for the checkout message
|
20 |
-
*/
|
21 |
-
const MESSAGE_TYPE_CHECKOUT = 0;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Array id for the price message
|
25 |
-
*/
|
26 |
-
const MESSAGE_TYPE_PRICE = 1;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Array id for the login message
|
30 |
-
*/
|
31 |
-
const MESSAGE_TYPE_LOGIN = 2;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Array containing
|
35 |
-
* - all the message config paths
|
36 |
-
* - the default message for each type
|
37 |
-
*
|
38 |
-
* @var array
|
39 |
-
*/
|
40 |
-
protected $aMessages = array(
|
41 |
-
self::MESSAGE_TYPE_CHECKOUT => array(
|
42 |
-
'config' => 'errortext',
|
43 |
-
'default' => 'Your account is not allowed to access this store.'
|
44 |
-
),
|
45 |
-
self::MESSAGE_TYPE_PRICE => array(
|
46 |
-
'config' => 'logintext',
|
47 |
-
'default' => 'Please login'
|
48 |
-
),
|
49 |
-
self::MESSAGE_TYPE_LOGIN => array(
|
50 |
-
'config' => 'requireloginmessage',
|
51 |
-
'default' => 'You do not have access to view this store.'
|
52 |
-
)
|
53 |
-
);
|
54 |
-
|
55 |
-
/**
|
56 |
-
* The getMessage function will for a given message type
|
57 |
-
* - check if the language override flag has been set via the admin config
|
58 |
-
* - if override is set it will load the message from the admin config
|
59 |
-
* - else it will load and translate the default message from the $_aMessages array
|
60 |
-
*
|
61 |
-
* @param int $iMessageType
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public function getMessage($iMessageType) {
|
65 |
-
if (Mage::getStoreConfigFlag(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . Sitewards_B2BProfessional_Helper_Core::CONFIG_LANGUAGE_SETTINGS_NODE . '/languageoverride')) {
|
66 |
-
$sMessage = Mage::getStoreConfig(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . Sitewards_B2BProfessional_Helper_Core::CONFIG_LANGUAGE_SETTINGS_NODE . '/' . $this->aMessages[$iMessageType]['config']);
|
67 |
-
} else {
|
68 |
-
$sMessage = $this->__($this->aMessages[$iMessageType]['default']);
|
69 |
-
}
|
70 |
-
return $sMessage;
|
71 |
-
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Helper/Redirects.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Class Sitewards_B2BProfessional_Helper_Redirects
|
4 |
* - contains each redirect type config path as constant
|
@@ -6,34 +7,123 @@
|
|
6 |
*
|
7 |
* @category Sitewards
|
8 |
* @package Sitewards_B2BProfessional
|
9 |
-
* @copyright Copyright (c)
|
10 |
*/
|
11 |
-
class Sitewards_B2BProfessional_Helper_Redirects extends
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Class Sitewards_B2BProfessional_Helper_Redirects
|
5 |
* - contains each redirect type config path as constant
|
7 |
*
|
8 |
* @category Sitewards
|
9 |
* @package Sitewards_B2BProfessional
|
10 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
11 |
*/
|
12 |
+
class Sitewards_B2BProfessional_Helper_Redirects extends Sitewards_B2BProfessional_Helper_Core
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* String containing the configuration path for the login redirect
|
16 |
+
*/
|
17 |
+
const REDIRECT_TYPE_LOGIN = 'b2bprofessional/requirelogin/requireloginredirect';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The getRedirect function will for a given redirect configuration path
|
21 |
+
* - load the value for the given configuration path
|
22 |
+
* - return a formatted url based on this value
|
23 |
+
*
|
24 |
+
* @param string $sConfigPath
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getRedirect($sConfigPath)
|
28 |
+
{
|
29 |
+
$sRedirectPath = '/';
|
30 |
+
$sConfigVar = Mage::getStoreConfig($sConfigPath);
|
31 |
+
if (isset($sConfigVar)) {
|
32 |
+
$sRedirectPath = $sConfigVar;
|
33 |
+
}
|
34 |
+
return Mage::getUrl($sRedirectPath);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* From a given controller check to see if we need to redirect the user
|
39 |
+
* - Cms related for cms pages,
|
40 |
+
* - A front action to allow for admin pages,
|
41 |
+
* - Customer account to allow for login
|
42 |
+
* - Magento API to allow api requests
|
43 |
+
*
|
44 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
45 |
+
* @return bool
|
46 |
+
*/
|
47 |
+
protected function isRedirectRequired($oControllerAction)
|
48 |
+
{
|
49 |
+
$bIsCmsController = $this->isCmsController($oControllerAction);
|
50 |
+
$bIsFrontController = $this->isFrontController($oControllerAction);
|
51 |
+
$bIsApiController = $this->isApiController($oControllerAction);
|
52 |
+
$bIsCustomerController = $this->isCustomerController($oControllerAction);
|
53 |
+
|
54 |
+
return !$bIsCmsController && $bIsFrontController && !$bIsCustomerController && !$bIsApiController;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Check to see if the controller is a customer controller
|
59 |
+
*
|
60 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
61 |
+
* @return bool
|
62 |
+
*/
|
63 |
+
protected function isCustomerController($oControllerAction)
|
64 |
+
{
|
65 |
+
return $oControllerAction instanceof Mage_Customer_AccountController;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Check to see if the controller is an api controller
|
70 |
+
*
|
71 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
72 |
+
* @return bool
|
73 |
+
*/
|
74 |
+
protected function isApiController($oControllerAction)
|
75 |
+
{
|
76 |
+
return $oControllerAction instanceof Mage_Api_Controller_Action;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Check to see if the controller is a front controller
|
81 |
+
*
|
82 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
83 |
+
* @return bool
|
84 |
+
*/
|
85 |
+
protected function isFrontController($oControllerAction)
|
86 |
+
{
|
87 |
+
return $oControllerAction instanceof Mage_Core_Controller_Front_Action;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check to see if the controller is a cms controller
|
92 |
+
*
|
93 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
protected function isCmsController($oControllerAction)
|
97 |
+
{
|
98 |
+
return $oControllerAction instanceof Mage_Cms_IndexController
|
99 |
+
|| $oControllerAction instanceof Mage_Cms_PageController;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Set-up the redirect to the customer login page
|
104 |
+
*
|
105 |
+
* @param Mage_Core_Controller_Front_Action $oControllerAction
|
106 |
+
*/
|
107 |
+
public function performRedirect($oControllerAction)
|
108 |
+
{
|
109 |
+
if ($this->isRedirectRequired($oControllerAction)) {
|
110 |
+
/* @var $oResponse Mage_Core_Controller_Response_Http */
|
111 |
+
$oResponse = $oControllerAction->getResponse();
|
112 |
+
$oResponse->setRedirect(
|
113 |
+
$this->getRedirect(
|
114 |
+
self::REDIRECT_TYPE_LOGIN
|
115 |
+
)
|
116 |
+
);
|
117 |
+
|
118 |
+
/*
|
119 |
+
* Add message to the session
|
120 |
+
* - Note:
|
121 |
+
* We need session_write_close otherwise the messages get lots in redirect
|
122 |
+
*/
|
123 |
+
/* @var $oSession Mage_Core_Model_Session */
|
124 |
+
$oSession = Mage::getSingleton('core/session');
|
125 |
+
$oSession->addNotice(Mage::helper('sitewards_b2bprofessional')->__('Please login'));
|
126 |
+
session_write_close();
|
127 |
+
}
|
128 |
+
}
|
129 |
}
|
app/code/community/Sitewards/B2BProfessional/Helper/Replacements.php
DELETED
@@ -1,274 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Class Sitewards_B2BProfessional_Helper_Replacements
|
4 |
-
* - contains the replacement pattern regular expression
|
5 |
-
* - function to get add to cart replacement string
|
6 |
-
* - function to check if product needs add to cart button replaced
|
7 |
-
* - functions to replace given sections
|
8 |
-
*
|
9 |
-
* @category Sitewards
|
10 |
-
* @package Sitewards_B2BProfessional
|
11 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
12 |
-
*/
|
13 |
-
class Sitewards_B2BProfessional_Helper_Replacements extends Mage_Core_Helper_Abstract {
|
14 |
-
/**
|
15 |
-
* Regular expression for replacements
|
16 |
-
*/
|
17 |
-
const PATTERN_BASE = '@<%1$s [^>]*?%2$s="[^"]*?%3$s[^"]*?"[^>]*?>.*?</%1$s>@siu';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Object for the main sitewards b2bprofessional helper
|
21 |
-
*
|
22 |
-
* @var Sitewards_B2BProfessional_Helper_Data
|
23 |
-
*/
|
24 |
-
protected $oB2BHelper;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Create an instance of the main sitewards b2bprofessional helper
|
28 |
-
*/
|
29 |
-
public function __construct() {
|
30 |
-
$this->oB2BHelper = Mage::helper('b2bprofessional');
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Get the replacement text for the add to cart url
|
35 |
-
*
|
36 |
-
* @return string
|
37 |
-
*/
|
38 |
-
public function getReplaceAddToCartUrl() {
|
39 |
-
return Mage::getStoreConfig(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/add_to_cart/value');
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Check if the add to cart button should be replace
|
44 |
-
* - if so return the new url
|
45 |
-
* - else return the normal url
|
46 |
-
*
|
47 |
-
* @param int $iProductId
|
48 |
-
* @param string $sNormalAddToCartUrl
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public function replaceAddToCart($iProductId, $sNormalAddToCartUrl) {
|
52 |
-
if ($this->isAddToCartToBeReplaced($iProductId)) {
|
53 |
-
return $this->getReplaceAddToCartUrl();
|
54 |
-
} else {
|
55 |
-
return $sNormalAddToCartUrl;
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Check to see if the add to cart button should be replaced
|
61 |
-
*
|
62 |
-
* @param int $iProductId
|
63 |
-
* @return bool
|
64 |
-
*/
|
65 |
-
public function isAddToCartToBeReplaced($iProductId) {
|
66 |
-
return (bool) $this->oB2BHelper->isProductActive($iProductId) && $this->replaceSection('add_to_cart');
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Build two arrays,
|
71 |
-
* - one for patterns
|
72 |
-
* - one for replacements,
|
73 |
-
* Using these two array call to replace the patterns when the cart is invalid
|
74 |
-
*
|
75 |
-
* @param array $aSections
|
76 |
-
* @param string $sHtml
|
77 |
-
* @return string
|
78 |
-
*/
|
79 |
-
public function replaceSections($aSections, $sHtml) {
|
80 |
-
$aPatterns = array();
|
81 |
-
$aReplacements = array();
|
82 |
-
/*
|
83 |
-
* Foreach section to replace
|
84 |
-
* - add the pattern
|
85 |
-
* - add the replacement
|
86 |
-
*/
|
87 |
-
$bReplaceOnInvalidCart = false;
|
88 |
-
foreach($aSections as $sReplaceSection) {
|
89 |
-
if($this->replaceSection($sReplaceSection)) {
|
90 |
-
$aPatterns[] = $this->getPattern($sReplaceSection);
|
91 |
-
$aReplacements[] = $this->getReplacement($sReplaceSection);
|
92 |
-
if($this->checkInvalidCart($sReplaceSection)) {
|
93 |
-
$bReplaceOnInvalidCart = true;
|
94 |
-
}
|
95 |
-
}
|
96 |
-
}
|
97 |
-
if($bReplaceOnInvalidCart == true) {
|
98 |
-
return $this->replaceOnInvalidCart($aPatterns, $aReplacements, $sHtml);
|
99 |
-
} else {
|
100 |
-
return $this->replaceOnIsActive($aPatterns, $aReplacements, $sHtml);
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Build two arrays,
|
106 |
-
* - one for patterns
|
107 |
-
* - one for replacements,
|
108 |
-
* Using these two array call to replace the patterns when the cart is invalid
|
109 |
-
*
|
110 |
-
* @param array $aSections
|
111 |
-
* @param string $sHtml
|
112 |
-
* @param int $iProductId
|
113 |
-
* @return string
|
114 |
-
*/
|
115 |
-
public function replaceSectionsByProductId($aSections, $sHtml, $iProductId) {
|
116 |
-
$aPatterns = array();
|
117 |
-
$aReplacements = array();
|
118 |
-
/*
|
119 |
-
* Foreach section to replace
|
120 |
-
* - add the pattern
|
121 |
-
* - add the replacement
|
122 |
-
*/
|
123 |
-
foreach($aSections as $sReplaceSection) {
|
124 |
-
if($this->replaceSection($sReplaceSection)) {
|
125 |
-
$aPatterns[] = $this->getPattern($sReplaceSection);
|
126 |
-
$aReplacements[] = $this->getReplacement($sReplaceSection);
|
127 |
-
}
|
128 |
-
}
|
129 |
-
return $this->replaceOnInvalidCartByProductId($aPatterns, $aReplacements, $sHtml, $iProductId);
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Check if a given config section should be replaced
|
134 |
-
*
|
135 |
-
* @param string $sConfigSection
|
136 |
-
* @return bool
|
137 |
-
*/
|
138 |
-
public function replaceSection($sConfigSection) {
|
139 |
-
return Mage::getStoreConfigFlag(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . $sConfigSection . '/replace');
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* From a given config section
|
144 |
-
* - Load all the config
|
145 |
-
* - remove unused sections
|
146 |
-
* - perform a sprintf on given config items
|
147 |
-
*
|
148 |
-
* @param string $sConfigSection
|
149 |
-
* @return string
|
150 |
-
*/
|
151 |
-
private function getPattern($sConfigSection) {
|
152 |
-
// Load config array and unset unused information
|
153 |
-
$aSectionConfig = Mage::getStoreConfig(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . $sConfigSection);
|
154 |
-
unset($aSectionConfig['replace']);
|
155 |
-
unset($aSectionConfig['remove']);
|
156 |
-
|
157 |
-
// Replace the tag, id and value sections of the regular expression
|
158 |
-
return sprintf(self::PATTERN_BASE, $aSectionConfig['tag'], $aSectionConfig['id'], $aSectionConfig['value']);
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Get replacement text for a given config section
|
163 |
-
*
|
164 |
-
* @param string $sConfigSection
|
165 |
-
* @return string
|
166 |
-
*/
|
167 |
-
private function getReplacement($sConfigSection) {
|
168 |
-
// Check for the remove flag
|
169 |
-
if(!Mage::getStoreConfigFlag(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . $sConfigSection . '/remove')) {
|
170 |
-
// If the remove flag is not set then get the module's price message
|
171 |
-
/* @var $oB2BMessagesHelper Sitewards_B2BProfessional_Helper_Messages */
|
172 |
-
$oB2BMessagesHelper = Mage::helper('b2bprofessional/messages');
|
173 |
-
return $oB2BMessagesHelper->getMessage($oB2BMessagesHelper::MESSAGE_TYPE_PRICE);
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Check if a given config section should check if the cart is valid
|
179 |
-
*
|
180 |
-
* @param string $sConfigSection
|
181 |
-
* @return bool
|
182 |
-
*/
|
183 |
-
private function checkInvalidCart($sConfigSection) {
|
184 |
-
return Mage::getStoreConfigFlag(Sitewards_B2BProfessional_Helper_Core::CONFIG_B2B_PROFESSIONAL_NODE . '/' . $sConfigSection . '/check_cart');
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* When we have an invalid cart
|
189 |
-
* - Perform a preg_replace with a given set of patterns and replacements on a string
|
190 |
-
* - When product id is given check for valid product
|
191 |
-
* - When no product id is given then check to complete cart
|
192 |
-
*
|
193 |
-
* @param array $aPatterns
|
194 |
-
* @param array $aReplacements
|
195 |
-
* @param string $sBlockHtml
|
196 |
-
* @return string
|
197 |
-
*/
|
198 |
-
private function replaceOnInvalidCart($aPatterns, $aReplacements, $sBlockHtml) {
|
199 |
-
/*
|
200 |
-
* If you have no product id provided and an invalid cart
|
201 |
-
*
|
202 |
-
* THEN
|
203 |
-
* Perform the preg_replace
|
204 |
-
*/
|
205 |
-
if (
|
206 |
-
!$this->oB2BHelper->hasValidCart()
|
207 |
-
) {
|
208 |
-
$sBlockHtml = $this->getNewBlockHtml($aPatterns, $aReplacements, $sBlockHtml);
|
209 |
-
}
|
210 |
-
return $sBlockHtml;
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* When we have an invalid user
|
215 |
-
* - Perform a preg_replace with a given set of patterns and replacements on a string
|
216 |
-
* - Use only global isActive
|
217 |
-
*
|
218 |
-
* @param array $aPatterns
|
219 |
-
* @param array $aReplacements
|
220 |
-
* @param string $sBlockHtml
|
221 |
-
* @return string
|
222 |
-
*/
|
223 |
-
private function replaceOnIsActive($aPatterns, $aReplacements, $sBlockHtml) {
|
224 |
-
if (
|
225 |
-
$this->oB2BHelper->isActive()
|
226 |
-
) {
|
227 |
-
$sBlockHtml = $this->getNewBlockHtml($aPatterns, $aReplacements, $sBlockHtml);
|
228 |
-
}
|
229 |
-
return $sBlockHtml;
|
230 |
-
}
|
231 |
-
|
232 |
-
/**
|
233 |
-
* When we have an invalid cart
|
234 |
-
* - Perform a preg_replace with a given set of patterns and replacements on a string
|
235 |
-
* - When product id is given check for valid product
|
236 |
-
* - When no product id is given then check to complete cart
|
237 |
-
*
|
238 |
-
* @param array $aPatterns
|
239 |
-
* @param array $aReplacements
|
240 |
-
* @param string $sBlockHtml
|
241 |
-
* @param int $iProductId
|
242 |
-
* @return string
|
243 |
-
*/
|
244 |
-
private function replaceOnInvalidCartByProductId($aPatterns, $aReplacements, $sBlockHtml, $iProductId) {
|
245 |
-
/*
|
246 |
-
* If you have a product id provided and it is invalid
|
247 |
-
*
|
248 |
-
* THEN
|
249 |
-
* Perform the preg_replace
|
250 |
-
*/
|
251 |
-
if (
|
252 |
-
$this->oB2BHelper->isProductActive($iProductId)
|
253 |
-
) {
|
254 |
-
$sBlockHtml = $this->getNewBlockHtml($aPatterns, $aReplacements, $sBlockHtml);
|
255 |
-
}
|
256 |
-
return $sBlockHtml;
|
257 |
-
}
|
258 |
-
|
259 |
-
/**
|
260 |
-
* Perform a preg_replace with the pattern and replacements given
|
261 |
-
*
|
262 |
-
* @param array $aPatterns
|
263 |
-
* @param array $aReplacements
|
264 |
-
* @param string $sBlockHtml
|
265 |
-
* @return mixed
|
266 |
-
*/
|
267 |
-
private function getNewBlockHtml($aPatterns, $aReplacements, $sBlockHtml) {
|
268 |
-
return preg_replace(
|
269 |
-
$aPatterns,
|
270 |
-
$aReplacements,
|
271 |
-
$sBlockHtml
|
272 |
-
);
|
273 |
-
}
|
274 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Customer.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Model_Customer
|
4 |
-
* - Authenticate the user and display correct message
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_Customer extends Mage_Customer_Model_Customer {
|
11 |
-
const XML_PATH_DISTRIBUTOR_EMAIL_TEMPLATE = 'customer/create_account/email_distributor_template';
|
12 |
-
const EXCEPTION_CUSTOMER_NOT_ACTIVATED = 996;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Authenticate customer,
|
16 |
-
* - Check they have been confirmed,
|
17 |
-
* - Validate password,
|
18 |
-
* - If customer is not active,
|
19 |
-
* - Throw correct exception or add system message,
|
20 |
-
*
|
21 |
-
* @param string $sLoginEmail
|
22 |
-
* @param string $sLoginPassword
|
23 |
-
* @return true
|
24 |
-
* @throws Exception
|
25 |
-
* - Customer is not confirmed and confirmation is required,
|
26 |
-
* - When password is not valid,
|
27 |
-
* - If customer is not active and the action name is not 'createpost'
|
28 |
-
*/
|
29 |
-
public function authenticate($sLoginEmail, $sLoginPassword) {
|
30 |
-
/* @var $oCustomerHelper Mage_Customer_Helper_Data */
|
31 |
-
$oCustomerHelper = Mage::helper('customer');
|
32 |
-
$this->loadByEmail($sLoginEmail);
|
33 |
-
if ($this->getConfirmation() && $this->isConfirmationRequired()) {
|
34 |
-
throw new Exception($oCustomerHelper->__('This account is not confirmed.'), self::EXCEPTION_EMAIL_NOT_CONFIRMED );
|
35 |
-
}
|
36 |
-
if (!$this->validatePassword($sLoginPassword)) {
|
37 |
-
throw new Exception($oCustomerHelper->__('Invalid login or password.'), self::EXCEPTION_INVALID_EMAIL_OR_PASSWORD );
|
38 |
-
}
|
39 |
-
|
40 |
-
if (!$this->getData('customer_activated')) {
|
41 |
-
if (Mage::app()->getRequest()->getActionName() == 'createpost') {
|
42 |
-
/* @var $oSession Mage_Core_Model_Session */
|
43 |
-
$oSession = Mage::getSingleton('core/session');
|
44 |
-
$oSession->addSuccess($oCustomerHelper->__('Please wait for your account to be activated'));
|
45 |
-
} else {
|
46 |
-
throw new Exception ($oCustomerHelper->__ ('This account is not activated.'), self::EXCEPTION_CUSTOMER_NOT_ACTIVATED );
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
Mage::dispatchEvent('customer_customer_authenticated', array(
|
51 |
-
'model' => $this,
|
52 |
-
'password' => $sLoginPassword
|
53 |
-
));
|
54 |
-
|
55 |
-
return true;
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Observer.php
CHANGED
@@ -1,477 +1,271 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Sitewards_B2BProfessional_Model_Observer
|
4 |
-
*
|
|
|
|
|
|
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c)
|
9 |
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_Observer
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
/**
|
19 |
-
* blocks which display prices
|
20 |
-
*
|
21 |
-
* @var array
|
22 |
-
*/
|
23 |
-
protected $aPriceBlockClassNames = array(
|
24 |
-
'Mage_Catalog_Block_Product_Price' => 1,
|
25 |
-
'Mage_Bundle_Block_Catalog_Product_Price' => 1,
|
26 |
-
);
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Check if the site requires login to work
|
30 |
-
* - Add notice,
|
31 |
-
* - Redirect to the home page,
|
32 |
-
*
|
33 |
-
* @param Varien_Event_Observer $oObserver
|
34 |
-
*/
|
35 |
-
public function onControllerActionPreDispatch(Varien_Event_Observer $oObserver) {
|
36 |
-
/* @var $oHelper Sitewards_B2BProfessional_Helper_Data */
|
37 |
-
$oHelper = Mage::helper('b2bprofessional');
|
38 |
-
if($oHelper->isExtensionActive() == true) {
|
39 |
-
/* @var $oControllerAction Mage_Core_Controller_Front_Action */
|
40 |
-
$oControllerAction = $oObserver->getData('controller_action');
|
41 |
-
|
42 |
-
/* @var $oB2BMessagesHelper Sitewards_B2BProfessional_Helper_Messages */
|
43 |
-
$oB2BMessagesHelper = Mage::helper('b2bprofessional/messages');
|
44 |
-
/* @var $oB2BCustomerHelper Sitewards_B2BProfessional_Helper_Customer */
|
45 |
-
$oB2BCustomerHelper = Mage::helper('b2bprofessional/customer');
|
46 |
-
|
47 |
-
/*
|
48 |
-
* Check to see if the system requires a login
|
49 |
-
* And there is no logged in user
|
50 |
-
*/
|
51 |
-
if($oB2BCustomerHelper->isLoginRequired() == true && !Mage::getSingleton('customer/session')->isLoggedIn()) {
|
52 |
-
/*
|
53 |
-
* Check to see if the controller is:
|
54 |
-
* 1) Cms related for cms pages,
|
55 |
-
* 2) A front action to allow for admin pages,
|
56 |
-
* 3) Customer account to allow for login
|
57 |
-
* 4) Magento API to allow api requests
|
58 |
-
*/
|
59 |
-
if(
|
60 |
-
!$oControllerAction instanceof Mage_Cms_IndexController
|
61 |
-
&&
|
62 |
-
!$oControllerAction instanceof Mage_Cms_PageController
|
63 |
-
&&
|
64 |
-
$oControllerAction instanceof Mage_Core_Controller_Front_Action
|
65 |
-
&&
|
66 |
-
!$oControllerAction instanceof Mage_Customer_AccountController
|
67 |
-
&&
|
68 |
-
!$oControllerAction instanceof Mage_Api_Controller_Action
|
69 |
-
){
|
70 |
-
// Redirect to the homepage
|
71 |
-
/* @var $oResponse Mage_Core_Controller_Response_Http */
|
72 |
-
$oResponse = $oControllerAction->getResponse();
|
73 |
-
$oResponse->setRedirect(Sitewards_B2BProfessional_Helper_Redirects::getRedirect(Sitewards_B2BProfessional_Helper_Redirects::REDIRECT_TYPE_LOGIN));
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
* - if not redirect the user to the account section and display message
|
89 |
-
*/
|
90 |
-
} elseif(
|
91 |
-
$oControllerAction instanceof Mage_Checkout_MultishippingController
|
92 |
-
||
|
93 |
-
$oControllerAction instanceof Mage_Checkout_OnepageController
|
94 |
-
) {
|
95 |
-
if (!$oHelper->hasValidCart()) {
|
96 |
-
// Stop the default action from being dispatched
|
97 |
-
$oControllerAction->setFlag('', 'no-dispatch', true);
|
98 |
-
//Set the appropriate error message to the user session
|
99 |
-
Mage::getSingleton('customer/session')->addError($oB2BMessagesHelper->getMessage($oB2BMessagesHelper::MESSAGE_TYPE_CHECKOUT));
|
100 |
-
//Redirect to the account login url
|
101 |
-
Mage::app()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'))->sendHeaders();
|
102 |
-
}
|
103 |
-
/*
|
104 |
-
* On Cart action
|
105 |
-
* - validate that the cart is valid
|
106 |
-
* - add message to the checkout session
|
107 |
-
*/
|
108 |
-
} elseif($oControllerAction instanceof Mage_Checkout_CartController) {
|
109 |
-
if (!$oHelper->hasValidCart()) {
|
110 |
-
Mage::getSingleton('checkout/session')->addError($oB2BMessagesHelper->getMessage($oB2BMessagesHelper::MESSAGE_TYPE_CHECKOUT));
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
*/
|
122 |
-
protected function isExactlyPriceBlock($oBlock)
|
123 |
-
{
|
124 |
-
return ($oBlock && isset($this->aPriceBlockClassNames[get_class($oBlock)]));
|
125 |
-
}
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
$oB2BReplacementsHelper = Mage::helper('b2bprofessional/replacements');
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
|
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
/*
|
171 |
-
* Check to see if we should remove the add to cart button on the product page
|
172 |
-
*/
|
173 |
-
} elseif(
|
174 |
-
$oBlock instanceof Mage_Catalog_Block_Product_View
|
175 |
-
&&
|
176 |
-
$oBlock->getNameInLayout() == 'product.info.addtocart'
|
177 |
-
) {
|
178 |
-
$iCurrentProductId = $oBlock->getProduct()->getId();
|
179 |
-
if ($oB2BReplacementsHelper->isAddToCartToBeReplaced($iCurrentProductId)) {
|
180 |
-
$oTransport->setHtml('');
|
181 |
-
}
|
182 |
-
/*
|
183 |
-
* Check to see if we should remove the add to cart button on the wishlist item
|
184 |
-
*/
|
185 |
-
} elseif (
|
186 |
-
$oBlock instanceof Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Cart
|
187 |
-
) {
|
188 |
-
$iCurrentProductId = $oBlock->getItem()->getProduct()->getId();
|
189 |
-
if ($oB2BReplacementsHelper->isAddToCartToBeReplaced($iCurrentProductId)) {
|
190 |
-
$oTransport->setHtml($oB2BMessagesHelper->getMessage($oB2BMessagesHelper::MESSAGE_TYPE_PRICE));
|
191 |
-
}
|
192 |
-
/*
|
193 |
-
* Check to see if we should remove totals and actions from the cart
|
194 |
-
*/
|
195 |
-
} elseif(
|
196 |
-
$oBlock instanceof Mage_Checkout_Block_Cart_Totals
|
197 |
-
||
|
198 |
-
$oBlock instanceof Mage_Checkout_Block_Onepage_Link
|
199 |
-
||
|
200 |
-
$oBlock instanceof Mage_Checkout_Block_Multishipping_Link
|
201 |
-
) {
|
202 |
-
/*
|
203 |
-
* If the current cart is not valid
|
204 |
-
* - remove the block html
|
205 |
-
*/
|
206 |
-
if (!$oB2BHelper->hasValidCart()) {
|
207 |
-
$oTransport->setHtml('');
|
208 |
-
}
|
209 |
-
/*
|
210 |
-
* Check to see if we should replace totals and actions from the cart sidebar
|
211 |
-
*/
|
212 |
-
} elseif (
|
213 |
-
$oBlock instanceof Mage_Checkout_Block_Cart_Sidebar
|
214 |
-
) {
|
215 |
-
$aSections = array(
|
216 |
-
'cart_sidebar_totals',
|
217 |
-
'cart_sidebar_actions'
|
218 |
-
);
|
219 |
-
$sOriginalHtml = $oB2BReplacementsHelper->replaceSections($aSections, $oTransport->getHtml());
|
220 |
-
$oTransport->setHtml($sOriginalHtml);
|
221 |
-
/*
|
222 |
-
* Check to see if we should replace item price from the cart
|
223 |
-
*/
|
224 |
-
} elseif (
|
225 |
-
$oBlock instanceof Mage_Checkout_Block_Cart_Item_Renderer
|
226 |
-
) {
|
227 |
-
$iProductId = $oBlock->getItem()->getProductId();
|
228 |
-
$aSections = array(
|
229 |
-
'cart_item_price'
|
230 |
-
);
|
231 |
-
$sOriginalHtml = $oB2BReplacementsHelper->replaceSectionsByProductId($aSections, $oTransport->getHtml(), $iProductId);
|
232 |
-
$oTransport->setHtml($sOriginalHtml);
|
233 |
-
/*
|
234 |
-
* Check to see if we should replace the add to cart button on product blocks
|
235 |
-
*/
|
236 |
-
} elseif (
|
237 |
-
$oBlock instanceof Mage_Catalog_Block_Product_Abstract
|
238 |
-
||
|
239 |
-
$oBlock instanceof Mage_Catalog_Block_Product_Compare_Abstract
|
240 |
-
) {
|
241 |
-
$aSections = array(
|
242 |
-
'add_to_cart'
|
243 |
-
);
|
244 |
-
// Check for the block's product so we can filter on product id
|
245 |
-
$oCurrentProduct = $oBlock->getProduct();
|
246 |
-
if(!is_null($oCurrentProduct)) {
|
247 |
-
$iCurrentProductId = $oBlock->getProduct()->getId();
|
248 |
-
$sOriginalHtml = $oB2BReplacementsHelper->replaceSectionsByProductId($aSections, $oTransport->getHtml(), $iCurrentProductId);
|
249 |
-
} else {
|
250 |
-
$sOriginalHtml = $oB2BReplacementsHelper->replaceSections($aSections, $oTransport->getHtml());
|
251 |
-
}
|
252 |
-
$oTransport->setHtml($sOriginalHtml);
|
253 |
-
}
|
254 |
-
}
|
255 |
|
256 |
-
|
257 |
-
|
258 |
-
* - Check extension is active
|
259 |
-
* - Check for the block type Mage_Catalog_Block_Product_List_Toolbar
|
260 |
-
* - Remove the price order
|
261 |
-
* - Check for the block type Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox
|
262 |
-
* - Check for the block type Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi
|
263 |
-
* - Check for the block type Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio
|
264 |
-
* - Check for the block type Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select
|
265 |
-
* - Rewrite bundle options price templates
|
266 |
-
*
|
267 |
-
* @param Varien_Event_Observer $oObserver
|
268 |
-
*/
|
269 |
-
public function onCoreBlockAbstractToHtmlBefore(Varien_Event_Observer $oObserver) {
|
270 |
-
$oBlock = $oObserver->getData('block');
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
if (Mage::helper('b2bprofessional')->isExtensionActive()) {
|
282 |
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
if ($oBlock instanceof Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox) {
|
295 |
-
$oBlock->setTemplate('sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/checkbox.phtml');
|
296 |
-
} else if ($oBlock instanceof Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi) {
|
297 |
-
$oBlock->setTemplate('sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/multi.phtml');
|
298 |
-
} else if ($oBlock instanceof Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio) {
|
299 |
-
$oBlock->setTemplate('sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/radio.phtml');
|
300 |
-
} else if ($oBlock instanceof Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select) {
|
301 |
-
$oBlock->setTemplate('sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/select.phtml');
|
302 |
-
}
|
303 |
-
}
|
304 |
-
}
|
305 |
-
}
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
*/
|
313 |
-
public function onCatalogProductTypeConfigurablePrice(Varien_Event_Observer $oObserver) {
|
314 |
-
$oProduct = $oObserver->getData('product');
|
315 |
-
/* @var $oB2BHelper Sitewards_B2BProfessional_Helper_Data */
|
316 |
-
$oB2BHelper = Mage::helper('b2bprofessional');
|
317 |
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
public function onCoreLayoutBlockCreateAfter(Varien_Event_Observer $oObserver) {
|
330 |
-
$oBlock = $oObserver->getData('block');
|
331 |
-
if($oBlock instanceof Mage_Catalog_Block_Layer_View) {
|
332 |
-
/* @var $oB2BHelper Sitewards_B2BProfessional_Helper_Data */
|
333 |
-
$oB2BHelper = Mage::helper('b2bprofessional');
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
/* @var $oCategory Mage_Catalog_Model_Layer_Filter_Item */
|
347 |
-
$iCategoryId = $oCategory->getValue();
|
348 |
-
$aCategoryOptions[] = $iCategoryId;
|
349 |
-
}
|
350 |
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
}
|
364 |
-
}
|
365 |
-
$oBlock->setData('_filterable_attributes', $aNewFilterableAttributes);
|
366 |
-
}
|
367 |
-
}
|
368 |
-
}
|
369 |
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
$oObserver->getQuoteItem()->save();
|
382 |
-
}
|
383 |
-
}
|
384 |
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
$sVar = $aPost['b2bprofessional']['delivery_date'];
|
399 |
-
$oQuote->setDeliveryDate($sVar);
|
400 |
-
}
|
401 |
-
}
|
402 |
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
$oModel->setValue($sVar);
|
420 |
-
$oModel->save();
|
421 |
-
}
|
422 |
-
}
|
423 |
-
}
|
424 |
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
$oModel->deleteByOrder($oOrder->getId(), 'delivery_date');
|
454 |
-
$oModel->setOrderId($oOrder->getId());
|
455 |
-
$oModel->setKey('delivery_date');
|
456 |
-
$oModel->setValue($sVar);
|
457 |
-
$oOrder->setDeliveryDate($sVar);
|
458 |
-
$oModel->save();
|
459 |
-
}
|
460 |
-
}
|
461 |
-
}
|
462 |
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
$oOrder->setData($sKey, $sValue);
|
475 |
-
}
|
476 |
-
}
|
477 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional_Model_Observer
|
5 |
+
* - Observer containing the following event methods
|
6 |
+
* - catalog_product_is_salable_after - remove add to cart buttons,
|
7 |
+
* - catalog_product_type_prepare_full_options - stop product being added to cart via url
|
8 |
+
* - core_block_abstract_to_html_after - remove price from product pages
|
9 |
*
|
10 |
* @category Sitewards
|
11 |
* @package Sitewards_B2BProfessional
|
12 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
13 |
*/
|
14 |
+
class Sitewards_B2BProfessional_Model_Observer
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* The last product Id
|
18 |
+
*
|
19 |
+
* @var int
|
20 |
+
*/
|
21 |
+
protected static $iLastProductId = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
/**
|
24 |
+
* Check to see if a product can be sold to the current logged in user
|
25 |
+
* - if the flag of salable is already false then we should do nothing
|
26 |
+
*
|
27 |
+
* @param Varien_Event_Observer $oObserver
|
28 |
+
*/
|
29 |
+
public function catalogProductIsSalableAfter(Varien_Event_Observer $oObserver)
|
30 |
+
{
|
31 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
32 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
33 |
+
if ($oB2BHelper->isExtensionActive() === true) {
|
34 |
+
$oProduct = $oObserver->getEvent()->getProduct();
|
35 |
+
$oSalable = $oObserver->getEvent()->getSalable();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
if ($oSalable->getIsSalable() == true) {
|
38 |
+
$oSalable->setIsSalable($oB2BHelper->isProductActive($oProduct));
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
/**
|
44 |
+
* Check to see if the product being added to the cart can be bought
|
45 |
+
*
|
46 |
+
* @param Varien_Event_Observer $oObserver
|
47 |
+
* @throws Mage_Catalog_Exception
|
48 |
+
*/
|
49 |
+
public function catalogProductTypePrepareFullOptions(Varien_Event_Observer $oObserver)
|
50 |
+
{
|
51 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
52 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
53 |
+
if ($oB2BHelper->isExtensionActive() === true) {
|
54 |
+
$oProduct = $oObserver->getEvent()->getProduct();
|
55 |
|
56 |
+
if ($oB2BHelper->isProductActive($oProduct) === false) {
|
57 |
+
throw new Mage_Catalog_Exception($oB2BHelper->__('Your account is not allowed to access this store.'));
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
|
|
61 |
|
62 |
+
/**
|
63 |
+
* Replace the price information with the desired message
|
64 |
+
*
|
65 |
+
* @param Varien_Event_Observer $oObserver
|
66 |
+
*/
|
67 |
+
public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $oObserver)
|
68 |
+
{
|
69 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
70 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
71 |
+
if ($oB2BHelper->isExtensionActive() === true) {
|
72 |
+
$oBlock = $oObserver->getData('block');
|
73 |
+
$oTransport = $oObserver->getData('transport');
|
74 |
|
75 |
+
/*
|
76 |
+
* Check to see if we should remove the product price
|
77 |
+
*/
|
78 |
+
if ($this->isExactlyPriceBlock($oBlock)) {
|
79 |
+
$this->transformPriceBlock($oBlock, $oTransport);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
|
84 |
+
/**
|
85 |
+
* Check to see if the user will need to be redirected to the login page or another saved via the admin
|
86 |
+
*
|
87 |
+
* @param Varien_Event_Observer $oObserver
|
88 |
+
*/
|
89 |
+
public function controllerActionPredispatch(Varien_Event_Observer $oObserver)
|
90 |
+
{
|
91 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
92 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
93 |
+
if ($oB2BHelper->isExtensionActive() === true) {
|
94 |
+
/* @var $oControllerAction Mage_Core_Controller_Front_Action */
|
95 |
+
$oControllerAction = $oObserver->getData('controller_action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
/* @var $oB2BCustomerHelper Sitewards_B2BProfessional_Helper_Customer */
|
98 |
+
$oB2BCustomerHelper = Mage::helper('sitewards_b2bprofessional/customer');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
/*
|
101 |
+
* Check to see if the system requires a login
|
102 |
+
* And there is no logged in user
|
103 |
+
*/
|
104 |
+
if ($oB2BCustomerHelper->isLoginRequired() == true && !$oB2BCustomerHelper->isCustomerLoggedIn()) {
|
105 |
+
Mage::helper('sitewards_b2bprofessional/redirects')->performRedirect($oControllerAction);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
|
|
109 |
|
110 |
+
/**
|
111 |
+
* Remove the price option from the order by options
|
112 |
+
*
|
113 |
+
* @param Varien_Event_Observer $oObserver
|
114 |
+
*/
|
115 |
+
public function coreBlockAbstractToHtmlBefore(Varien_Event_Observer $oObserver)
|
116 |
+
{
|
117 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
118 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
119 |
+
if ($oB2BHelper->isExtensionActive() === true) {
|
120 |
+
$oBlock = $oObserver->getData('block');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
+
if ($oBlock instanceof Mage_Catalog_Block_Product_List_Toolbar) {
|
123 |
+
$oBlock->removeOrderFromAvailableOrders('price');
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
+
/**
|
129 |
+
* If we have a Mage_Catalog_Block_Layer_View
|
130 |
+
* - remove the price attribute
|
131 |
+
*
|
132 |
+
* @param Varien_Event_Observer $oObserver
|
133 |
+
*/
|
134 |
+
public function coreLayoutBlockCreateAfter(Varien_Event_Observer $oObserver)
|
135 |
+
{
|
136 |
+
/* @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
137 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
138 |
+
if ($oB2BHelper->isExtensionActive()) {
|
139 |
+
$oBlock = $oObserver->getData('block');
|
140 |
+
if ($oBlock instanceof Mage_Catalog_Block_Layer_View) {
|
141 |
+
$aCategoryOptions = $this->getCategoryFilters($oBlock);
|
142 |
|
143 |
+
if ($oB2BHelper->hasEnabledCategories($aCategoryOptions)) {
|
144 |
+
$this->removePriceFilter($oBlock);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
+
/**
|
151 |
+
* checks if the block represents a price block
|
152 |
+
*
|
153 |
+
* @param Mage_Core_Block_Abstract $oBlock
|
154 |
+
* @return bool
|
155 |
+
*/
|
156 |
+
protected function isExactlyPriceBlock($oBlock)
|
157 |
+
{
|
158 |
+
return $oBlock
|
159 |
+
&& Mage::helper('sitewards_b2bprofessional')->isBlockPriceBlock($oBlock);
|
160 |
+
}
|
|
|
|
|
|
|
|
|
161 |
|
162 |
+
/**
|
163 |
+
* From a block get all the category filters when set
|
164 |
+
*
|
165 |
+
* @param Mage_Catalog_Block_Layer_View $oBlock
|
166 |
+
* @return int[]
|
167 |
+
*/
|
168 |
+
protected function getCategoryFilters($oBlock)
|
169 |
+
{
|
170 |
+
/* @var $oCategoryFilter Mage_Catalog_Block_Layer_Filter_Category */
|
171 |
+
$oCategoryFilter = $oBlock->getChild('category_filter');
|
172 |
+
$aCategoryOptions = array();
|
173 |
+
if ($oCategoryFilter instanceof Mage_Catalog_Block_Layer_Filter_Category) {
|
174 |
+
$oCategories = $oCategoryFilter->getItems();
|
175 |
+
foreach ($oCategories as $oCategory) {
|
176 |
+
/* @var $oCategory Mage_Catalog_Model_Layer_Filter_Item */
|
177 |
+
$iCategoryId = $oCategory->getValue();
|
178 |
+
$aCategoryOptions[] = $iCategoryId;
|
179 |
+
}
|
180 |
|
181 |
+
if (empty($aCategoryOptions)) {
|
182 |
+
return $this->getDefaultCategoryOptions();
|
183 |
+
}
|
184 |
+
}
|
185 |
+
return $aCategoryOptions;
|
186 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
+
/**
|
189 |
+
* Return the default category,
|
190 |
+
* - either from the filter,
|
191 |
+
* - the current category,
|
192 |
+
* - or the root category
|
193 |
+
*
|
194 |
+
* @return int[]
|
195 |
+
*/
|
196 |
+
protected function getDefaultCategoryOptions()
|
197 |
+
{
|
198 |
+
$aCategoryOptions = array();
|
|
|
|
|
|
|
199 |
|
200 |
+
/* @var $oCategory Mage_Catalog_Model_Category */
|
201 |
+
$oCategory = Mage::registry('current_category_filter');
|
202 |
+
if ($oCategory === null) {
|
203 |
+
$oCategory = Mage::registry('current_category');
|
204 |
+
if ($oCategory === null) {
|
205 |
+
$oCategory = Mage::getModel('catalog/category')->load(
|
206 |
+
Mage::app()->getStore()->getRootCategoryId()
|
207 |
+
);
|
208 |
+
}
|
209 |
+
}
|
210 |
+
$aCategoryOptions[] = $oCategory->getId();
|
211 |
+
return $aCategoryOptions;
|
212 |
+
}
|
|
|
|
|
|
|
|
|
213 |
|
214 |
+
/**
|
215 |
+
* Remove the price filter options from the filterable attributes
|
216 |
+
*
|
217 |
+
* @param Mage_Catalog_Block_Layer_View $oBlock
|
218 |
+
*/
|
219 |
+
protected function removePriceFilter($oBlock)
|
220 |
+
{
|
221 |
+
$aFilterableAttributes = $oBlock->getData('_filterable_attributes');
|
222 |
+
$aNewFilterableAttributes = array();
|
223 |
+
foreach ($aFilterableAttributes as $oFilterableAttribute) {
|
224 |
+
if ($oFilterableAttribute->getAttributeCode() != 'price') {
|
225 |
+
$aNewFilterableAttributes[] = $oFilterableAttribute;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
$oBlock->setData('_filterable_attributes', $aNewFilterableAttributes);
|
229 |
+
}
|
|
|
|
|
|
|
|
|
|
|
230 |
|
231 |
+
/**
|
232 |
+
* Set type id to combined to stop tax being displayed via Symmetrics_TweaksGerman_Block_Tax
|
233 |
+
*
|
234 |
+
* @param Mage_Catalog_Model_Product $oProduct
|
235 |
+
*/
|
236 |
+
protected function setSymmetricsProductType(Mage_Catalog_Model_Product $oProduct)
|
237 |
+
{
|
238 |
+
if (
|
239 |
+
Mage::helper('core')->isModuleEnabled('Symmetrics_TweaksGerman')
|
240 |
+
&& $oProduct->getTypeId() == 'bundle'
|
241 |
+
) {
|
242 |
+
$oProduct->setTypeId('combined');
|
243 |
+
}
|
244 |
+
}
|
245 |
|
246 |
+
/**
|
247 |
+
* For a given product price block check if the product is active
|
248 |
+
* - if it is active then set the price html as the default message
|
249 |
+
*
|
250 |
+
* @param Mage_Catalog_Block_Product_Price $oBlock
|
251 |
+
* @param Varien_Object $oTransport
|
252 |
+
*/
|
253 |
+
protected function transformPriceBlock($oBlock, $oTransport)
|
254 |
+
{
|
255 |
+
/** @var Sitewards_B2BProfessional_Helper_Data $oB2BHelper */
|
256 |
+
$oB2BHelper = Mage::helper('sitewards_b2bprofessional');
|
257 |
+
$oProduct = $oBlock->getProduct();
|
258 |
+
$iCurrentProductId = $oProduct->getId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
+
if ($oB2BHelper->isProductActive($oProduct) === false) {
|
261 |
+
// To stop duplicate information being displayed validate that we only do this once per product
|
262 |
+
if ($iCurrentProductId !== self::$iLastProductId) {
|
263 |
+
self::$iLastProductId = $iCurrentProductId;
|
264 |
+
$oTransport->setHtml($oB2BHelper->__('Please login'));
|
265 |
+
} else {
|
266 |
+
$oTransport->setHtml('');
|
267 |
+
}
|
268 |
+
$this->setSymmetricsProductType($oProduct);
|
269 |
+
}
|
270 |
+
}
|
|
|
|
|
|
|
271 |
}
|
app/code/community/Sitewards/B2BProfessional/Model/Order.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Sitewards_B2BProfessional_Model_Order extends Mage_Core_Model_Abstract{
|
3 |
-
public function _construct() {
|
4 |
-
parent::_construct();
|
5 |
-
$this->_init('b2bprofessional/order');
|
6 |
-
}
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @param int $iOrderId
|
10 |
-
* @param string $sKey
|
11 |
-
*/
|
12 |
-
public function deleteByOrder($iOrderId, $sKey) {
|
13 |
-
$this->_getResource()->deleteByOrder($iOrderId, $sKey);
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @param int $iOrderId
|
18 |
-
* @param string $sKey
|
19 |
-
* @return string
|
20 |
-
*/
|
21 |
-
public function getByOrder($iOrderId, $sKey = '') {
|
22 |
-
return $this->_getResource()->getByOrder($iOrderId, $sKey);
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @param int $iOrderId
|
27 |
-
* @return bool
|
28 |
-
*/
|
29 |
-
public function canCancel($iOrderId) {
|
30 |
-
/* @var $oOrder Mage_Sales_Model_Order */
|
31 |
-
$oOrder = Mage::getModel('sales/order')->load($iOrderId);
|
32 |
-
if ($oOrder->getCustomerId() == Mage::getSingleton('customer/session')->getCustomerId()) {
|
33 |
-
$sDeliveryDate = current($this->getByOrder($iOrderId, 'delivery_date'));
|
34 |
-
return (strtotime($sDeliveryDate) > now());
|
35 |
-
} else {
|
36 |
-
return false;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Quote.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Sitewards_B2BProfessional_Model_Quote extends Mage_Core_Model_Abstract {
|
3 |
-
public function _construct() {
|
4 |
-
parent::_construct();
|
5 |
-
$this->_init('b2bprofessional/quote');
|
6 |
-
}
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @param int $iQuoteId
|
10 |
-
* @param string $sKey
|
11 |
-
*/
|
12 |
-
public function deleteByQuote($iQuoteId, $sKey) {
|
13 |
-
$this->_getResource()->deleteByQuote($iQuoteId, $sKey);
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @param int $iQuoteId
|
18 |
-
* @param string $sKey
|
19 |
-
* @return string
|
20 |
-
*/
|
21 |
-
public function getByQuote($iQuoteId, $sKey = '') {
|
22 |
-
return $this->_getResource()->getByQuote($iQuoteId, $sKey);
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Resource/Order.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Sitewards_B2BProfessional_Model_Resource_Order extends Mage_Core_Model_Mysql4_Abstract {
|
3 |
-
public function _construct () {
|
4 |
-
$this->_init('b2bprofessional/order', 'id');
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param int $iOrderId
|
9 |
-
* @param string $sKey
|
10 |
-
*/
|
11 |
-
public function deleteByOrder ($iOrderId, $sKey) {
|
12 |
-
$sTable = $this->getMainTable();
|
13 |
-
$sWhere = $this->_getWriteAdapter()
|
14 |
-
->quoteInto('order_id = ? AND ', $iOrderId)
|
15 |
-
. $this->_getWriteAdapter()
|
16 |
-
->quoteInto('`key` = ?', $sKey);
|
17 |
-
$this->_getWriteAdapter()
|
18 |
-
->delete($sTable, $sWhere);
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* @param int $iOrderId
|
23 |
-
* @param string $sKey
|
24 |
-
* @return array
|
25 |
-
*/
|
26 |
-
public function getByOrder ($iOrderId, $sKey = '') {
|
27 |
-
$sTable = $this->getMainTable();
|
28 |
-
$sWhere = $this->_getReadAdapter()
|
29 |
-
->quoteInto('order_id = ?', $iOrderId);
|
30 |
-
if (!empty($sKey)) {
|
31 |
-
$sWhere .= $this->_getReadAdapter()
|
32 |
-
->quoteInto(' AND `key` = ? ', $sKey);
|
33 |
-
}
|
34 |
-
$sSql = $this->_getReadAdapter()
|
35 |
-
->select()
|
36 |
-
->from($sTable)
|
37 |
-
->where($sWhere);
|
38 |
-
$aRows = $this->_getReadAdapter()
|
39 |
-
->fetchAll($sSql);
|
40 |
-
$aReturn = array();
|
41 |
-
foreach ($aRows as $row) {
|
42 |
-
$aReturn[$row['key']] = $row['value'];
|
43 |
-
}
|
44 |
-
return $aReturn;
|
45 |
-
}
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Resource/Order/Collection.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sitewards_B2BProfessional_Model_Resource_Order_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
4 |
-
public function _construct () {
|
5 |
-
parent::_construct();
|
6 |
-
$this->_init('b2bprofessional/order');
|
7 |
-
}
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Resource/Quote.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Sitewards_B2BProfessional_Model_Resource_Quote extends Mage_Core_Model_Mysql4_Abstract {
|
3 |
-
public function _construct() {
|
4 |
-
$this->_init('b2bprofessional/quote', 'id');
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @param int $iQuoteId
|
9 |
-
* @param string $sKey
|
10 |
-
*/
|
11 |
-
public function deleteByQuote($iQuoteId, $sKey){
|
12 |
-
$sTable = $this->getMainTable();
|
13 |
-
$sWhere = $this->_getWriteAdapter()->quoteInto('quote_id = ? AND ', $iQuoteId)
|
14 |
-
. $this->_getWriteAdapter()->quoteInto('`key` = ?', $sKey);
|
15 |
-
$this->_getWriteAdapter()->delete($sTable, $sWhere);
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @param int $iQuoteId
|
20 |
-
* @param string $sKey
|
21 |
-
* @return array
|
22 |
-
*/
|
23 |
-
public function getByQuote($iQuoteId, $sKey = ''){
|
24 |
-
$sTable = $this->getMainTable();
|
25 |
-
$sWhere = $this->_getReadAdapter()->quoteInto('quote_id = ?', $iQuoteId);
|
26 |
-
if (!empty($sKey)){
|
27 |
-
$sWhere .= $this->_getReadAdapter()->quoteInto(' AND `key` = ? ', $sKey);
|
28 |
-
}
|
29 |
-
$sSql = $this->_getReadAdapter()->select()->from($sTable)->where($sWhere);
|
30 |
-
$aRows = $this->_getReadAdapter()->fetchAll($sSql);
|
31 |
-
$aReturn = array();
|
32 |
-
foreach($aRows as $row){
|
33 |
-
$aReturn[$row['key']] = $row['value'];
|
34 |
-
}
|
35 |
-
return $aReturn;
|
36 |
-
}
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/Resource/Quote/Collection.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sitewards_B2BProfessional_Model_Resource_Quote_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
4 |
-
public function _construct () {
|
5 |
-
parent::_construct();
|
6 |
-
$this->_init('b2bprofessional/quote');
|
7 |
-
}
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Category.php
CHANGED
@@ -1,39 +1,42 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Sitewards_B2BProfessional_Model_System_Config_Source_Category
|
4 |
-
*
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c)
|
9 |
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_System_Config_Source_Category extends Mage_Adminhtml_Model_System_Config_Source_Category
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional_Model_System_Config_Source_Category
|
5 |
+
* - Create an options array with the current system categories
|
6 |
*
|
7 |
* @category Sitewards
|
8 |
* @package Sitewards_B2BProfessional
|
9 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
10 |
*/
|
11 |
+
class Sitewards_B2BProfessional_Model_System_Config_Source_Category extends Mage_Adminhtml_Model_System_Config_Source_Category
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Populate an options array with the current system categories
|
15 |
+
*
|
16 |
+
* @param boolean $bAddEmpty
|
17 |
+
* @return array
|
18 |
+
*/
|
19 |
+
public function toOptionArray($bAddEmpty = true)
|
20 |
+
{
|
21 |
+
/* @var $oCategoryCollection Mage_Catalog_Model_Resource_Category_Collection */
|
22 |
+
$oCategoryCollection = Mage::getResourceModel('catalog/category_collection');
|
23 |
+
$oCategoryCollection->addAttributeToSelect('name')->load();
|
24 |
|
25 |
+
$aCategoryOptions = array();
|
26 |
+
if ($bAddEmpty) {
|
27 |
+
$aCategoryOptions[] = array(
|
28 |
+
'label' => Mage::helper('adminhtml')->__('-- Please select at least one category --'),
|
29 |
+
'value' => ''
|
30 |
+
);
|
31 |
+
}
|
32 |
+
foreach ($oCategoryCollection as $oCategory) {
|
33 |
+
/* @var $oCategory Mage_Catalog_Model_Category */
|
34 |
+
$aCategoryOptions[] = array(
|
35 |
+
'label' => $oCategory->getName(),
|
36 |
+
'value' => $oCategory->getId()
|
37 |
+
);
|
38 |
+
}
|
39 |
|
40 |
+
return $aCategoryOptions;
|
41 |
+
}
|
42 |
}
|
app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Identifiers.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Model_System_Config_Source_Identifiers
|
4 |
-
* - Create an options array with the current identifiers allowed in the system config
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_System_Config_Source_Identifiers {
|
11 |
-
/**
|
12 |
-
* Options array for the source model
|
13 |
-
*
|
14 |
-
* @var array
|
15 |
-
*/
|
16 |
-
protected $_aOptions;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Create an array with all the allowed identifiers
|
20 |
-
*
|
21 |
-
* @return array
|
22 |
-
*/
|
23 |
-
public function toOptionArray() {
|
24 |
-
if (!$this->_aOptions) {
|
25 |
-
$this->_aOptions = array(
|
26 |
-
array(
|
27 |
-
'value' => 'id',
|
28 |
-
'label' => 'id'
|
29 |
-
),
|
30 |
-
array(
|
31 |
-
'value' => 'class',
|
32 |
-
'label' => 'class'
|
33 |
-
),
|
34 |
-
array(
|
35 |
-
'value' => 'onclick',
|
36 |
-
'label' => 'onclick'
|
37 |
-
),
|
38 |
-
);
|
39 |
-
}
|
40 |
-
return $this->_aOptions;
|
41 |
-
}
|
42 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Page.php
CHANGED
@@ -1,32 +1,35 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Sitewards_B2BProfessional_Model_System_Config_Source_Page
|
4 |
-
*
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c)
|
9 |
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_System_Config_Source_Page extends Mage_Adminhtml_Model_System_Config_Source_Cms_Page
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
32 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional_Model_System_Config_Source_Page
|
5 |
+
* - Create an options array with the current system cms pages and the customer login page
|
6 |
*
|
7 |
* @category Sitewards
|
8 |
* @package Sitewards_B2BProfessional
|
9 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
10 |
*/
|
11 |
+
class Sitewards_B2BProfessional_Model_System_Config_Source_Page extends Mage_Adminhtml_Model_System_Config_Source_Cms_Page
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* Populate an options array with the current system cms pages and the customer login page
|
15 |
+
*
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
if (!$this->_options) {
|
21 |
+
parent::toOptionArray();
|
22 |
+
$aNewCmsOption = array(
|
23 |
+
'value' => '',
|
24 |
+
'label' => Mage::helper('sitewards_b2bprofessional')->__('-- Please Select --')
|
25 |
+
);
|
26 |
+
|
27 |
+
$aCustomerLogin = array(
|
28 |
+
'value' => 'customer/account/login',
|
29 |
+
'label' => Mage::helper('sitewards_b2bprofessional')->__('Customer Login')
|
30 |
+
);
|
31 |
+
array_unshift($this->_options, $aNewCmsOption, $aCustomerLogin);
|
32 |
+
}
|
33 |
+
return $this->_options;
|
34 |
+
}
|
35 |
}
|
app/code/community/Sitewards/B2BProfessional/Model/System/Config/Source/Tags.php
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_Model_System_Config_Source_Tags
|
4 |
-
* - Create an options array with the current tags allowed in the system config
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_Model_System_Config_Source_Tags {
|
11 |
-
/**
|
12 |
-
* Options array for the source model
|
13 |
-
*
|
14 |
-
* @var array
|
15 |
-
*/
|
16 |
-
protected $_aOptions;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Create an array with all the allowed tags
|
20 |
-
*
|
21 |
-
* @return array
|
22 |
-
*/
|
23 |
-
public function toOptionArray() {
|
24 |
-
if (!$this->_aOptions) {
|
25 |
-
$this->_aOptions = array(
|
26 |
-
array(
|
27 |
-
'value' => 'a',
|
28 |
-
'label' => '<a>'
|
29 |
-
),
|
30 |
-
array(
|
31 |
-
'value' => 'div',
|
32 |
-
'label' => '<div>'
|
33 |
-
),
|
34 |
-
array(
|
35 |
-
'value' => 'p',
|
36 |
-
'label' => '<p>'
|
37 |
-
),
|
38 |
-
array(
|
39 |
-
'value' => 'span',
|
40 |
-
'label' => '<span>'
|
41 |
-
),
|
42 |
-
array(
|
43 |
-
'value' => 'button',
|
44 |
-
'label' => '<button>'
|
45 |
-
),
|
46 |
-
);
|
47 |
-
}
|
48 |
-
return $this->_aOptions;
|
49 |
-
}
|
50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/Test/Helper/Data.php
CHANGED
@@ -1,24 +1,25 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Test for class Sitewards_B2BProfessional_Helper_Data
|
4 |
*
|
5 |
* @category Sitewards
|
6 |
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c)
|
8 |
*/
|
9 |
class Sitewards_B2BProfessional_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case
|
10 |
{
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Test for class Sitewards_B2BProfessional_Helper_Data
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
*/
|
10 |
class Sitewards_B2BProfessional_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case
|
11 |
{
|
12 |
+
/**
|
13 |
+
* Tests is extension active
|
14 |
+
*
|
15 |
+
* @test
|
16 |
+
* @loadFixture
|
17 |
+
*/
|
18 |
+
public function testIsExtensionActive()
|
19 |
+
{
|
20 |
+
$this->assertTrue(
|
21 |
+
Mage::helper('sitewards_b2bprofessional')->isExtensionActive(),
|
22 |
+
'Extension is not active please check config'
|
23 |
+
);
|
24 |
+
}
|
25 |
}
|
app/code/community/Sitewards/B2BProfessional/controllers/CartController.php
DELETED
@@ -1,115 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_CartController
|
4 |
-
* - Add product check on the preDispatch function
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
require_once 'Mage/Checkout/controllers/CartController.php';
|
11 |
-
|
12 |
-
class Sitewards_B2BProfessional_CartController extends Mage_Checkout_CartController
|
13 |
-
{
|
14 |
-
/**
|
15 |
-
* On checkout cart controller preDispatch
|
16 |
-
* - validate that all products are active for customer/customer group,
|
17 |
-
* - assign error message,
|
18 |
-
* - redirect to customer login page,
|
19 |
-
*
|
20 |
-
* @return Mage_Core_Controller_Front_Action
|
21 |
-
*/
|
22 |
-
public function preDispatch()
|
23 |
-
{
|
24 |
-
parent::preDispatch();
|
25 |
-
|
26 |
-
/* @var $oB2BHelper Sitewards_B2BProfessional_Helper_Data */
|
27 |
-
$oB2BHelper = Mage::helper('b2bprofessional');
|
28 |
-
/*
|
29 |
-
* Let's check if the extension is active before we do anything funny
|
30 |
-
*/
|
31 |
-
if ($oB2BHelper->isExtensionActive()) {
|
32 |
-
/**
|
33 |
-
* Check customer is logged in
|
34 |
-
* - If it is activated in the extension
|
35 |
-
*/
|
36 |
-
if (
|
37 |
-
Mage::helper('b2bprofessional/customer')->isLoginRequired()
|
38 |
-
&&
|
39 |
-
!Mage::getSingleton('customer/session')->isLoggedIn()
|
40 |
-
) {
|
41 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
42 |
-
}
|
43 |
-
|
44 |
-
$oRequest = $this->getRequest();
|
45 |
-
$iProductId = $oRequest->get('product');
|
46 |
-
|
47 |
-
// check for grouped products
|
48 |
-
$bAllowed = true;
|
49 |
-
$aMultiProducts = $oRequest->getPost('super_group');
|
50 |
-
if (!empty($aMultiProducts)) {
|
51 |
-
foreach ($aMultiProducts as $iMultiProductId => $iMultiProductValue) {
|
52 |
-
if ($iMultiProductValue > 0) {
|
53 |
-
if ($oB2BHelper->isProductActive($iMultiProductId)) {
|
54 |
-
$bAllowed = false;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
$bHasProduct = !empty($iProductId);
|
61 |
-
$bIsProductActive = $oB2BHelper->isProductActive($iProductId);
|
62 |
-
if (
|
63 |
-
($bHasProduct && $bIsProductActive)
|
64 |
-
||
|
65 |
-
!$bAllowed
|
66 |
-
) {
|
67 |
-
/* @var $oB2BMessagesHelper Sitewards_B2BProfessional_Helper_Messages */
|
68 |
-
$oB2BMessagesHelper = Mage::helper('b2bprofessional/messages');
|
69 |
-
|
70 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
71 |
-
Mage::getSingleton('customer/session')->addError(
|
72 |
-
$oB2BMessagesHelper->getMessage($oB2BMessagesHelper::MESSAGE_TYPE_CHECKOUT)
|
73 |
-
);
|
74 |
-
Mage::app()->getResponse()->setRedirect(
|
75 |
-
Sitewards_B2BProfessional_Helper_Redirects::getRedirect(
|
76 |
-
Sitewards_B2BProfessional_Helper_Redirects::REDIRECT_TYPE_ADD_TO_CART
|
77 |
-
)
|
78 |
-
)->sendHeaders();
|
79 |
-
}
|
80 |
-
}
|
81 |
-
return $this;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* adds multiple products to cart
|
86 |
-
*/
|
87 |
-
public function addmultipleAction()
|
88 |
-
{
|
89 |
-
$oRequest = $this->getRequest();
|
90 |
-
$aSkus = $oRequest->getParam('sku');
|
91 |
-
$aQtys = $oRequest->getParam('qty');
|
92 |
-
$bSuccess = false;
|
93 |
-
|
94 |
-
$oQuote = $this->_getQuote();
|
95 |
-
foreach ($aSkus as $iKey => $sSku) {
|
96 |
-
$oProduct = Mage::getModel('catalog/product');
|
97 |
-
$oProduct->load($oProduct->getIdBySku($sSku));
|
98 |
-
if ($oProduct->getId() && !Mage::helper('b2bprofessional')->isProductActive($oProduct->getId())) {
|
99 |
-
$oRequest->setParam('product', $oProduct->getId());
|
100 |
-
$iQty = isset($aQtys[$iKey]) ? $aQtys[$iKey] : 1;
|
101 |
-
$oRequest->setParam('qty', $iQty);
|
102 |
-
$this->addAction();
|
103 |
-
$bSuccess = true;
|
104 |
-
}
|
105 |
-
}
|
106 |
-
if ($bSuccess) {
|
107 |
-
$oQuote->save();
|
108 |
-
} else {
|
109 |
-
Mage::getSingleton('customer/session')->addError(
|
110 |
-
$this->__('Please enter valid product sku.')
|
111 |
-
);
|
112 |
-
$this->_redirect('b2bprofessional/order/form');
|
113 |
-
}
|
114 |
-
}
|
115 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/controllers/OrderController.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_OrderController
|
4 |
-
* implements actions for new order form and cancel an order
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_OrderController extends Mage_Core_Controller_Front_Action {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Check customer authentication
|
14 |
-
*/
|
15 |
-
public function preDispatch () {
|
16 |
-
parent::preDispatch();
|
17 |
-
$sLoginUrl = Mage::helper('customer')
|
18 |
-
->getLoginUrl();
|
19 |
-
|
20 |
-
if (!Mage::getSingleton('customer/session')
|
21 |
-
->authenticate($this, $sLoginUrl)
|
22 |
-
) {
|
23 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
public function formAction() {
|
28 |
-
$this->loadLayout();
|
29 |
-
$this->_initLayoutMessages('customer/session');
|
30 |
-
$this->renderLayout();
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* cancels an order
|
35 |
-
*/
|
36 |
-
public function cancelAction() {
|
37 |
-
$iOrderId = $this->getRequest()->getParam('id');
|
38 |
-
$oB2BModel = Mage::getModel('b2bprofessional/order');
|
39 |
-
$oMageModel = Mage::getModel('sales/order')->load($iOrderId);
|
40 |
-
if ($oB2BModel->canCancel($iOrderId)) {
|
41 |
-
$oMageModel->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
|
42 |
-
}
|
43 |
-
$this->getResponse()->setRedirect(Mage::helper('b2bprofessional')->getOrderHistoryUrl());
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/controllers/ProductController.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Sitewards_B2BProfessional_ProductController
|
4 |
-
* implements infoAction to validate a product request by sku
|
5 |
-
*
|
6 |
-
* @category Sitewards
|
7 |
-
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
9 |
-
*/
|
10 |
-
class Sitewards_B2BProfessional_ProductController extends Mage_Core_Controller_Front_Action
|
11 |
-
{
|
12 |
-
/**
|
13 |
-
* Check customer authentication
|
14 |
-
*/
|
15 |
-
public function preDispatch()
|
16 |
-
{
|
17 |
-
parent::preDispatch();
|
18 |
-
$sLoginUrl = Mage::helper('customer')
|
19 |
-
->getLoginUrl();
|
20 |
-
|
21 |
-
if (!Mage::getSingleton('customer/session')
|
22 |
-
->authenticate($this, $sLoginUrl)
|
23 |
-
) {
|
24 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* gets a sku as input parameter
|
30 |
-
* sets JSON response with product data if it is allowed to be viewed
|
31 |
-
*/
|
32 |
-
public function infoAction()
|
33 |
-
{
|
34 |
-
$sSku = $this->getRequest()->getParam('sku');
|
35 |
-
/* @var Mage_Catalog_Model_Product $oProduct */
|
36 |
-
$oProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $sSku);
|
37 |
-
if (Mage::helper('b2bprofessional/customer')->isUserAllowed() and $oProduct) {
|
38 |
-
if (Mage::helper('b2bprofessional')->isProductActive($oProduct->getId())) {
|
39 |
-
$sMessage = Mage::helper('b2bprofessional')->__('Your account is not allowed to access this product.');
|
40 |
-
$sResponse = json_encode(
|
41 |
-
array(
|
42 |
-
'result' => 1,
|
43 |
-
'error' => $sMessage,
|
44 |
-
)
|
45 |
-
);
|
46 |
-
} else {
|
47 |
-
$sResponse = json_encode(
|
48 |
-
array(
|
49 |
-
'result' => 0,
|
50 |
-
'sku' => $oProduct->getSku(),
|
51 |
-
'name' => $oProduct->getName(),
|
52 |
-
'price' => Mage::helper('core')->currency($oProduct->getPrice()),
|
53 |
-
'qty' => $oProduct->getStockItem()->getMinSaleQty(),
|
54 |
-
)
|
55 |
-
);
|
56 |
-
}
|
57 |
-
$this->getResponse()->setHeader('Content-type', 'text/json');
|
58 |
-
$this->getResponse()->setBody($sResponse);
|
59 |
-
} else {
|
60 |
-
$this->getResponse()->setHttpResponseCode(404);
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sitewards/B2BProfessional/etc/adminhtml.xml
CHANGED
@@ -2,32 +2,32 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* adminhtml.xml
|
5 |
-
*
|
6 |
*
|
7 |
* @category Sitewards
|
8 |
* @package Sitewards_B2BProfessional
|
9 |
-
* @copyright Copyright (c)
|
10 |
*/
|
11 |
-->
|
12 |
<config>
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
</config>
|
2 |
<!--
|
3 |
/**
|
4 |
* adminhtml.xml
|
5 |
+
* - create acl for this module
|
6 |
*
|
7 |
* @category Sitewards
|
8 |
* @package Sitewards_B2BProfessional
|
9 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
10 |
*/
|
11 |
-->
|
12 |
<config>
|
13 |
+
<acl>
|
14 |
+
<resources>
|
15 |
+
<admin>
|
16 |
+
<children>
|
17 |
+
<system>
|
18 |
+
<children>
|
19 |
+
<config>
|
20 |
+
<children>
|
21 |
+
<b2bprofessional translate="title" module="sitewards_b2bprofessional">
|
22 |
+
<title>B2B Professional</title>
|
23 |
+
<sort_order>50</sort_order>
|
24 |
+
</b2bprofessional>
|
25 |
+
</children>
|
26 |
+
</config>
|
27 |
+
</children>
|
28 |
+
</system>
|
29 |
+
</children>
|
30 |
+
</admin>
|
31 |
+
</resources>
|
32 |
+
</acl>
|
33 |
</config>
|
app/code/community/Sitewards/B2BProfessional/etc/config.xml
CHANGED
@@ -1,309 +1,100 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* config.xml
|
5 |
-
* - rewrite blocks,
|
6 |
-
* - set-up helper,
|
7 |
-
* - set-up url rewrite,
|
8 |
-
* - define router,
|
9 |
-
* - set-up layout.xml,
|
10 |
-
* - set-up translation file,
|
11 |
-
* - define default values
|
12 |
-
*
|
13 |
-
* @category Sitewards
|
14 |
-
* @package Sitewards_B2BProfessional
|
15 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
16 |
-
*/
|
17 |
-
-->
|
18 |
<config>
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
<file>sitewards/b2bprofessional.xml</file>
|
117 |
-
</b2bprofessional>
|
118 |
-
</updates>
|
119 |
-
</layout>
|
120 |
-
<events>
|
121 |
-
<controller_action_predispatch>
|
122 |
-
<observers>
|
123 |
-
<b2bprofessional>
|
124 |
-
<class>b2bprofessional/observer</class>
|
125 |
-
<method>onControllerActionPreDispatch</method>
|
126 |
-
</b2bprofessional>
|
127 |
-
</observers>
|
128 |
-
</controller_action_predispatch>
|
129 |
-
<core_block_abstract_to_html_before>
|
130 |
-
<observers>
|
131 |
-
<b2bprofessional>
|
132 |
-
<class>b2bprofessional/observer</class>
|
133 |
-
<method>onCoreBlockAbstractToHtmlBefore</method>
|
134 |
-
</b2bprofessional>
|
135 |
-
</observers>
|
136 |
-
</core_block_abstract_to_html_before>
|
137 |
-
<core_block_abstract_to_html_after>
|
138 |
-
<observers>
|
139 |
-
<b2bprofessional>
|
140 |
-
<class>b2bprofessional/observer</class>
|
141 |
-
<method>onCoreBlockAbstractToHtmlAfter</method>
|
142 |
-
</b2bprofessional>
|
143 |
-
</observers>
|
144 |
-
</core_block_abstract_to_html_after>
|
145 |
-
<catalog_product_type_configurable_price>
|
146 |
-
<observers>
|
147 |
-
<b2bprofessional>
|
148 |
-
<class>b2bprofessional/observer</class>
|
149 |
-
<method>onCatalogProductTypeConfigurablePrice</method>
|
150 |
-
</b2bprofessional>
|
151 |
-
</observers>
|
152 |
-
</catalog_product_type_configurable_price>
|
153 |
-
<core_layout_block_create_after>
|
154 |
-
<observers>
|
155 |
-
<b2bprofessional>
|
156 |
-
<class>b2bprofessional/observer</class>
|
157 |
-
<method>onCoreLayoutBlockCreateAfter</method>
|
158 |
-
</b2bprofessional>
|
159 |
-
</observers>
|
160 |
-
</core_layout_block_create_after>
|
161 |
-
<checkout_cart_product_add_after>
|
162 |
-
<observers>
|
163 |
-
<b2bprofessional>
|
164 |
-
<class>b2bprofessional/observer</class>
|
165 |
-
<method>onCheckoutCartProductAddAfter</method>
|
166 |
-
</b2bprofessional>
|
167 |
-
</observers>
|
168 |
-
</checkout_cart_product_add_after>
|
169 |
-
<sales_quote_save_before> <!-- Event Called Before Quote Object is saved -->
|
170 |
-
<observers>
|
171 |
-
<save_before>
|
172 |
-
<type>singleton</type>
|
173 |
-
<class>Sitewards_B2BProfessional_Model_Observer</class>
|
174 |
-
<!-- Over Model Class -->
|
175 |
-
<method>saveQuoteBefore</method>
|
176 |
-
<!-- name of function -->
|
177 |
-
</save_before>
|
178 |
-
</observers>
|
179 |
-
</sales_quote_save_before>
|
180 |
-
<sales_quote_save_after> <!-- Event called After Quote Object is saved -->
|
181 |
-
<observers>
|
182 |
-
<save_after>
|
183 |
-
<type>singleton</type>
|
184 |
-
<class>Sitewards_B2BProfessional_Model_Observer</class>
|
185 |
-
<!-- Over Model Class -->
|
186 |
-
<method>saveQuoteAfter</method>
|
187 |
-
<!-- name of function -->
|
188 |
-
</save_after>
|
189 |
-
</observers>
|
190 |
-
</sales_quote_save_after>
|
191 |
-
<sales_quote_load_after> <!-- Event called when Quote Object is loaded -->
|
192 |
-
<observers>
|
193 |
-
<load_after>
|
194 |
-
<type>singleton</type>
|
195 |
-
<class>Sitewards_B2BProfessional_Model_Observer</class>
|
196 |
-
<!-- Over Model Class -->
|
197 |
-
<method>loadQuoteAfter</method>
|
198 |
-
<!-- name of function -->
|
199 |
-
</load_after>
|
200 |
-
</observers>
|
201 |
-
</sales_quote_load_after>
|
202 |
-
<sales_model_service_quote_submit_after> <!-- Event called after order placed -->
|
203 |
-
<observers>
|
204 |
-
<sales_model_service_quote_submit_after>
|
205 |
-
<type>singleton</type>
|
206 |
-
<class>Sitewards_B2BProfessional_Model_Observer</class>
|
207 |
-
<!-- Over Model Class -->
|
208 |
-
<method>saveOrderAfter</method>
|
209 |
-
<!-- name of function -->
|
210 |
-
</sales_model_service_quote_submit_after>
|
211 |
-
</observers>
|
212 |
-
</sales_model_service_quote_submit_after>
|
213 |
-
<sales_order_load_after> <!-- Event called after Order Object is loaded -->
|
214 |
-
<observers>
|
215 |
-
<sales_order_load_after>
|
216 |
-
<type>singleton</type>
|
217 |
-
<class>Sitewards_B2BProfessional_Model_Observer</class>
|
218 |
-
<!-- Over Model Class -->
|
219 |
-
<method>loadOrderAfter</method>
|
220 |
-
<!-- name of function -->
|
221 |
-
</sales_order_load_after>
|
222 |
-
</observers>
|
223 |
-
</sales_order_load_after>
|
224 |
-
</events>
|
225 |
-
</frontend>
|
226 |
-
<adminhtml>
|
227 |
-
<translate>
|
228 |
-
<modules>
|
229 |
-
<Sitewards_B2BProfessional>
|
230 |
-
<files>
|
231 |
-
<default>Sitewards_B2BProfessional.csv</default>
|
232 |
-
</files>
|
233 |
-
</Sitewards_B2BProfessional>
|
234 |
-
</modules>
|
235 |
-
</translate>
|
236 |
-
<layout>
|
237 |
-
<updates>
|
238 |
-
<b2bprofessional>
|
239 |
-
<file>sitewards/b2bprofessional.xml</file>
|
240 |
-
</b2bprofessional>
|
241 |
-
</updates>
|
242 |
-
</layout>
|
243 |
-
</adminhtml>
|
244 |
-
<phpunit>
|
245 |
-
<suite>
|
246 |
-
<modules>
|
247 |
-
<Sitewards_B2BProfessional/>
|
248 |
-
</modules>
|
249 |
-
</suite>
|
250 |
-
</phpunit>
|
251 |
-
<default>
|
252 |
-
<b2bprofessional>
|
253 |
-
<generalsettings>
|
254 |
-
<addtocartredirect>customer/account/login</addtocartredirect>
|
255 |
-
</generalsettings>
|
256 |
-
<languagesettings>
|
257 |
-
<logintext>Please login</logintext>
|
258 |
-
<errortext>Your account is not allowed to access this store.</errortext>
|
259 |
-
<requireloginmessage>You do not have access to view this store.</requireloginmessage>
|
260 |
-
</languagesettings>
|
261 |
-
<requirelogin>
|
262 |
-
<requirelogin>0</requirelogin>
|
263 |
-
<requireloginredirect>customer/account/login</requireloginredirect>
|
264 |
-
</requirelogin>
|
265 |
-
<!--
|
266 |
-
Each of the following sections is to do with replacing html when customer has limited access,
|
267 |
-
They should contain:
|
268 |
-
replace: flag for if the section will be replaced
|
269 |
-
tag: which html tag to look for <p> == p
|
270 |
-
id: the type of identifier for this tag (id, class, href)
|
271 |
-
value: what to look for in the identifier
|
272 |
-
remove: if the section is removed or replaced by text
|
273 |
-
check_cart: flag to check for invalid cart
|
274 |
-
-->
|
275 |
-
<cart_sidebar_totals>
|
276 |
-
<replace>1</replace>
|
277 |
-
<tag>p</tag>
|
278 |
-
<id>class</id>
|
279 |
-
<value>subtotal</value>
|
280 |
-
<remove />
|
281 |
-
<check_cart>1</check_cart>
|
282 |
-
</cart_sidebar_totals>
|
283 |
-
<cart_sidebar_actions>
|
284 |
-
<replace>1</replace>
|
285 |
-
<tag>div</tag>
|
286 |
-
<id>class</id>
|
287 |
-
<value>actions</value>
|
288 |
-
<remove>1</remove>
|
289 |
-
<check_cart>1</check_cart>
|
290 |
-
</cart_sidebar_actions>
|
291 |
-
<cart_item_price>
|
292 |
-
<replace>1</replace>
|
293 |
-
<tag>span</tag>
|
294 |
-
<id>class</id>
|
295 |
-
<value>price</value>
|
296 |
-
<remove />
|
297 |
-
<check_cart>1</check_cart>
|
298 |
-
</cart_item_price>
|
299 |
-
<add_to_cart>
|
300 |
-
<replace>1</replace>
|
301 |
-
<tag>button</tag>
|
302 |
-
<id>onclick</id>
|
303 |
-
<value>remove-add-to-cart</value>
|
304 |
-
<remove>1</remove>
|
305 |
-
<check_cart />
|
306 |
-
</add_to_cart>
|
307 |
-
</b2bprofessional>
|
308 |
-
</default>
|
309 |
</config>
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
+
<modules>
|
4 |
+
<Sitewards_B2BProfessional>
|
5 |
+
<version>3.0.0</version>
|
6 |
+
</Sitewards_B2BProfessional>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<sitewards_b2bprofessional>
|
11 |
+
<class>Sitewards_B2BProfessional_Model</class>
|
12 |
+
</sitewards_b2bprofessional>
|
13 |
+
</models>
|
14 |
+
<helpers>
|
15 |
+
<sitewards_b2bprofessional>
|
16 |
+
<class>Sitewards_B2BProfessional_Helper</class>
|
17 |
+
</sitewards_b2bprofessional>
|
18 |
+
</helpers>
|
19 |
+
</global>
|
20 |
+
<frontend>
|
21 |
+
<events>
|
22 |
+
<catalog_product_is_salable_after>
|
23 |
+
<observers>
|
24 |
+
<sitewards_b2bprofessional>
|
25 |
+
<type>singleton</type>
|
26 |
+
<class>sitewards_b2bprofessional/observer</class>
|
27 |
+
<method>catalogProductIsSalableAfter</method>
|
28 |
+
</sitewards_b2bprofessional>
|
29 |
+
</observers>
|
30 |
+
</catalog_product_is_salable_after>
|
31 |
+
<catalog_product_type_prepare_full_options>
|
32 |
+
<observers>
|
33 |
+
<sitewards_b2bprofessional>
|
34 |
+
<type>singleton</type>
|
35 |
+
<class>sitewards_b2bprofessional/observer</class>
|
36 |
+
<method>catalogProductTypePrepareFullOptions</method>
|
37 |
+
</sitewards_b2bprofessional>
|
38 |
+
</observers>
|
39 |
+
</catalog_product_type_prepare_full_options>
|
40 |
+
<core_block_abstract_to_html_before>
|
41 |
+
<observers>
|
42 |
+
<sitewards_b2bprofessional>
|
43 |
+
<type>singleton</type>
|
44 |
+
<class>sitewards_b2bprofessional/observer</class>
|
45 |
+
<method>coreBlockAbstractToHtmlBefore</method>
|
46 |
+
</sitewards_b2bprofessional>
|
47 |
+
</observers>
|
48 |
+
</core_block_abstract_to_html_before>
|
49 |
+
<core_block_abstract_to_html_after>
|
50 |
+
<observers>
|
51 |
+
<sitewards_b2bprofessional>
|
52 |
+
<type>singleton</type>
|
53 |
+
<class>sitewards_b2bprofessional/observer</class>
|
54 |
+
<method>coreBlockAbstractToHtmlAfter</method>
|
55 |
+
</sitewards_b2bprofessional>
|
56 |
+
</observers>
|
57 |
+
</core_block_abstract_to_html_after>
|
58 |
+
<core_layout_block_create_after>
|
59 |
+
<observers>
|
60 |
+
<sitewards_b2bprofessional>
|
61 |
+
<type>singleton</type>
|
62 |
+
<class>sitewards_b2bprofessional/observer</class>
|
63 |
+
<method>coreLayoutBlockCreateAfter</method>
|
64 |
+
</sitewards_b2bprofessional>
|
65 |
+
</observers>
|
66 |
+
</core_layout_block_create_after>
|
67 |
+
<controller_action_predispatch>
|
68 |
+
<observers>
|
69 |
+
<sitewards_b2bprofessional>
|
70 |
+
<type>singleton</type>
|
71 |
+
<class>sitewards_b2bprofessional/observer</class>
|
72 |
+
<method>controllerActionPredispatch</method>
|
73 |
+
</sitewards_b2bprofessional>
|
74 |
+
</observers>
|
75 |
+
</controller_action_predispatch>
|
76 |
+
</events>
|
77 |
+
</frontend>
|
78 |
+
<default>
|
79 |
+
<b2bprofessional>
|
80 |
+
<generalsettings>
|
81 |
+
<active>0</active>
|
82 |
+
<priceblocks>
|
83 |
+
<catalog>Mage_Catalog_Block_Product_Price</catalog>
|
84 |
+
<bundle>Mage_Bundle_Block_Catalog_Product_Price</bundle>
|
85 |
+
</priceblocks>
|
86 |
+
</generalsettings>
|
87 |
+
<requirelogin>
|
88 |
+
<requirelogin>0</requirelogin>
|
89 |
+
<requireloginredirect>customer/account/login</requireloginredirect>
|
90 |
+
</requirelogin>
|
91 |
+
</b2bprofessional>
|
92 |
+
</default>
|
93 |
+
<phpunit>
|
94 |
+
<suite>
|
95 |
+
<modules>
|
96 |
+
<Sitewards_B2BProfessional/>
|
97 |
+
</modules>
|
98 |
+
</suite>
|
99 |
+
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
</config>
|
app/code/community/Sitewards/B2BProfessional/etc/system.xml
CHANGED
@@ -2,431 +2,159 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* sytem.xml
|
5 |
-
*
|
6 |
-
*
|
7 |
*
|
8 |
* @category Sitewards
|
9 |
* @package Sitewards_B2BProfessional
|
10 |
-
* @copyright Copyright (c)
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
<frontend_type>select</frontend_type>
|
161 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
162 |
-
<sort_order>5</sort_order>
|
163 |
-
<show_in_default>1</show_in_default>
|
164 |
-
<show_in_website>1</show_in_website>
|
165 |
-
<show_in_store>1</show_in_store>
|
166 |
-
<comment><![CDATA[Activate extension only for categories selected below]]></comment>
|
167 |
-
</activebycategory>
|
168 |
-
<activecategories translate="label comment">
|
169 |
-
<label>Active categories</label>
|
170 |
-
<frontend_type>multiselect</frontend_type>
|
171 |
-
<source_model>b2bprofessional/system_config_source_category</source_model>
|
172 |
-
<sort_order>6</sort_order>
|
173 |
-
<show_in_default>1</show_in_default>
|
174 |
-
<show_in_website>1</show_in_website>
|
175 |
-
<show_in_store>1</show_in_store>
|
176 |
-
<comment><![CDATA[Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.]]></comment>
|
177 |
-
<depends><activebycategory>1</activebycategory></depends>
|
178 |
-
</activecategories>
|
179 |
-
</fields>
|
180 |
-
</activatebycategorysettings>
|
181 |
-
<activatebycustomersettings translate="label comment">
|
182 |
-
<label>Activate by customer group</label>
|
183 |
-
<frontend_type>text</frontend_type>
|
184 |
-
<sort_order>5</sort_order>
|
185 |
-
<show_in_default>1</show_in_default>
|
186 |
-
<show_in_website>1</show_in_website>
|
187 |
-
<show_in_store>1</show_in_store>
|
188 |
-
<comment><![CDATA[When activating this extension by customer group the guest user is also included.]]></comment>
|
189 |
-
<fields>
|
190 |
-
<activebycustomer translate="label comment">
|
191 |
-
<label>Activate by customer group</label>
|
192 |
-
<frontend_type>select</frontend_type>
|
193 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
194 |
-
<sort_order>5</sort_order>
|
195 |
-
<show_in_default>1</show_in_default>
|
196 |
-
<show_in_website>1</show_in_website>
|
197 |
-
<show_in_store>1</show_in_store>
|
198 |
-
<comment><![CDATA[Activate extension only for customer groups selected below]]></comment>
|
199 |
-
</activebycustomer>
|
200 |
-
<activecustomers translate="label comment">
|
201 |
-
<label>Active customer groups</label>
|
202 |
-
<frontend_type>multiselect</frontend_type>
|
203 |
-
<source_model>adminhtml/system_config_source_customer_group</source_model>
|
204 |
-
<sort_order>6</sort_order>
|
205 |
-
<show_in_default>1</show_in_default>
|
206 |
-
<show_in_website>1</show_in_website>
|
207 |
-
<show_in_store>1</show_in_store>
|
208 |
-
<comment><![CDATA[Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.]]></comment>
|
209 |
-
<depends><activebycustomer>1</activebycustomer></depends>
|
210 |
-
</activecustomers>
|
211 |
-
</fields>
|
212 |
-
</activatebycustomersettings>
|
213 |
-
<cart_sidebar_totals translate="label">
|
214 |
-
<label>Cart Sidebar Totals</label>
|
215 |
-
<frontend_type>text</frontend_type>
|
216 |
-
<sort_order>6</sort_order>
|
217 |
-
<show_in_default>1</show_in_default>
|
218 |
-
<show_in_website>1</show_in_website>
|
219 |
-
<show_in_store>1</show_in_store>
|
220 |
-
<fields>
|
221 |
-
<replace translate="label,comment">
|
222 |
-
<label>Replace the sidebar totals</label>
|
223 |
-
<frontend_type>select</frontend_type>
|
224 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
225 |
-
<sort_order>1</sort_order>
|
226 |
-
<show_in_default>1</show_in_default>
|
227 |
-
<show_in_website>1</show_in_website>
|
228 |
-
<show_in_store>1</show_in_store>
|
229 |
-
</replace>
|
230 |
-
<tag translate="label comment">
|
231 |
-
<label>What tag wraps the sidebar totals?</label>
|
232 |
-
<frontend_type>select</frontend_type>
|
233 |
-
<source_model>b2bprofessional/system_config_source_tags</source_model>
|
234 |
-
<sort_order>2</sort_order>
|
235 |
-
<show_in_default>1</show_in_default>
|
236 |
-
<show_in_website>1</show_in_website>
|
237 |
-
<show_in_store>1</show_in_store>
|
238 |
-
</tag>
|
239 |
-
<id translate="label comment">
|
240 |
-
<label>What identifier does this tag have?</label>
|
241 |
-
<frontend_type>select</frontend_type>
|
242 |
-
<source_model>b2bprofessional/system_config_source_identifiers</source_model>
|
243 |
-
<sort_order>3</sort_order>
|
244 |
-
<show_in_default>1</show_in_default>
|
245 |
-
<show_in_website>1</show_in_website>
|
246 |
-
<show_in_store>1</show_in_store>
|
247 |
-
</id>
|
248 |
-
<value translate="label comment">
|
249 |
-
<label>What value does this identifier have?</label>
|
250 |
-
<frontend_type>text</frontend_type>
|
251 |
-
<sort_order>4</sort_order>
|
252 |
-
<show_in_default>1</show_in_default>
|
253 |
-
<show_in_website>1</show_in_website>
|
254 |
-
<show_in_store>1</show_in_store>
|
255 |
-
</value>
|
256 |
-
<remove translate="label,comment">
|
257 |
-
<label>Do you want to remove this section completely?</label>
|
258 |
-
<frontend_type>select</frontend_type>
|
259 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
260 |
-
<sort_order>5</sort_order>
|
261 |
-
<show_in_default>1</show_in_default>
|
262 |
-
<show_in_website>1</show_in_website>
|
263 |
-
<show_in_store>1</show_in_store>
|
264 |
-
</remove>
|
265 |
-
</fields>
|
266 |
-
</cart_sidebar_totals>
|
267 |
-
<cart_sidebar_actions translate="label">
|
268 |
-
<label>Cart Sidebar Actions</label>
|
269 |
-
<frontend_type>text</frontend_type>
|
270 |
-
<sort_order>7</sort_order>
|
271 |
-
<show_in_default>1</show_in_default>
|
272 |
-
<show_in_website>1</show_in_website>
|
273 |
-
<show_in_store>1</show_in_store>
|
274 |
-
<fields>
|
275 |
-
<replace translate="label,comment">
|
276 |
-
<label>Replace the sidebar actions section</label>
|
277 |
-
<frontend_type>select</frontend_type>
|
278 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
279 |
-
<sort_order>1</sort_order>
|
280 |
-
<show_in_default>1</show_in_default>
|
281 |
-
<show_in_website>1</show_in_website>
|
282 |
-
<show_in_store>1</show_in_store>
|
283 |
-
</replace>
|
284 |
-
<tag translate="label comment">
|
285 |
-
<label>What tag wraps the sidebar actions?</label>
|
286 |
-
<frontend_type>select</frontend_type>
|
287 |
-
<source_model>b2bprofessional/system_config_source_tags</source_model>
|
288 |
-
<sort_order>2</sort_order>
|
289 |
-
<show_in_default>1</show_in_default>
|
290 |
-
<show_in_website>1</show_in_website>
|
291 |
-
<show_in_store>1</show_in_store>
|
292 |
-
</tag>
|
293 |
-
<id translate="label comment">
|
294 |
-
<label>What identifier does this tag have?</label>
|
295 |
-
<frontend_type>select</frontend_type>
|
296 |
-
<source_model>b2bprofessional/system_config_source_identifiers</source_model>
|
297 |
-
<sort_order>3</sort_order>
|
298 |
-
<show_in_default>1</show_in_default>
|
299 |
-
<show_in_website>1</show_in_website>
|
300 |
-
<show_in_store>1</show_in_store>
|
301 |
-
</id>
|
302 |
-
<value translate="label comment">
|
303 |
-
<label>What value does this identifier have?</label>
|
304 |
-
<frontend_type>text</frontend_type>
|
305 |
-
<sort_order>4</sort_order>
|
306 |
-
<show_in_default>1</show_in_default>
|
307 |
-
<show_in_website>1</show_in_website>
|
308 |
-
<show_in_store>1</show_in_store>
|
309 |
-
</value>
|
310 |
-
<remove translate="label,comment">
|
311 |
-
<label>Do you want to remove this section completely?</label>
|
312 |
-
<frontend_type>select</frontend_type>
|
313 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
314 |
-
<sort_order>5</sort_order>
|
315 |
-
<show_in_default>1</show_in_default>
|
316 |
-
<show_in_website>1</show_in_website>
|
317 |
-
<show_in_store>1</show_in_store>
|
318 |
-
</remove>
|
319 |
-
</fields>
|
320 |
-
</cart_sidebar_actions>
|
321 |
-
<cart_item_price translate="label">
|
322 |
-
<label>Cart Items Price</label>
|
323 |
-
<frontend_type>text</frontend_type>
|
324 |
-
<sort_order>8</sort_order>
|
325 |
-
<show_in_default>1</show_in_default>
|
326 |
-
<show_in_website>1</show_in_website>
|
327 |
-
<show_in_store>1</show_in_store>
|
328 |
-
<fields>
|
329 |
-
<replace translate="label,comment">
|
330 |
-
<label>Replace the cart item prices</label>
|
331 |
-
<frontend_type>select</frontend_type>
|
332 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
333 |
-
<sort_order>1</sort_order>
|
334 |
-
<show_in_default>1</show_in_default>
|
335 |
-
<show_in_website>1</show_in_website>
|
336 |
-
<show_in_store>1</show_in_store>
|
337 |
-
</replace>
|
338 |
-
<tag translate="label comment">
|
339 |
-
<label>What tag wraps the cart item prices?</label>
|
340 |
-
<frontend_type>select</frontend_type>
|
341 |
-
<source_model>b2bprofessional/system_config_source_tags</source_model>
|
342 |
-
<sort_order>2</sort_order>
|
343 |
-
<show_in_default>1</show_in_default>
|
344 |
-
<show_in_website>1</show_in_website>
|
345 |
-
<show_in_store>1</show_in_store>
|
346 |
-
</tag>
|
347 |
-
<id translate="label comment">
|
348 |
-
<label>What identifier does this tag have?</label>
|
349 |
-
<frontend_type>select</frontend_type>
|
350 |
-
<source_model>b2bprofessional/system_config_source_identifiers</source_model>
|
351 |
-
<sort_order>3</sort_order>
|
352 |
-
<show_in_default>1</show_in_default>
|
353 |
-
<show_in_website>1</show_in_website>
|
354 |
-
<show_in_store>1</show_in_store>
|
355 |
-
</id>
|
356 |
-
<value translate="label comment">
|
357 |
-
<label>What value does this identifier have?</label>
|
358 |
-
<frontend_type>text</frontend_type>
|
359 |
-
<sort_order>4</sort_order>
|
360 |
-
<show_in_default>1</show_in_default>
|
361 |
-
<show_in_website>1</show_in_website>
|
362 |
-
<show_in_store>1</show_in_store>
|
363 |
-
</value>
|
364 |
-
<remove translate="label,comment">
|
365 |
-
<label>Do you want to remove this section completely?</label>
|
366 |
-
<frontend_type>select</frontend_type>
|
367 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
368 |
-
<sort_order>5</sort_order>
|
369 |
-
<show_in_default>1</show_in_default>
|
370 |
-
<show_in_website>1</show_in_website>
|
371 |
-
<show_in_store>1</show_in_store>
|
372 |
-
</remove>
|
373 |
-
</fields>
|
374 |
-
</cart_item_price>
|
375 |
-
<add_to_cart translate="label">
|
376 |
-
<label>Add to cart button</label>
|
377 |
-
<frontend_type>text</frontend_type>
|
378 |
-
<sort_order>8</sort_order>
|
379 |
-
<show_in_default>1</show_in_default>
|
380 |
-
<show_in_website>1</show_in_website>
|
381 |
-
<show_in_store>1</show_in_store>
|
382 |
-
<fields>
|
383 |
-
<replace translate="label,comment">
|
384 |
-
<label>Replace the add to cart button</label>
|
385 |
-
<frontend_type>select</frontend_type>
|
386 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
387 |
-
<sort_order>1</sort_order>
|
388 |
-
<show_in_default>1</show_in_default>
|
389 |
-
<show_in_website>1</show_in_website>
|
390 |
-
<show_in_store>1</show_in_store>
|
391 |
-
</replace>
|
392 |
-
<tag translate="label comment">
|
393 |
-
<label>What tag wraps the add to cart button?</label>
|
394 |
-
<frontend_type>select</frontend_type>
|
395 |
-
<source_model>b2bprofessional/system_config_source_tags</source_model>
|
396 |
-
<sort_order>2</sort_order>
|
397 |
-
<show_in_default>1</show_in_default>
|
398 |
-
<show_in_website>1</show_in_website>
|
399 |
-
<show_in_store>1</show_in_store>
|
400 |
-
</tag>
|
401 |
-
<id translate="label comment">
|
402 |
-
<label>What identifier does this tag have?</label>
|
403 |
-
<frontend_type>select</frontend_type>
|
404 |
-
<source_model>b2bprofessional/system_config_source_identifiers</source_model>
|
405 |
-
<sort_order>3</sort_order>
|
406 |
-
<show_in_default>1</show_in_default>
|
407 |
-
<show_in_website>1</show_in_website>
|
408 |
-
<show_in_store>1</show_in_store>
|
409 |
-
</id>
|
410 |
-
<value translate="label comment">
|
411 |
-
<label>What value does this identifier have?</label>
|
412 |
-
<frontend_type>text</frontend_type>
|
413 |
-
<sort_order>4</sort_order>
|
414 |
-
<show_in_default>1</show_in_default>
|
415 |
-
<show_in_website>1</show_in_website>
|
416 |
-
<show_in_store>1</show_in_store>
|
417 |
-
</value>
|
418 |
-
<remove translate="label,comment">
|
419 |
-
<label>Do you want to remove this section completely?</label>
|
420 |
-
<frontend_type>select</frontend_type>
|
421 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
422 |
-
<sort_order>5</sort_order>
|
423 |
-
<show_in_default>1</show_in_default>
|
424 |
-
<show_in_website>1</show_in_website>
|
425 |
-
<show_in_store>1</show_in_store>
|
426 |
-
</remove>
|
427 |
-
</fields>
|
428 |
-
</add_to_cart>
|
429 |
-
</groups>
|
430 |
-
</b2bprofessional>
|
431 |
-
</sections>
|
432 |
</config>
|
2 |
<!--
|
3 |
/**
|
4 |
* sytem.xml
|
5 |
+
* - create admin config tab,
|
6 |
+
* - assign admin config fields to sections
|
7 |
*
|
8 |
* @category Sitewards
|
9 |
* @package Sitewards_B2BProfessional
|
10 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
14 |
+
<tabs>
|
15 |
+
<b2bprofessional translate="label" module="sitewards_b2bprofessional">
|
16 |
+
<label>B2B Professional</label>
|
17 |
+
<sort_order>301</sort_order>
|
18 |
+
</b2bprofessional>
|
19 |
+
</tabs>
|
20 |
+
<sections>
|
21 |
+
<b2bprofessional translate="label" module="sitewards_b2bprofessional">
|
22 |
+
<label>B2B Professional</label>
|
23 |
+
<tab>general</tab>
|
24 |
+
<frontend_type>text</frontend_type>
|
25 |
+
<sort_order>990</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
<groups>
|
30 |
+
<generalsettings translate="label">
|
31 |
+
<label>General settings</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>1</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
<fields>
|
38 |
+
<active translate="label,comment">
|
39 |
+
<label>Enable B2B extension</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
42 |
+
<sort_order>1</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<comment><![CDATA[Enable or disable extension. Customer activation behaviour can be configured under <br />"Customer Configuration > Customer activation"]]></comment>
|
47 |
+
</active>
|
48 |
+
<activecustomers translate="label comment">
|
49 |
+
<label>Global customer activation</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
52 |
+
<sort_order>2</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
<comment><![CDATA[Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for.]]></comment>
|
57 |
+
</activecustomers>
|
58 |
+
</fields>
|
59 |
+
</generalsettings>
|
60 |
+
<requirelogin>
|
61 |
+
<label>Require User Login</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>2</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
<fields>
|
68 |
+
<requirelogin translate="label comment">
|
69 |
+
<label>Require User Login</label>
|
70 |
+
<frontend_type>select</frontend_type>
|
71 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
72 |
+
<sort_order>3</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
<comment><![CDATA[The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed.]]></comment>
|
77 |
+
</requirelogin>
|
78 |
+
<requireloginredirect translate="label comment">
|
79 |
+
<label>Redirect User To Page</label>
|
80 |
+
<frontend_type>select</frontend_type>
|
81 |
+
<source_model>sitewards_b2bprofessional/system_config_source_page</source_model>
|
82 |
+
<sort_order>6</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
<comment><![CDATA[Select which page to redirect a user to.]]></comment>
|
87 |
+
</requireloginredirect>
|
88 |
+
</fields>
|
89 |
+
</requirelogin>
|
90 |
+
<activatebycategorysettings translate="label comment">
|
91 |
+
<label>Activate by category</label>
|
92 |
+
<frontend_type>text</frontend_type>
|
93 |
+
<sort_order>4</sort_order>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>1</show_in_store>
|
97 |
+
<fields>
|
98 |
+
<activebycategory translate="label comment">
|
99 |
+
<label>Activate by category</label>
|
100 |
+
<frontend_type>select</frontend_type>
|
101 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
102 |
+
<sort_order>5</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
<comment><![CDATA[Activate extension only for categories selected below]]></comment>
|
107 |
+
</activebycategory>
|
108 |
+
<activecategories translate="label comment">
|
109 |
+
<label>Active categories</label>
|
110 |
+
<frontend_type>multiselect</frontend_type>
|
111 |
+
<source_model>sitewards_b2bprofessional/system_config_source_category</source_model>
|
112 |
+
<sort_order>6</sort_order>
|
113 |
+
<show_in_default>1</show_in_default>
|
114 |
+
<show_in_website>1</show_in_website>
|
115 |
+
<show_in_store>1</show_in_store>
|
116 |
+
<comment><![CDATA[Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.]]></comment>
|
117 |
+
<depends>
|
118 |
+
<activebycategory>1</activebycategory>
|
119 |
+
</depends>
|
120 |
+
</activecategories>
|
121 |
+
</fields>
|
122 |
+
</activatebycategorysettings>
|
123 |
+
<activatebycustomersettings translate="label comment">
|
124 |
+
<label>Activate by customer group</label>
|
125 |
+
<frontend_type>text</frontend_type>
|
126 |
+
<sort_order>5</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>1</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
<comment><![CDATA[When activating this extension by customer group users in the selected group will not be able to see prices, plus the guest user is also included.]]></comment>
|
131 |
+
<fields>
|
132 |
+
<activebycustomer translate="label comment">
|
133 |
+
<label>Activate by customer group</label>
|
134 |
+
<frontend_type>select</frontend_type>
|
135 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
136 |
+
<sort_order>5</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
<comment><![CDATA[Activate extension only for customer groups selected below]]></comment>
|
141 |
+
</activebycustomer>
|
142 |
+
<activecustomers translate="label comment">
|
143 |
+
<label>Active customer groups</label>
|
144 |
+
<frontend_type>multiselect</frontend_type>
|
145 |
+
<source_model>adminhtml/system_config_source_customer_group</source_model>
|
146 |
+
<sort_order>6</sort_order>
|
147 |
+
<show_in_default>1</show_in_default>
|
148 |
+
<show_in_website>1</show_in_website>
|
149 |
+
<show_in_store>1</show_in_store>
|
150 |
+
<comment><![CDATA[Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.]]></comment>
|
151 |
+
<depends>
|
152 |
+
<activebycustomer>1</activebycustomer>
|
153 |
+
</depends>
|
154 |
+
</activecustomers>
|
155 |
+
</fields>
|
156 |
+
</activatebycustomersettings>
|
157 |
+
</groups>
|
158 |
+
</b2bprofessional>
|
159 |
+
</sections>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
</config>
|
app/code/community/Sitewards/B2BProfessional/sql/sitewards_b2bprofessional/upgrade-2.3.0-2.4.0.php
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$oInstaller = $this;
|
3 |
-
$oInstaller->startSetup();
|
4 |
-
$oInstaller->run("
|
5 |
-
CREATE TABLE IF NOT EXISTS {$this->getTable('sales_quote_b2bprofessional')} (
|
6 |
-
`id` int(11) unsigned NOT NULL auto_increment,
|
7 |
-
`quote_id` int(11) unsigned NOT NULL,
|
8 |
-
`key` varchar(255) NOT NULL,
|
9 |
-
`value` text NOT NULL,
|
10 |
-
PRIMARY KEY (`id`)
|
11 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
12 |
-
CREATE TABLE IF NOT EXISTS {$this->getTable('sales_order_b2bprofessional')} (
|
13 |
-
`id` int(11) unsigned NOT NULL auto_increment,
|
14 |
-
`order_id` int(11) unsigned NOT NULL,
|
15 |
-
`key` varchar(255) NOT NULL,
|
16 |
-
`value` text NOT NULL,
|
17 |
-
PRIMARY KEY (`id`)
|
18 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
19 |
-
");
|
20 |
-
$oInstaller->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/sitewards/b2bprofessional.xml
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<adminhtml_sales_order_view>
|
4 |
-
<reference name="order_info">
|
5 |
-
<action method='setTemplate'>
|
6 |
-
<template>sitewards/b2bprofessional/sales/order/info.phtml</template>
|
7 |
-
</action>
|
8 |
-
<block type="adminhtml/sales_order_view_info" name="order_info2"
|
9 |
-
template="sales/order/view/info.phtml"></block>
|
10 |
-
<block type="b2bprofessional/adminhtml_order" name="b2bprofessional.order" template='sitewards/b2bprofessional/order.phtml'/>
|
11 |
-
</reference>
|
12 |
-
</adminhtml_sales_order_view>
|
13 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/sitewards/b2bprofessional/order.phtml
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<div class="box-left">
|
2 |
-
<div class="entry-edit">
|
3 |
-
<div class="entry-edit-head">
|
4 |
-
<h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Additional') ?></h4>
|
5 |
-
</div>
|
6 |
-
<div class="fieldset">
|
7 |
-
<table cellspacing="0" class="form-list">
|
8 |
-
<?php
|
9 |
-
$aData = $this->getB2BProfessionalVars();
|
10 |
-
foreach ($aData as $sKey => $sValue) {
|
11 |
-
?>
|
12 |
-
<tr>
|
13 |
-
<td style="width:10%" class="label"><strong><?php echo Mage::helper('sales')->__($sKey) ?></strong></td>
|
14 |
-
<td class="value"><?php echo $sValue; ?></td>
|
15 |
-
</tr>
|
16 |
-
<?php }
|
17 |
-
?>
|
18 |
-
</table>
|
19 |
-
</div>
|
20 |
-
</div>
|
21 |
-
</div>
|
22 |
-
<div class="clear"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/sitewards/b2bprofessional/sales/order/info.phtml
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php echo $this->getChildHtml('order_info2'); ?>
|
2 |
-
<?php echo $this->getChildHtml('b2bprofessional.order'); ?>
|
|
|
|
app/design/frontend/base/default/layout/sitewards/b2bprofessional.xml
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?xml version="1.0" ?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* layout.xml
|
5 |
-
* - adds link "New Order Form"
|
6 |
-
* - sets customer_account design for order form
|
7 |
-
* - integrates module specific javascript on order form
|
8 |
-
*
|
9 |
-
* @category Sitewards
|
10 |
-
* @package Sitewards_B2BProfessional
|
11 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
12 |
-
*/
|
13 |
-
-->
|
14 |
-
<layout version="0.1.0">
|
15 |
-
<customer_account>
|
16 |
-
<reference name="customer_account_navigation">
|
17 |
-
<action method="addLink" ifconfig="b2bprofessional/generalsettings/active" translate="label" module="b2bprofessional">
|
18 |
-
<name>order_form</name>
|
19 |
-
<path>b2bprofessional/order/form</path>
|
20 |
-
<label>New Order Form</label>
|
21 |
-
</action>
|
22 |
-
</reference>
|
23 |
-
</customer_account>
|
24 |
-
<sitewards_b2bprofessional_order_form translate="label" module="b2bprofessional">
|
25 |
-
<label>New Order Form</label>
|
26 |
-
<update handle="customer_account"/>
|
27 |
-
<reference name="my.account.wrapper">
|
28 |
-
<block type="b2bprofessional/order_form" name="order_form"
|
29 |
-
template="sitewards/b2bprofessional/order/form.phtml"/>
|
30 |
-
</reference>
|
31 |
-
<reference name="head">
|
32 |
-
<action method="addJs">
|
33 |
-
<script>sitewards/b2bprofessional.js</script>
|
34 |
-
</action>
|
35 |
-
<action method="addCss">
|
36 |
-
<name>css/sitewards/b2bprofessional.css</name>
|
37 |
-
</action>
|
38 |
-
</reference>
|
39 |
-
</sitewards_b2bprofessional_order_form>
|
40 |
-
<checkout_onepage_index>
|
41 |
-
<reference name="checkout.onepage.billing">
|
42 |
-
<action method="setTemplate">
|
43 |
-
<value>sitewards/b2bprofessional/checkout/billing/extra.phtml</value>
|
44 |
-
</action>
|
45 |
-
</reference>
|
46 |
-
<reference name="head">
|
47 |
-
<reference name="head">
|
48 |
-
<action method="addItem">
|
49 |
-
<type>js_css</type>
|
50 |
-
<name>calendar/calendar-system.css</name>
|
51 |
-
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
52 |
-
</action>
|
53 |
-
<action method="addItem">
|
54 |
-
<type>js</type>
|
55 |
-
<name>calendar/calendar.js</name>
|
56 |
-
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
57 |
-
</action>
|
58 |
-
<action method="addItem">
|
59 |
-
<type>js</type>
|
60 |
-
<name>calendar/calendar-setup.js</name>
|
61 |
-
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
62 |
-
</action>
|
63 |
-
<action method="addItem">
|
64 |
-
<type>js</type>
|
65 |
-
<name>sitewards/b2bprofessional.js</name>
|
66 |
-
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
67 |
-
</action>
|
68 |
-
</reference>
|
69 |
-
</reference>
|
70 |
-
</checkout_onepage_index>
|
71 |
-
<sales_order_view>
|
72 |
-
<reference name="my.account.wrapper">
|
73 |
-
<block type="b2bprofessional/order" name="b2bprofessional.order" template="sitewards/b2bprofessional/order.phtml"
|
74 |
-
after='sales.order.info'/>
|
75 |
-
</reference>
|
76 |
-
</sales_order_view>
|
77 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/checkbox.phtml
DELETED
@@ -1,52 +0,0 @@
|
|
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) 2013 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 |
-
?>
|
28 |
-
|
29 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox */ ?>
|
30 |
-
<?php $_option = $this->getOption() ?>
|
31 |
-
<?php $_selections = $_option->getSelections() ?>
|
32 |
-
<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->escapeHtml($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label></dt>
|
33 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
34 |
-
<div class="input-box">
|
35 |
-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
|
36 |
-
<?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
|
37 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
38 |
-
<?php else:?>
|
39 |
-
<ul class="options-list">
|
40 |
-
<?php foreach($_selections as $_selection): ?>
|
41 |
-
<li><input onclick="bundle.changeSelection(this)" class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>"/>
|
42 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionQtyTitlePrice($_selection); endif;?></label></span>
|
43 |
-
<?php if($_option->getRequired()): ?>
|
44 |
-
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
|
45 |
-
<?php endif; ?>
|
46 |
-
</li>
|
47 |
-
<?php endforeach; ?>
|
48 |
-
</ul>
|
49 |
-
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
|
50 |
-
<?php endif; ?>
|
51 |
-
</div>
|
52 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/multi.phtml
DELETED
@@ -1,49 +0,0 @@
|
|
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) 2013 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 |
-
?>
|
28 |
-
|
29 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi */ ?>
|
30 |
-
<?php $_option = $this->getOption() ?>
|
31 |
-
<?php $_selections = $_option->getSelections() ?>
|
32 |
-
<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->escapeHtml($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label></dt>
|
33 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
34 |
-
<div class="input-box">
|
35 |
-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
|
36 |
-
<?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
|
37 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
38 |
-
<?php else: ?>
|
39 |
-
<select onchange="bundle.changeSelection(this)" multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname">
|
40 |
-
<?php if(!$_option->getRequired()): ?>
|
41 |
-
<option value=""><?php echo $this->__('None') ?></option>
|
42 |
-
<?php endif; ?>
|
43 |
-
<?php foreach ($_selections as $_selection): ?>
|
44 |
-
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionQtyTitlePrice($_selection, false); endif;?></option>
|
45 |
-
<?php endforeach; ?>
|
46 |
-
</select>
|
47 |
-
<?php endif; ?>
|
48 |
-
</div>
|
49 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/radio.phtml
DELETED
@@ -1,74 +0,0 @@
|
|
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) 2013 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 |
-
?>
|
28 |
-
|
29 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio */ ?>
|
30 |
-
<?php $_option = $this->getOption(); ?>
|
31 |
-
<?php $_selections = $_option->getSelections(); ?>
|
32 |
-
<?php $_default = $_option->getDefaultSelection(); ?>
|
33 |
-
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
|
34 |
-
<?php $tierPriceHtml = ''; ?>
|
35 |
-
|
36 |
-
<dt>
|
37 |
-
<label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->escapeHtml($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label>
|
38 |
-
</dt>
|
39 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
40 |
-
<div class="input-box">
|
41 |
-
<?php /** @var $_selection Mage_Catalog_Model_Product*/ ?>
|
42 |
-
<?php if ($this->_showSingle()): ?>
|
43 |
-
<?php echo $this->getSelectionTitlePrice($_selections[0]); ?>
|
44 |
-
<?php if ($_selections[0]->getSelectionCanChangeQty()): ?>
|
45 |
-
<?php $tierPriceHtml = $this->getTierPriceHtml($_selections[0]); ?>
|
46 |
-
<?php endif; ?>
|
47 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" />
|
48 |
-
<?php else:?>
|
49 |
-
<ul class="options-list">
|
50 |
-
<?php if (!$_option->getRequired()): ?>
|
51 |
-
<li><input type="radio" onclick="bundle.changeSelection(this)" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value=""/>
|
52 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo $this->__('None') ?></label></span>
|
53 |
-
</li>
|
54 |
-
<?php endif; ?>
|
55 |
-
<?php foreach ($_selections as $_selection): ?>
|
56 |
-
<?php if ($_selection->getSelectionCanChangeQty() && $this->_isSelected($_selection)): ?>
|
57 |
-
<?php $tierPriceHtml = $this->getTierPriceHtml($_selection); ?>
|
58 |
-
<?php endif; ?>
|
59 |
-
<li><input type="radio" onclick="bundle.changeSelection(this)" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>"/>
|
60 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionTitlePrice($_selection); endif;?></label></span>
|
61 |
-
<?php if ($_option->getRequired()): ?>
|
62 |
-
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
|
63 |
-
<?php endif; ?>
|
64 |
-
</li>
|
65 |
-
<?php endforeach; ?>
|
66 |
-
</ul>
|
67 |
-
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
|
68 |
-
<?php endif; ?>
|
69 |
-
</div>
|
70 |
-
<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?></span>
|
71 |
-
<span class="qty-holder">
|
72 |
-
<label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
|
73 |
-
</span>
|
74 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-post-180/select.phtml
DELETED
@@ -1,63 +0,0 @@
|
|
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) 2013 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 |
-
|
28 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select */ ?>
|
29 |
-
<?php $_option = $this->getOption(); ?>
|
30 |
-
<?php $_selections = $_option->getSelections(); ?>
|
31 |
-
<?php $_default = $_option->getDefaultSelection(); ?>
|
32 |
-
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
|
33 |
-
<?php $tierPriceHtml = ''; ?>
|
34 |
-
|
35 |
-
<dt>
|
36 |
-
<label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->escapeHtml($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label>
|
37 |
-
</dt>
|
38 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
39 |
-
<div class="input-box">
|
40 |
-
<?php /** @var $_selection Mage_Catalog_Model_Product*/ ?>
|
41 |
-
<?php if ($this->_showSingle()): ?>
|
42 |
-
<?php echo $this->getSelectionTitlePrice($_selections[0]); ?>
|
43 |
-
<?php if ($_selections[0]->getSelectionCanChangeQty()): ?>
|
44 |
-
<?php $tierPriceHtml = $this->getTierPriceHtml($_selections[0]); ?>
|
45 |
-
<?php endif; ?>
|
46 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
47 |
-
<?php else:?>
|
48 |
-
<select onchange="bundle.changeSelection(this)" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname">
|
49 |
-
<option value=""><?php echo $this->__('Choose a selection...') ?></option>
|
50 |
-
<?php foreach ($_selections as $_selection): ?>
|
51 |
-
<?php if ($_selection->getSelectionCanChangeQty() && $this->_isSelected($_selection)): ?>
|
52 |
-
<?php $tierPriceHtml = $this->getTierPriceHtml($_selection); ?>
|
53 |
-
<?php endif; ?>
|
54 |
-
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionTitlePrice($_selection, false); endif;?></option>
|
55 |
-
<?php endforeach; ?>
|
56 |
-
</select>
|
57 |
-
<?php endif; ?>
|
58 |
-
</div>
|
59 |
-
<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?></span>
|
60 |
-
<span class="qty-holder">
|
61 |
-
<label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
|
62 |
-
</span>
|
63 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/checkbox.phtml
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bundle product checkbox option price template
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
?>
|
10 |
-
|
11 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Checkbox */ ?>
|
12 |
-
<?php $_option = $this->getOption() ?>
|
13 |
-
<?php $_selections = $_option->getSelections() ?>
|
14 |
-
<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->htmlEscape($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label></dt>
|
15 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
16 |
-
<div class="input-box">
|
17 |
-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
|
18 |
-
<?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
|
19 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
20 |
-
<?php else:?>
|
21 |
-
<ul class="options-list">
|
22 |
-
<?php foreach($_selections as $_selection): ?>
|
23 |
-
<li><input onclick="bundle.changeSelection(this)" class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>"/>
|
24 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionQtyTitlePrice($_selection); endif;?></label></span>
|
25 |
-
<?php if($_option->getRequired()): ?>
|
26 |
-
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
|
27 |
-
<?php endif; ?>
|
28 |
-
</li>
|
29 |
-
<?php endforeach; ?>
|
30 |
-
</ul>
|
31 |
-
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
|
32 |
-
<?php endif; ?>
|
33 |
-
</div>
|
34 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/multi.phtml
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bundle product multiselect option price template
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
?>
|
10 |
-
|
11 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Multi */ ?>
|
12 |
-
<?php $_option = $this->getOption() ?>
|
13 |
-
<?php $_selections = $_option->getSelections() ?>
|
14 |
-
<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->htmlEscape($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label></dt>
|
15 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
16 |
-
<div class="input-box">
|
17 |
-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
|
18 |
-
<?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
|
19 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
20 |
-
<?php else: ?>
|
21 |
-
<select onchange="bundle.changeSelection(this)" multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname">
|
22 |
-
<?php if(!$_option->getRequired()): ?>
|
23 |
-
<option value=""><?php echo $this->__('None') ?></option>
|
24 |
-
<?php endif; ?>
|
25 |
-
<?php foreach ($_selections as $_selection): ?>
|
26 |
-
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionQtyTitlePrice($_selection, false); endif;?></option>
|
27 |
-
<?php endforeach; ?>
|
28 |
-
</select>
|
29 |
-
<?php endif; ?>
|
30 |
-
</div>
|
31 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/radio.phtml
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bundle product radio option price template
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
?>
|
10 |
-
|
11 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Radio */ ?>
|
12 |
-
<?php $_option = $this->getOption(); ?>
|
13 |
-
<?php $_selections = $_option->getSelections(); ?>
|
14 |
-
<?php $_default = $_option->getDefaultSelection(); ?>
|
15 |
-
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
|
16 |
-
|
17 |
-
<dt>
|
18 |
-
<label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->htmlEscape($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label>
|
19 |
-
</dt>
|
20 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
21 |
-
<div class="input-box">
|
22 |
-
<?php if ($this->_showSingle()): ?>
|
23 |
-
<?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
|
24 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" />
|
25 |
-
<?php else:?>
|
26 |
-
<ul class="options-list">
|
27 |
-
<?php if (!$_option->getRequired()): ?>
|
28 |
-
<li><input type="radio" onclick="bundle.changeSelection(this)" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value=""/>
|
29 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo $this->__('None') ?></label></span>
|
30 |
-
</li>
|
31 |
-
<?php endif; ?>
|
32 |
-
<?php foreach ($_selections as $_selection): ?>
|
33 |
-
<li><input type="radio" onclick="bundle.changeSelection(this)" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>"/>
|
34 |
-
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionTitlePrice($_selection); endif;?></label></span>
|
35 |
-
<?php if ($_option->getRequired()): ?>
|
36 |
-
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
|
37 |
-
<?php endif; ?>
|
38 |
-
</li>
|
39 |
-
<?php endforeach; ?>
|
40 |
-
</ul>
|
41 |
-
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
|
42 |
-
<?php endif; ?>
|
43 |
-
</div>
|
44 |
-
<span class="qty-holder">
|
45 |
-
<label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
|
46 |
-
</span>
|
47 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/catalog/product/view/type/bundle/option-pre-180/select.phtml
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Bundle product select option price template
|
4 |
-
*
|
5 |
-
* @category Sitewards
|
6 |
-
* @package Sitewards_B2BProfessional
|
7 |
-
* @copyright Copyright (c) 2013 Sitewards GmbH (http://www.sitewards.com/)
|
8 |
-
*/
|
9 |
-
?>
|
10 |
-
|
11 |
-
<?php /* @var $this Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option_Select */ ?>
|
12 |
-
<?php $_option = $this->getOption(); ?>
|
13 |
-
<?php $_selections = $_option->getSelections(); ?>
|
14 |
-
<?php $_default = $_option->getDefaultSelection(); ?>
|
15 |
-
<?php list($_defaultQty, $_canChangeQty) = $this->_getDefaultValues(); ?>
|
16 |
-
|
17 |
-
<dt>
|
18 |
-
<label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php echo $this->htmlEscape($_option->getTitle()) ?><?php if ($_option->getRequired()) echo '<em>*</em>' ?></label>
|
19 |
-
</dt>
|
20 |
-
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
|
21 |
-
<div class="input-box">
|
22 |
-
<?php if ($this->_showSingle()): ?>
|
23 |
-
<?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
|
24 |
-
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>"/>
|
25 |
-
<?php else:?>
|
26 |
-
<select onchange="bundle.changeSelection(this)" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname">
|
27 |
-
<option value=""><?php echo $this->__('Choose a selection...') ?></option>
|
28 |
-
<?php foreach ($_selections as $_selection): ?>
|
29 |
-
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable()) echo ' disabled="disabled"' ?>><?php if (Mage::helper('b2bprofessional')->isProductActive($_selection->getId())): echo $_selection->getName(); else: echo $this->getSelectionTitlePrice($_selection, false); endif;?></option>
|
30 |
-
<?php endforeach; ?>
|
31 |
-
</select>
|
32 |
-
<?php endif; ?>
|
33 |
-
</div>
|
34 |
-
<span class="qty-holder">
|
35 |
-
<label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/>
|
36 |
-
</span>
|
37 |
-
</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/checkout/billing/extra.phtml
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @var $this Mage_Checkout_Block_Onepage_Billing
|
4 |
-
*/
|
5 |
-
$sDeliveryDate =
|
6 |
-
'<span class="form-list">' .
|
7 |
-
'<label for="delivery_date">' . $this->__('Order Date:') .
|
8 |
-
'</label> </span> <input
|
9 |
-
type="text"
|
10 |
-
id="delivery_date"
|
11 |
-
name="b2bprofessional[delivery_date]"
|
12 |
-
value="' . $this->escapeHtml($this->getQuote()->getDeliveryDate()) . '"
|
13 |
-
title="' . $this->__('Order Date') . '"
|
14 |
-
class="input-text validate-date"
|
15 |
-
id="b2bprofessional:delivery_date" />'.
|
16 |
-
'<script type="text/javascript">'.
|
17 |
-
' document.observe("dom:loaded", (function () {'.
|
18 |
-
' var oOrderDatePicker = new OrderDatePicker();'.
|
19 |
-
' oOrderDatePicker.initialize();'.
|
20 |
-
' }));'.
|
21 |
-
'</script>'
|
22 |
-
;
|
23 |
-
|
24 |
-
$this->setTemplate('persistent/checkout/onepage/billing.phtml');
|
25 |
-
$sHtml = $this->toHtml();
|
26 |
-
// replace field in the billing.phtml, so we don't have to rewrite full billing.phtml and this is a bit more upgrade safe
|
27 |
-
$iPosition = strpos($sHtml, '<div class="buttons-set" id="billing-buttons-container">');
|
28 |
-
echo substr($sHtml, 0, $iPosition) .
|
29 |
-
$sDeliveryDate .
|
30 |
-
substr($sHtml, $iPosition);
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/order.phtml
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<div class="col-set order-info-box">
|
2 |
-
<div class="col">
|
3 |
-
<div class="box">
|
4 |
-
<div class="box-title">
|
5 |
-
<h2><?php echo $this->__('Additional') ?></h2>
|
6 |
-
</div>
|
7 |
-
<div class="box-content">
|
8 |
-
<?php
|
9 |
-
$aData = $this->getB2BProfessionalVars();
|
10 |
-
foreach ($aData as $sKey => $sValue) {
|
11 |
-
?>
|
12 |
-
<b><?php echo $this->__($sKey); ?></b> : <?php echo $sValue; ?> <br/>
|
13 |
-
<?php }
|
14 |
-
if ($this->canCancel()) {
|
15 |
-
?>
|
16 |
-
<div><a href="<?php echo $this->getCancelUrl(); ?>"><?php echo $this->__('Cancel order'); ?></a></div>
|
17 |
-
<?php } ?>
|
18 |
-
</div>
|
19 |
-
</div>
|
20 |
-
</div>
|
21 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sitewards/b2bprofessional/order/form.phtml
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php echo $this
|
2 |
-
->getMessagesBlock()
|
3 |
-
->getGroupedHtml() ?>
|
4 |
-
<ul class="messages" style="display: none;"><li class="error-msg"><ul><li></li></ul></li></ul>
|
5 |
-
<div class="fieldset">
|
6 |
-
<form method="POST" id="order_form" action="<?php echo $this->getUrl('checkout/cart/addmultiple'); ?>">
|
7 |
-
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')
|
8 |
-
->getFormKey(); ?>"/>
|
9 |
-
<table>
|
10 |
-
<thead>
|
11 |
-
<tr>
|
12 |
-
<th><?php echo $this->__('SKU'); ?></th>
|
13 |
-
<th><?php echo $this->__('Name'); ?></th>
|
14 |
-
<th><?php echo $this->__('Price'); ?></th>
|
15 |
-
<th><?php echo $this->__('Quantity'); ?></th>
|
16 |
-
<th><?php echo $this->__('Action'); ?></th>
|
17 |
-
</tr>
|
18 |
-
</thead>
|
19 |
-
<tbody>
|
20 |
-
<tr class="product">
|
21 |
-
<td><input type="text" name="sku[]" class="sku input-text"/></td>
|
22 |
-
<td class="name"></td>
|
23 |
-
<td class="price"></td>
|
24 |
-
<td><input type="text" name="qty[]" class="qty input-text" disabled="disabled"/></td>
|
25 |
-
<td><a class="remove"><?php echo $this->__('Remove this entry'); ?></a></td>
|
26 |
-
</tr>
|
27 |
-
</tbody>
|
28 |
-
</table>
|
29 |
-
<input type="submit" value="<?php echo $this->__('Submit Data')?>" title="<?php echo $this->__('Submit Data')?>"/>
|
30 |
-
</form>
|
31 |
-
<div class="invisible">
|
32 |
-
<img class="loading" src="<?php echo $this->getSkinUrl('images/sitewards/loading.gif'); ?>"/>
|
33 |
-
</div>
|
34 |
-
</div>
|
35 |
-
<script type="text/javascript">
|
36 |
-
Translator.add('The product does not exist.', '<?php echo $this->__('The product does not exist.')?>');
|
37 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Sitewards_B2BProfessional.xml
CHANGED
@@ -2,28 +2,25 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional.xml
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
*
|
9 |
* @category Sitewards
|
10 |
* @package Sitewards_B2BProfessional
|
11 |
-
* @copyright Copyright (c)
|
12 |
*/
|
13 |
-->
|
14 |
<config>
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
</depends>
|
27 |
-
</Sitewards_B2BProfessional>
|
28 |
-
</modules>
|
29 |
</config>
|
2 |
<!--
|
3 |
/**
|
4 |
* Sitewards_B2BProfessional.xml
|
5 |
+
* - Activate module,
|
6 |
+
* - Specify code pool,
|
7 |
+
* - Set-up dependencies
|
8 |
*
|
9 |
* @category Sitewards
|
10 |
* @package Sitewards_B2BProfessional
|
11 |
+
* @copyright Copyright (c) 2014 Sitewards GmbH (http://www.sitewards.com/)
|
12 |
*/
|
13 |
-->
|
14 |
<config>
|
15 |
+
<modules>
|
16 |
+
<Sitewards_B2BProfessional>
|
17 |
+
<active>true</active>
|
18 |
+
<codePool>community</codePool>
|
19 |
+
<depends>
|
20 |
+
<Mage_Catalog />
|
21 |
+
<Mage_Customer />
|
22 |
+
<Netzarbeiter_CustomerActivation/>
|
23 |
+
</depends>
|
24 |
+
</Sitewards_B2BProfessional>
|
25 |
+
</modules>
|
|
|
|
|
|
|
26 |
</config>
|
app/locale/de_DE/Sitewards_B2BProfessional.csv
CHANGED
@@ -2,57 +2,18 @@
|
|
2 |
"Please login","Bitte einloggen"
|
3 |
"General settings","Allgemeine Einstellungen"
|
4 |
"Enable B2B extension","B2B Extension aktivieren"
|
5 |
-
"Global customer activation","Globale Kundenaktivierung"
|
6 |
-
"Language settings","Spracheinstellungen"
|
7 |
-
"Override language file","Sprachdateien ignorieren"
|
8 |
-
"Custom text for price","Text für Preis"
|
9 |
-
"Custom text for checkout-error","Text für Checkout-Fehler"
|
10 |
"Activate by category","Für Kategorien aktivieren"
|
11 |
"Active categories","Aktive Kategorien"
|
12 |
"Activate by customer group","Für Kundengruppen aktivieren"
|
13 |
"Active customer groups","Aktive Kundengruppen"
|
14 |
"Enable or disable extension. Customer activation behaviour can be configured under <br />""Customer Configuration > Customer activation""","Aktivieren oder Deaktivieren der Extension. Verhalten bei der Kundenaktivierung kann konfiguriert werden unter<br />""Kundenkonfiguration > Kundenaktivierung"""
|
15 |
"Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for.","Kunden für alle Ladenansichten aktivieren. Anderenfalls werden sie nur in den Ladenansichten Preise sehen können, für die sie sich registriert haben."
|
16 |
-
"Override language file text with text specified below","Sprachdateien ignorieren und folgenden Text benutzen"
|
17 |
-
"Text to be displayed instead of the prices.<br />Only visible when language override is active.<br />Otherwise text in language file ist used.<br />May contain HTML","Text, der statt der Preise angezeigt wird.<br />Nur sichtbar, wenn ""Sprachdateien ignorieren"" aktiviert ist.<br />Anderenfalls werden die Sprachdateien benutzt.<br />Kann HTML enthalten"
|
18 |
-
"Text to be displayed when customer is not allowed to checkout product.<br />Only visible when language override is active.<br />Otherwise text in language file is used.<br />May contain HTML","Text, der angezeigt wird, wenn der Kunde nicht mit dem Produkt auschecken darf.<br />Nur sichtbar, wenn ""Sprachdateien ignorieren"" aktiviert ist.<br />Anderenfalls werden die Sprachdateien benutzt.<br />Kann HTML enthalten"
|
19 |
"Activate extension only for categories selected below","Extension nur für folgende Kategorien aktivieren"
|
20 |
"Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.","Kategorien auswählen, für die die Extension aktiviert werden soll.<br />Für Mehrfachauswahl Strg-Taste halten.<br />Beachten Sie bitte, dass man nicht mit einem Produkt auschecken kann, wenn er mindestens einer dieser Kategorien zugeordnet ist."
|
21 |
"Activate extension only for customer groups selected below","Extension nur für Kunden aus folgenden Kundengruppen aktivieren."
|
22 |
"Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.","Kundengruppen auswählen, für die die Extension aktiviert werden soll.<br />Für Mehrfachauswahl Strg-Taste halten."
|
23 |
"When activating this extension by customer group the guest user is also included.","Beim Aktivieren von Kundengruppen wird die Extension ebenfalls für Gast-Benutzer freigeschaltet"
|
24 |
-
"You do not have access to view this store.","Sie haben keine Berechtigungen um diese Webshop-Seite zu betrachten."
|
25 |
"Require User Login","Nutzer muss sich einloggen"
|
26 |
"The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed.","Der Nutzer muss sich einloggen bevor Seiten im Shop aufgerufen werden können. <br /> Hinweis: CMS-Seiten sind immer erlaubt."
|
27 |
-
"Require User Login - Message","Nutzer muss sich einloggen - Nachricht"
|
28 |
-
"Text to be displayed when the store requires a user to login to view pages<br />Only visible when language override is active.<br />Otherwise text in language file is used.<br />May contain HTML","Text der angezeigt wird, wenn der Nutzer sich einloggen muss, um eine bestimmte Seite im Shop zu betrachten.<br /> Wird nur verwendet, wenn die Sprache überschrieben wird.<br/>Ansonsten wird der Text aus der Sparchdatei benutzt.<br/> Dieser Text darf HTML beinhalten."
|
29 |
"Redirect User To Page","Nutzer auf Seite weiterleiten"
|
30 |
-
"Select which page to redirect a user to.","Wählen Sie die Seite, auf die der Nutzer weitergeleitet werden soll."
|
31 |
-
"Cart Sidebar Totals","Summen des Sidebar-Warenkorbs"
|
32 |
-
"Replace the sidebar totals","Summen des Sidebar-Warenkorbs ersetzen"
|
33 |
-
"What tag wraps the sidebar totals?","Welcher Tag umschließt die Summen des Sidebar-Warenkorbs?"
|
34 |
-
"What identifier does this tag have?","Welchen Identifier haben die umschließenden Tags?"
|
35 |
-
"What value does this identifier have?","Welchen Wert haben die Identifier?"
|
36 |
-
"Do you want to remove this section completely?","Wollen sie diesen Abschnitt komplett entfernen?"
|
37 |
-
"Cart Sidebar Actions","Aktionen des Sidebar-Warenkobs"
|
38 |
-
"Replace the sidebar actions section","Aktionen des Sidebar-Warenkobs ersetzen"
|
39 |
-
"What tag wraps the sidebar actions?","Welcher Tag umschließt die Aktionen des Sidebar-Warenkorbs?"
|
40 |
-
"Cart Items Price","Preis der Produkte im Warenkorb"
|
41 |
-
"Replace the cart item prices","Preis der Produkte im Warenkorb ersetzen"
|
42 |
-
"What tag wraps the cart item prices?","Welcher Tag umschließt die Preise der Produkte im Warenkorb?"
|
43 |
-
"Add to cart button","In den Warenkorb Button"
|
44 |
-
"Replace the add to cart button","Warenkorb Button ersetzen"
|
45 |
-
"What tag wraps the add to cart button?","Welcher Tag umschließt den Warenkorb Button?"
|
46 |
-
"On \'Add To Cart\' Redirect User To Page","Seite, auf die Nutzer nach dem Hinzufügen eines Produkts zum Warenkorb weitergeleitet werden"
|
47 |
-
"Select which page to redirect a user to when they try to add an invalid product to their cart.","Wählen Sie eine Seite, zu der ein Nutzer weitergeleitet werden soll, wenn versucht wurde, ein ungültiges Produkt in den Warenkorb zu legen."
|
48 |
-
"New Order Form","Neuer Bestellzettel"
|
49 |
-
"Remove this entry","Eintrag entfernen"
|
50 |
-
"The product does not exist.","Dieses Produkt ist nicht vorhanden."
|
51 |
-
"SKU","Artikelnummer"
|
52 |
-
"Name","Name"
|
53 |
-
"Price","Preis"
|
54 |
-
"Quantity","Anzahl"
|
55 |
-
"Action","Aktion"
|
56 |
-
"Submit Data","Daten Senden"
|
57 |
-
"Your account is not allowed to access this product.","Ihr Benutzerkonto ist für dieses Produkt nicht freigeschaltet."
|
58 |
-
"Please enter valid product sku.","Bitte geben Sie eine gültige SKU an."
|
2 |
"Please login","Bitte einloggen"
|
3 |
"General settings","Allgemeine Einstellungen"
|
4 |
"Enable B2B extension","B2B Extension aktivieren"
|
|
|
|
|
|
|
|
|
|
|
5 |
"Activate by category","Für Kategorien aktivieren"
|
6 |
"Active categories","Aktive Kategorien"
|
7 |
"Activate by customer group","Für Kundengruppen aktivieren"
|
8 |
"Active customer groups","Aktive Kundengruppen"
|
9 |
"Enable or disable extension. Customer activation behaviour can be configured under <br />""Customer Configuration > Customer activation""","Aktivieren oder Deaktivieren der Extension. Verhalten bei der Kundenaktivierung kann konfiguriert werden unter<br />""Kundenkonfiguration > Kundenaktivierung"""
|
10 |
"Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for.","Kunden für alle Ladenansichten aktivieren. Anderenfalls werden sie nur in den Ladenansichten Preise sehen können, für die sie sich registriert haben."
|
|
|
|
|
|
|
11 |
"Activate extension only for categories selected below","Extension nur für folgende Kategorien aktivieren"
|
12 |
"Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.","Kategorien auswählen, für die die Extension aktiviert werden soll.<br />Für Mehrfachauswahl Strg-Taste halten.<br />Beachten Sie bitte, dass man nicht mit einem Produkt auschecken kann, wenn er mindestens einer dieser Kategorien zugeordnet ist."
|
13 |
"Activate extension only for customer groups selected below","Extension nur für Kunden aus folgenden Kundengruppen aktivieren."
|
14 |
"Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.","Kundengruppen auswählen, für die die Extension aktiviert werden soll.<br />Für Mehrfachauswahl Strg-Taste halten."
|
15 |
"When activating this extension by customer group the guest user is also included.","Beim Aktivieren von Kundengruppen wird die Extension ebenfalls für Gast-Benutzer freigeschaltet"
|
|
|
16 |
"Require User Login","Nutzer muss sich einloggen"
|
17 |
"The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed.","Der Nutzer muss sich einloggen bevor Seiten im Shop aufgerufen werden können. <br /> Hinweis: CMS-Seiten sind immer erlaubt."
|
|
|
|
|
18 |
"Redirect User To Page","Nutzer auf Seite weiterleiten"
|
19 |
+
"Select which page to redirect a user to.","Wählen Sie die Seite, auf die der Nutzer weitergeleitet werden soll."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/locale/en_US/Sitewards_B2BProfessional.csv
CHANGED
@@ -1,5 +1,19 @@
|
|
1 |
"Your account is not allowed to access this store.","Your account is not allowed to access this store."
|
2 |
"Please login","Please login"
|
3 |
-
"
|
4 |
-
"
|
5 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
"Your account is not allowed to access this store.","Your account is not allowed to access this store."
|
2 |
"Please login","Please login"
|
3 |
+
"General settings","General settings"
|
4 |
+
"Enable B2B extension","Enable B2B extension"
|
5 |
+
"Activate by category","Activate by category"
|
6 |
+
"Active categories","Active categories"
|
7 |
+
"Activate by customer group","Activate by customer group"
|
8 |
+
"Active customer groups","Active customer groups"
|
9 |
+
"Enable or disable extension. Customer activation behaviour can be configured under <br />""Customer Configuration > Customer activation""","Enable or disable extension. Customer activation behaviour can be configured under <br />""Customer Configuration > Customer activation"""
|
10 |
+
"Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for.","Activate customers for all stores. Otherwise they will only see the prices in the store, they have registered for."
|
11 |
+
"Activate extension only for categories selected below","Activate extension only for categories selected below"
|
12 |
+
"Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here.","Select categories for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.<br />Be aware, that a product with multiple categories can not be checked out if one of its categories is selected here."
|
13 |
+
"Activate extension only for customer groups selected below","Activate extension only for customer groups selected below"
|
14 |
+
"Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection.","Select customer groups for which the extension should be active.<br />Hold down Ctrl-key for multiple selection."
|
15 |
+
"When activating this extension by customer group the guest user is also included.","When activating this extension by customer group the guest user is also included."
|
16 |
+
"Require User Login","Require User Login"
|
17 |
+
"The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed.","The user is required to login before they can view pages in this shop. <br /> Note: CMS pages are always allowed."
|
18 |
+
"Redirect User To Page","Redirect User To Page"
|
19 |
+
"Select which page to redirect a user to.","Select which page to redirect a user to."
|
js/sitewards/b2bprofessional.js
DELETED
@@ -1,358 +0,0 @@
|
|
1 |
-
document.observe(
|
2 |
-
'dom:loaded',
|
3 |
-
/**
|
4 |
-
* initializes first product
|
5 |
-
*/
|
6 |
-
function() {
|
7 |
-
var oProduct = new OrderProduct($$('form#order_form .product')[0]);
|
8 |
-
}
|
9 |
-
);
|
10 |
-
|
11 |
-
/**
|
12 |
-
* presentation of a product row
|
13 |
-
*/
|
14 |
-
var OrderProduct = Class.create(
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* prototype element of the .product element
|
18 |
-
*/
|
19 |
-
_oLine: null,
|
20 |
-
|
21 |
-
/**
|
22 |
-
* URL of loading image
|
23 |
-
*/
|
24 |
-
_sLoadingImage: null,
|
25 |
-
|
26 |
-
/**
|
27 |
-
* initializes observer for sku
|
28 |
-
*
|
29 |
-
* @param oLine
|
30 |
-
*/
|
31 |
-
initialize: function (oLine) {
|
32 |
-
if (typeof oLine == 'undefined') {
|
33 |
-
return;
|
34 |
-
}
|
35 |
-
this._oLine = oLine;
|
36 |
-
this.getElement('input.sku').observe(
|
37 |
-
'change',
|
38 |
-
this._onChangeSku.bind(this)
|
39 |
-
);
|
40 |
-
this.getElement('.qty').style.display = 'none';
|
41 |
-
this._sLoadingImage = $$('.sitewards-b2bprofessional-order-form .loading').first().src;
|
42 |
-
|
43 |
-
var that = this;
|
44 |
-
this.getElement('.remove')
|
45 |
-
.observe('click', function (oEvent) {
|
46 |
-
that._onRemove();
|
47 |
-
oEvent.preventDefault();
|
48 |
-
return false;
|
49 |
-
})
|
50 |
-
.hide()
|
51 |
-
;
|
52 |
-
},
|
53 |
-
|
54 |
-
/**
|
55 |
-
* displays more information about product, if allowed
|
56 |
-
*
|
57 |
-
* @private
|
58 |
-
*/
|
59 |
-
_onChangeSku: function () {
|
60 |
-
new Ajax.Request('/b2bprofessional/product/info', {
|
61 |
-
method: 'get',
|
62 |
-
parameters: {
|
63 |
-
'sku' : this.getElement('input.sku').value
|
64 |
-
},
|
65 |
-
requestHeaders: {Accept: 'application/json'},
|
66 |
-
onSuccess: this._onSuccess.bind(this),
|
67 |
-
onFailure: this._onFailure.bind(this)
|
68 |
-
});
|
69 |
-
this.getElement('.name').update('<img src="'+this._sLoadingImage+'">');
|
70 |
-
this.getElement('.qty').style.display = 'none';
|
71 |
-
},
|
72 |
-
|
73 |
-
/**
|
74 |
-
* returns element of this product element
|
75 |
-
*
|
76 |
-
* @param sSelector
|
77 |
-
* @returns {*}
|
78 |
-
*/
|
79 |
-
getElement: function (sSelector) {
|
80 |
-
return this._oLine.down(sSelector);
|
81 |
-
},
|
82 |
-
|
83 |
-
/**
|
84 |
-
* duplicates current line
|
85 |
-
*
|
86 |
-
* @private
|
87 |
-
*/
|
88 |
-
_duplicateLine: function () {
|
89 |
-
var oParent = this._oLine.up();
|
90 |
-
oParent.insert(this._oLine.outerHTML);
|
91 |
-
var oProduct = new OrderProduct(oParent.childElements().last());
|
92 |
-
oProduct._reset();
|
93 |
-
},
|
94 |
-
|
95 |
-
/**
|
96 |
-
* displaysinformation about product
|
97 |
-
*
|
98 |
-
* @param transport
|
99 |
-
* @private
|
100 |
-
*/
|
101 |
-
_onSuccess: function(transport) {
|
102 |
-
this._clearMessages();
|
103 |
-
var oResponse = transport.responseText.evalJSON(true);
|
104 |
-
if (oResponse.result == 0) {
|
105 |
-
var oQty = this.getElement('input.qty');
|
106 |
-
|
107 |
-
oQty.value = Math.max(1, oResponse.qty);
|
108 |
-
oQty.disabled = false;
|
109 |
-
this.getElement('.name').update(oResponse.name);
|
110 |
-
this.getElement('.price').update(oResponse.price);
|
111 |
-
if (this._hasEmptyLineInForm() == false) {
|
112 |
-
this._duplicateLine();
|
113 |
-
}
|
114 |
-
this.getElement('.qty').style.display = 'block';
|
115 |
-
oQty.focus();
|
116 |
-
oQty.select();
|
117 |
-
|
118 |
-
if (this.getElement('input.sku').value.length > 0) {
|
119 |
-
this.getElement('.remove').show();
|
120 |
-
}
|
121 |
-
} else {
|
122 |
-
this._reset();
|
123 |
-
this.getElement('input.sku').value = '';
|
124 |
-
this._showMessage(oResponse.error);
|
125 |
-
this.getElement('input.sku').focus();
|
126 |
-
}
|
127 |
-
},
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Show standard magento message
|
131 |
-
*
|
132 |
-
* @param sText
|
133 |
-
* @param sType
|
134 |
-
* @private
|
135 |
-
*/
|
136 |
-
_showMessage : function (sText) {
|
137 |
-
$$('.messages')[0].style.display = 'block';
|
138 |
-
$$('.messages>li>ul>li')[0].update(sText);
|
139 |
-
},
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Remove all messages
|
143 |
-
*
|
144 |
-
* @private
|
145 |
-
*/
|
146 |
-
_clearMessages : function () {
|
147 |
-
$$('.messages>li>ul>li')[0].update('');
|
148 |
-
$$('.messages')[0].style.display = 'none';
|
149 |
-
},
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Determines if there is an empty line in the form
|
153 |
-
*
|
154 |
-
* @return {Boolean} true if there is an empty line
|
155 |
-
* @private
|
156 |
-
*/
|
157 |
-
_hasEmptyLineInForm : function () {
|
158 |
-
var aLines = this._oLine.up('tbody').select('tr');
|
159 |
-
for (var i=0; i < aLines.length; i++) {
|
160 |
-
var oInput = $(aLines[i]).select('input').first();
|
161 |
-
if (oInput.value == '') {
|
162 |
-
return true;
|
163 |
-
}
|
164 |
-
}
|
165 |
-
return false;
|
166 |
-
},
|
167 |
-
|
168 |
-
/**
|
169 |
-
* resets information about product
|
170 |
-
*
|
171 |
-
* @private
|
172 |
-
*/
|
173 |
-
_reset: function () {
|
174 |
-
this.getElement('input.qty').update('');
|
175 |
-
this.getElement('input.qty').disabled = 'disabled';
|
176 |
-
this.getElement('.name').update('');
|
177 |
-
this.getElement('.price').update('');
|
178 |
-
},
|
179 |
-
|
180 |
-
/**
|
181 |
-
* remove last empty row after a failed ajax request, except current row is last row
|
182 |
-
*
|
183 |
-
* @private
|
184 |
-
*/
|
185 |
-
_removeEmptyRows: function () {
|
186 |
-
var oLastLine = this._oLine.up().childElements().last();
|
187 |
-
if (oLastLine != this._oLine) {
|
188 |
-
oLastLine.remove();
|
189 |
-
}
|
190 |
-
},
|
191 |
-
|
192 |
-
/**
|
193 |
-
* removes the line from the form
|
194 |
-
*
|
195 |
-
* @private
|
196 |
-
*/
|
197 |
-
_onRemove: function () {
|
198 |
-
var oLinesContainer = this._oLine.up();
|
199 |
-
this._oLine.remove();
|
200 |
-
// hide "remove line" if only one line is left
|
201 |
-
if (oLinesContainer.childElements().length <= 1) {
|
202 |
-
oLinesContainer.down('.remove').hide();
|
203 |
-
}
|
204 |
-
},
|
205 |
-
|
206 |
-
/**
|
207 |
-
* called on ajax request failure
|
208 |
-
*
|
209 |
-
* @private
|
210 |
-
*/
|
211 |
-
_onFailure: function () {
|
212 |
-
this._reset();
|
213 |
-
this._removeEmptyRows();
|
214 |
-
this._showMessage(Translator.translate('The product does not exist.'));
|
215 |
-
this.getElement('.name').focus();
|
216 |
-
}
|
217 |
-
}
|
218 |
-
);
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Date picker for the order date
|
222 |
-
*/
|
223 |
-
var OrderDatePicker = Class.create(
|
224 |
-
{
|
225 |
-
/**
|
226 |
-
* Sets up all events of the input fields and
|
227 |
-
* the Calender
|
228 |
-
*/
|
229 |
-
initialize: function () {
|
230 |
-
|
231 |
-
// initialize date picker with correct date format
|
232 |
-
Calendar.setup({
|
233 |
-
inputField : 'delivery_date',
|
234 |
-
ifFormat : '%Y-%m-%d',
|
235 |
-
align : 'Bl',
|
236 |
-
button: 'delivery_date',
|
237 |
-
singleClick : true
|
238 |
-
});
|
239 |
-
|
240 |
-
// initialize the input
|
241 |
-
var oDateInput = $('delivery_date');
|
242 |
-
if (oDateInput.value == '') {
|
243 |
-
var oToday = new Date(),
|
244 |
-
sDay = ('0' + oToday.getDate()).slice(-2),
|
245 |
-
sMonth = ('0' + (oToday.getMonth()+1)).slice(-2),
|
246 |
-
sYear = oToday.getFullYear()
|
247 |
-
;
|
248 |
-
$('delivery_date').value = sYear + '-' + sMonth + '-' + sDay;
|
249 |
-
}
|
250 |
-
// date can only be changed via date picker
|
251 |
-
oDateInput.on('focus', function () {
|
252 |
-
oDateInput.blur();
|
253 |
-
});
|
254 |
-
|
255 |
-
this._initializeLoca();
|
256 |
-
},
|
257 |
-
|
258 |
-
/**
|
259 |
-
* initialize the localization of the calendar, if not already initialized
|
260 |
-
*
|
261 |
-
* @private
|
262 |
-
*/
|
263 |
-
_initializeLoca: function () {
|
264 |
-
|
265 |
-
if (this._isUndefined('enUS', window)) {
|
266 |
-
window.enUS = {
|
267 |
-
"m": {
|
268 |
-
"wide": [
|
269 |
-
"January", "February", "March", "April", "May", "June", "July", "August",
|
270 |
-
"September", "October", "November", "December"
|
271 |
-
],
|
272 |
-
"abbr": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
273 |
-
}
|
274 |
-
};
|
275 |
-
}
|
276 |
-
|
277 |
-
this._initCalendarLocaField('_DN', new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"));
|
278 |
-
this._initCalendarLocaField('_SDN', new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"));
|
279 |
-
this._initCalendarLocaField('_FD', 0);
|
280 |
-
this._initCalendarLocaField('_MN', window.enUS.m.wide);
|
281 |
-
this._initCalendarLocaField('_SMN', window.enUS.m.abbr);
|
282 |
-
this._initCalendarLocaField('_TT', {
|
283 |
-
INFO: "About",
|
284 |
-
ABOUT: "DHTML Date/Time Selector\n" +
|
285 |
-
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
|
286 |
-
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
287 |
-
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
288 |
-
"\n\n" +
|
289 |
-
"Date selection:\n" +
|
290 |
-
"- Use the \xab, \xbb buttons to select year\n" +
|
291 |
-
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
|
292 |
-
"- Hold mouse button on any of the above buttons for faster selection.",
|
293 |
-
ABOUT_TIME: "\n\n" +
|
294 |
-
"Time selection:\n" +
|
295 |
-
"- Click on any of the time parts to increase it\n" +
|
296 |
-
"- or Shift-click to decrease it\n" +
|
297 |
-
"- or click and drag for faster selection.",
|
298 |
-
PREV_YEAR : "Prev. year (hold for menu)",
|
299 |
-
PREV_MONTH: "Prev. month (hold for menu)",
|
300 |
-
GO_TODAY: "Go Today",
|
301 |
-
NEXT_MONTH : "Next month (hold for menu)",
|
302 |
-
NEXT_YEAR: "Next year (hold for menu)",
|
303 |
-
SEL_DATE: "Select date",
|
304 |
-
DRAG_TO_MOVE: "Drag to move",
|
305 |
-
PART_TODAY: "(today)",
|
306 |
-
DAY_FIRST: "Display %s first",
|
307 |
-
SELECT_COLUMN: "Select all %ss of this month",
|
308 |
-
SELECT_ROW: "Select all days of this week",
|
309 |
-
WEEKEND: "0,6",
|
310 |
-
CLOSE: "Close",
|
311 |
-
TODAY: "Today",
|
312 |
-
TIME_PART: "(Shift-)Click or drag to change value",
|
313 |
-
DEF_DATE_FORMAT: "%Y-%m-%d",
|
314 |
-
TT_DATE_FORMAT: "%a, %b %e",
|
315 |
-
WK: "wk",
|
316 |
-
TIME: "Time:",
|
317 |
-
LAM: "am",
|
318 |
-
AM: "AM",
|
319 |
-
LPM: "pm",
|
320 |
-
PM: "PM"
|
321 |
-
})
|
322 |
-
;
|
323 |
-
this._initCalendarLocaField('_DIR', 'ltr');
|
324 |
-
this._initCalendarLocaField('_am', 'am');
|
325 |
-
this._initCalendarLocaField('_pm', 'pm');
|
326 |
-
},
|
327 |
-
|
328 |
-
/**
|
329 |
-
* Inits a localization part of the calendar
|
330 |
-
*
|
331 |
-
* @param {string} sFieldname name of the part
|
332 |
-
* @param {mixed} mValue value of the field (array, string or number)
|
333 |
-
* @private
|
334 |
-
*/
|
335 |
-
_initCalendarLocaField: function (sFieldname, mValue) {
|
336 |
-
if (this._isUndefined(sFieldname, Calendar)) {
|
337 |
-
Calendar[sFieldname] = mValue;
|
338 |
-
}
|
339 |
-
},
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Checks if element is undefined
|
343 |
-
*
|
344 |
-
* @param {mixed} mElement object or (string) name of property of oParent object
|
345 |
-
* @param {object} oParent object to check the property mElement of (not required)
|
346 |
-
* @return {Boolean} true if the element is undefined
|
347 |
-
* @private
|
348 |
-
*/
|
349 |
-
_isUndefined : function (mElement, oParent) {
|
350 |
-
if (typeof oParent == 'undefined') {
|
351 |
-
return (typeof mElement == 'undefined');
|
352 |
-
} else {
|
353 |
-
return (typeof oParent[mElement] == 'undefined');
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
);
|
358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sitewards_B2BProfessional</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -20,11 +20,11 @@ Features of the B2BProfessional Extension:
|
|
20 |
· Activation for specific product categories
|
21 |
· Activation for specific customer groups
|
22 |
· Optional require login to access store</description>
|
23 |
-
<notes>
|
24 |
<authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
|
25 |
-
<date>2014-
|
26 |
-
<time>
|
27 |
-
<contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="
|
28 |
<compatible/>
|
29 |
-
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Netzarbeiter_CustomerActivation</name><channel>community</channel><min>0.3.0</min><max
|
30 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sitewards_B2BProfessional</name>
|
4 |
+
<version>3.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
20 |
· Activation for specific product categories
|
21 |
· Activation for specific customer groups
|
22 |
· Optional require login to access store</description>
|
23 |
+
<notes>Updated the extension to improve code quality and extension speed.</notes>
|
24 |
<authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
|
25 |
+
<date>2014-08-15</date>
|
26 |
+
<time>14:14:24</time>
|
27 |
+
<contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="Docs"><file name="Sitewards B2B Professional_Deutsch V4.pdf" hash="69c5aabb9eba3cb4d060206f68bfffa9"/><file name="Sitewards B2B Professional_ENG_V4.pdf" hash="ec57137d81856521207e5014dfad133d"/></dir><dir name="Helper"><file name="Category.php" hash="72689cd7ea584379faf651d5dab7c351"/><file name="Core.php" hash="42335338c141593bc65b1e7913e4faf1"/><file name="Customer.php" hash="66f0f771c367e84181392f08efd693a4"/><file name="Data.php" hash="986044678c3628e854048d3e41c4e51e"/><file name="Redirects.php" hash="4b6d65cbf94a58b8b8b74eb480075fed"/></dir><dir name="Model"><file name="Observer.php" hash="5b2c913136e1337e6858103185855841"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="c45ee6c8eaaec42d239705b591c77919"/><file name="Page.php" hash="4527fdfc9bba40aa98dffc6db8fa5d3e"/></dir></dir></dir></dir><dir name="Test"><dir name="Helper"><dir name="Data"><dir name="fixtures"><file name="testIsExtensionActive.yaml" hash="1597dbaa9909bf2cd6cdc41188d79a40"/></dir></dir><file name="Data.php" hash="1c57859446ccbe78bdd3cf14cace8f19"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4a2fcabe901e2baae0eea97a08f05363"/><file name="config.xml" hash="3208477f6797fd73eaf2baf679fcfad9"/><file name="system.xml" hash="2b37ce38dd2ef8ed6fde97ebe503eac3"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sitewards_B2BProfessional.xml" hash="023a28f2a21cd706dea246807465b99f"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Sitewards_B2BProfessional.csv" hash="6015eda25375bedb1b91182fbf61b2af"/></dir><dir name="en_US"><file name="Sitewards_B2BProfessional.csv" hash="44feec9f9e16dcc49cb2576c3244df4b"/></dir></target></contents>
|
28 |
<compatible/>
|
29 |
+
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Netzarbeiter_CustomerActivation</name><channel>community</channel><min>0.3.0</min><max/></package><package><name>Sitewards_DeliveryDate</name><channel>community</channel><min>0.1.0</min><max/></package><package><name>Sitewards_QuickOrders</name><channel>community</channel><min>0.1.0</min><max/></package></required></dependencies>
|
30 |
</package>
|
skin/frontend/base/default/css/sitewards/b2bprofessional.css
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
.sitewards-b2bprofessional-order-form TABLE TR TD,
|
2 |
-
.sitewards-b2bprofessional-order-form THEAD TR TH
|
3 |
-
{
|
4 |
-
padding-right: 20px;
|
5 |
-
padding-bottom: 10px;
|
6 |
-
}
|
7 |
-
|
8 |
-
.sitewards-b2bprofessional-order-form THEAD TR TH {
|
9 |
-
font-weight: bold;
|
10 |
-
}
|
11 |
-
|
12 |
-
.sitewards-b2bprofessional-order-form .price {
|
13 |
-
text-align: right;
|
14 |
-
}
|
15 |
-
|
16 |
-
.sitewards-b2bprofessional-order-form .invisible {
|
17 |
-
display: none;
|
18 |
-
}
|
19 |
-
|
20 |
-
.sitewards-b2bprofessional-order-form A {
|
21 |
-
cursor: pointer;
|
22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/base/default/images/sitewards/loading.gif
DELETED
Binary file
|