Version Notes
Fixed create, delete, edit widgets issue.
Fixed issue with multiple stores having different b2b settings.
Download this release
Release Info
Developer | Sitewards Magento Team |
Extension | Sitewards_B2BProfessional |
Version | 2.5.1 |
Comparing to | |
See all releases |
Code changes from version 2.5.0 to 2.5.1
app/code/community/Sitewards/B2BProfessional/controllers/CartController.php
CHANGED
@@ -1,66 +1,84 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Sitewards_B2BProfessional_CartController
|
4 |
-
*
|
5 |
*
|
6 |
* @category Sitewards
|
7 |
* @package Sitewards_B2BProfessional
|
8 |
-
* @copyright Copyright (c)
|
9 |
*/
|
10 |
require_once 'Mage/Checkout/controllers/CartController.php';
|
|
|
11 |
class Sitewards_B2BProfessional_CartController extends Mage_Checkout_CartController
|
12 |
{
|
13 |
/**
|
14 |
* On checkout cart controller preDispatch
|
15 |
-
*
|
16 |
-
*
|
17 |
-
*
|
|
|
|
|
18 |
*/
|
19 |
public function preDispatch()
|
20 |
{
|
21 |
parent::preDispatch();
|
22 |
|
23 |
-
/**
|
24 |
-
* Check customer authentication
|
25 |
-
*/
|
26 |
-
|
27 |
-
$sLoginUrl = Mage::helper('customer')
|
28 |
-
->getLoginUrl();
|
29 |
-
|
30 |
-
if (!Mage::getSingleton('customer/session')
|
31 |
-
->authenticate($this, $sLoginUrl)
|
32 |
-
) {
|
33 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
34 |
-
}
|
35 |
-
|
36 |
-
$oRequest = $this->getRequest();
|
37 |
-
$iProductId = $oRequest->get('product');
|
38 |
/* @var $oB2BHelper Sitewards_B2BProfessional_Helper_Data */
|
39 |
$oB2BHelper = Mage::helper('b2bprofessional');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
/**
|
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 |
/**
|
app/code/community/Sitewards/B2BProfessional/etc/config.xml
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
<config>
|
19 |
<modules>
|
20 |
<Sitewards_B2BProfessional>
|
21 |
-
<version>2.5.
|
22 |
</Sitewards_B2BProfessional>
|
23 |
</modules>
|
24 |
<global>
|
18 |
<config>
|
19 |
<modules>
|
20 |
<Sitewards_B2BProfessional>
|
21 |
+
<version>2.5.1</version>
|
22 |
</Sitewards_B2BProfessional>
|
23 |
</modules>
|
24 |
<global>
|
app/design/frontend/base/default/layout/sitewards/b2bprofessional.xml
CHANGED
@@ -14,14 +14,14 @@
|
|
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">
|
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">
|
25 |
<label>New Order Form</label>
|
26 |
<update handle="customer_account"/>
|
27 |
<reference name="my.account.wrapper">
|
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">
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sitewards_B2BProfessional</name>
|
4 |
-
<version>2.5.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -20,14 +20,12 @@ 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 |
-
|
25 |
-
Now xmlrpc api is working when extension is enabled. 
|
26 |
-
</notes>
|
27 |
<authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
|
28 |
-
<date>
|
29 |
-
<time>
|
30 |
-
<contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="Block"><dir name="Adminhtml"><file name="Order.php" hash="1079907aaeb1f57c753635899032ff38"/></dir><dir name="Catalog"><dir name="Product"><file name="List.php" hash="4c8e213915c4c7c177b503916921a392"/><file name="New.php" hash="3da0bc1cb1bd562f1a41e2169f6da061"/><dir name="Widget"><file name="New.php" hash="f263ee41756685c78959082ff2a38b5a"/></dir></dir></dir><dir name="Checkout"><file name="Links.php" hash="f88d8e603f98a282b2d6f678f03d974d"/></dir><dir name="Order"><file name="Form.php" hash="9b3a9d07b9a7eb537e898578d0ce0466"/></dir><file name="Order.php" hash="c421edb98f77b39b0abdb68262a018f6"/><dir name="Reports"><dir name="Product"><file name="Compared.php" hash="abe90ddad8722f7f3b41eef2cf9d7411"/><file name="Viewed.php" hash="c89044322ca310b450e7e8b95c17de69"/><dir name="Widget"><file name="Compared.php" hash="427bd3640335044572ccb4a6966d1d31"/><file name="Viewed.php" hash="f943f7cff7e0858c23527bcdf82f4b19"/></dir></dir></dir></dir><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"><dir name="Catalog"><dir name="Product"><file name="Compare.php" hash="29d7ee722666ceeed48ac0e43c937b1d"/></dir></dir><file name="Category.php" hash="c7ac2551cc37516ea44002b08021c27b"/><file name="Core.php" hash="8a9ed86d5aead09fad8a6c372904005d"/><file name="Customer.php" hash="6664c3fa3745cd1df1220bc4bff02d0a"/><file name="Data.php" hash="1b43a1aaa6aa968a1d9ecfd8aa2b2102"/><file name="Messages.php" hash="54ce3aae10919721bb3545988d6aa564"/><file name="Redirects.php" hash="5670879b38bc078e36fb32f739b3a1f5"/><file name="Replacements.php" hash="cb5b3162388618b1d8c512c5b83918a0"/></dir><dir name="Model"><file name="Customer.php" hash="ceb9778dfb4725c8cd087f2595b3ccff"/><file name="Observer.php" hash="716c0e06ec9c08ee286c83ca13b63e3c"/><file name="Order.php" hash="5ba1832297e6f95a7b14787298bd9f2a"/><file name="Quote.php" hash="9401c027ab3b4949f0db15200d591c6d"/><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="32b8e20dce599b6455232af83199e8cf"/></dir><file name="Order.php" hash="82300aaebd70030ce59b48f0bb68a275"/><dir name="Quote"><file name="Collection.php" hash="5f6dc10e88b36d1535432def4c8f11a2"/></dir><file name="Quote.php" hash="8560f55cdbcfe7312f1c1208ddcf9378"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="e9642d20bb0bc0f542b07ecdf8d021c5"/><file name="Identifiers.php" hash="018e168fb31fffa33b3889612e0336be"/><file name="Page.php" hash="042ef4e679e8e8c7b6a2c696119712b3"/><file name="Tags.php" hash="af72690991f6f91a5aecb5f5fd7f621a"/></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="19407fd03acd55753b08b472f4004c57"/></dir></dir><dir name="controllers"><file name="CartController.php" hash="
|
31 |
<compatible/>
|
32 |
<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></required></dependencies>
|
33 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sitewards_B2BProfessional</name>
|
4 |
+
<version>2.5.1</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>Fixed create, delete, edit widgets issue.
|
24 |
+
Fixed issue with multiple stores having different b2b settings.</notes>
|
|
|
|
|
25 |
<authors><author><name>Sitewards Magento Team</name><user>sitewards</user><email>magento@sitewards.com</email></author></authors>
|
26 |
+
<date>2014-02-17</date>
|
27 |
+
<time>10:44:44</time>
|
28 |
+
<contents><target name="magecommunity"><dir name="Sitewards"><dir name="B2BProfessional"><dir name="Block"><dir name="Adminhtml"><file name="Order.php" hash="1079907aaeb1f57c753635899032ff38"/></dir><dir name="Catalog"><dir name="Product"><file name="List.php" hash="4c8e213915c4c7c177b503916921a392"/><file name="New.php" hash="3da0bc1cb1bd562f1a41e2169f6da061"/><dir name="Widget"><file name="New.php" hash="f263ee41756685c78959082ff2a38b5a"/></dir></dir></dir><dir name="Checkout"><file name="Links.php" hash="f88d8e603f98a282b2d6f678f03d974d"/></dir><dir name="Order"><file name="Form.php" hash="9b3a9d07b9a7eb537e898578d0ce0466"/></dir><file name="Order.php" hash="c421edb98f77b39b0abdb68262a018f6"/><dir name="Reports"><dir name="Product"><file name="Compared.php" hash="abe90ddad8722f7f3b41eef2cf9d7411"/><file name="Viewed.php" hash="c89044322ca310b450e7e8b95c17de69"/><dir name="Widget"><file name="Compared.php" hash="427bd3640335044572ccb4a6966d1d31"/><file name="Viewed.php" hash="f943f7cff7e0858c23527bcdf82f4b19"/></dir></dir></dir></dir><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"><dir name="Catalog"><dir name="Product"><file name="Compare.php" hash="29d7ee722666ceeed48ac0e43c937b1d"/></dir></dir><file name="Category.php" hash="c7ac2551cc37516ea44002b08021c27b"/><file name="Core.php" hash="8a9ed86d5aead09fad8a6c372904005d"/><file name="Customer.php" hash="6664c3fa3745cd1df1220bc4bff02d0a"/><file name="Data.php" hash="1b43a1aaa6aa968a1d9ecfd8aa2b2102"/><file name="Messages.php" hash="54ce3aae10919721bb3545988d6aa564"/><file name="Redirects.php" hash="5670879b38bc078e36fb32f739b3a1f5"/><file name="Replacements.php" hash="cb5b3162388618b1d8c512c5b83918a0"/></dir><dir name="Model"><file name="Customer.php" hash="ceb9778dfb4725c8cd087f2595b3ccff"/><file name="Observer.php" hash="716c0e06ec9c08ee286c83ca13b63e3c"/><file name="Order.php" hash="5ba1832297e6f95a7b14787298bd9f2a"/><file name="Quote.php" hash="9401c027ab3b4949f0db15200d591c6d"/><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="32b8e20dce599b6455232af83199e8cf"/></dir><file name="Order.php" hash="82300aaebd70030ce59b48f0bb68a275"/><dir name="Quote"><file name="Collection.php" hash="5f6dc10e88b36d1535432def4c8f11a2"/></dir><file name="Quote.php" hash="8560f55cdbcfe7312f1c1208ddcf9378"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Category.php" hash="e9642d20bb0bc0f542b07ecdf8d021c5"/><file name="Identifiers.php" hash="018e168fb31fffa33b3889612e0336be"/><file name="Page.php" hash="042ef4e679e8e8c7b6a2c696119712b3"/><file name="Tags.php" hash="af72690991f6f91a5aecb5f5fd7f621a"/></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="19407fd03acd55753b08b472f4004c57"/></dir></dir><dir name="controllers"><file name="CartController.php" hash="ed057ef6e574e564bf5b2f3849a4154f"/><file name="OrderController.php" hash="0c8f8fc04d5920bb2d4fb8abbe5e4ea2"/><file name="ProductController.php" hash="3837d695d65cdfb361bcc21bf5e884b7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="1c7cde3689b2da69458c39c3508f7e1a"/><file name="config.xml" hash="51c2c5f9496bc2dfb00e443555cb4178"/><file name="system.xml" hash="20344173951dcaf070b8882eb97a35eb"/></dir><dir name="sql"><dir name="sitewards_b2bprofessional"><file name="upgrade-2.3.0-2.4.0.php" hash="b203deb87585780983f5a16f19b88b34"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sitewards_B2BProfessional.xml" hash="3eb7e7a0f796d39faf60cf3f30c40ff2"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Sitewards_B2BProfessional.csv" hash="e2f335efa0e6b206580aca1ce2cd595d"/></dir><dir name="en_US"><file name="Sitewards_B2BProfessional.csv" hash="e3e35d922900bad93fee16ecdbb09f69"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sitewards"><dir name="b2bprofessional"><dir name="catalog"><dir name="product"><dir name="view"><dir name="type"><dir name="bundle"><dir name="option"><file name="checkbox.phtml" hash="43233f86f7e8529e5bc997f448ca250a"/><file name="multi.phtml" hash="43797266868e249b34a228a4ad9797e7"/><file name="radio.phtml" hash="770363afcc009271d58a15f02ae4fdbe"/><file name="select.phtml" hash="47b3b35fe986ab31fdc8e239e8ec9bb1"/></dir></dir></dir></dir></dir></dir><dir name="checkout"><dir name="billing"><file name="extra.phtml" hash="ecc02d2548ca43b2424f88ac4cc3b0e0"/></dir></dir><dir name="order"><file name="form.phtml" hash="07382e7c71e8e0a8c9de39e8b1e255c7"/></dir><file name="order.phtml" hash="9591a8cc45c05df038807157a6f07537"/></dir></dir></dir><dir name="layout"><dir name="sitewards"><file name="b2bprofessional.xml" hash="c85d310d8a2045c854537780f6c8a89d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sitewards"><dir name="b2bprofessional"><file name="order.phtml" hash="acd14610cfb5ae3af32d29d4fb97dee9"/><dir name="sales"><dir name="order"><file name="info.phtml" hash="f15665316c8b577c00f3a6d079a00f63"/></dir></dir></dir></dir></dir><dir name="layout"><dir name="sitewards"><file name="b2bprofessional.xml" hash="dd9927dd56d60c6499e591623d4c4ad8"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="sitewards"><file name="loading.gif" hash="1836c963dec1eb6dab0e0a41b8121cd3"/></dir></dir><dir name="css"><dir name="sitewards"><file name="b2bprofessional.css" hash="6d6ce9426f7f397c0488a82188c3bba5"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="sitewards"><file name="b2bprofessional.js" hash="953f75bd31bcd1dcb639d9582cf30292"/></dir></dir></target></contents>
|
29 |
<compatible/>
|
30 |
<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></required></dependencies>
|
31 |
</package>
|