Version Notes
Release 0.1.2 Fix bugs Magento CE 1.4+
Download this release
Release Info
Developer | Magento Core Team |
Extension | Sinabs_Directcheckout |
Version | 0.1.2 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.1.2
app/code/community/Sinabs/Directcheckout/Helper/Address.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Sinabs_Directcheckout_Helper_Address extends Mage_Customer_Helper_Address
|
4 |
+
{
|
5 |
+
const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Get string with frontend validation classes for attribute
|
9 |
+
*
|
10 |
+
* @param string $attributeCode
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function getAttributeValidationClass($attributeCode)
|
14 |
+
{
|
15 |
+
/** @var $attribute Mage_Customer_Model_Attribute */
|
16 |
+
$attribute = isset($this->_attributes[$attributeCode]) ? $this->_attributes[$attributeCode]
|
17 |
+
: Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode);
|
18 |
+
$class = $attribute ? $attribute->getFrontend()->getClass() : '';
|
19 |
+
|
20 |
+
if (in_array($attributeCode, array('firstname', 'middlename', 'lastname', 'prefix', 'suffix', 'taxvat'))) {
|
21 |
+
if ($class && !$attribute->getIsVisible()) {
|
22 |
+
$class = ''; // address attribute is not visible thus its validation rules are not applied
|
23 |
+
}
|
24 |
+
|
25 |
+
/** @var $customerAttribute Mage_Customer_Model_Attribute */
|
26 |
+
$customerAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
|
27 |
+
$class .= $customerAttribute && $customerAttribute->getIsVisible()
|
28 |
+
? $customerAttribute->getFrontend()->getClass() : '';
|
29 |
+
$class = implode(' ', array_unique(array_filter(explode(' ', $class))));
|
30 |
+
}
|
31 |
+
|
32 |
+
return $class;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Check whether VAT ID validation is enabled
|
37 |
+
*
|
38 |
+
* @param Mage_Core_Model_Store|string|int $store
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
public function isVatValidationEnabled($store = null)
|
42 |
+
{
|
43 |
+
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Check if VAT ID address attribute has to be shown on frontend (on Customer Address management forms)
|
48 |
+
*
|
49 |
+
* @return boolean
|
50 |
+
*/
|
51 |
+
public function isVatAttributeVisible()
|
52 |
+
{
|
53 |
+
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
|
54 |
+
}
|
55 |
+
}
|
app/code/community/Sinabs/Directcheckout/etc/config.xml
CHANGED
@@ -47,6 +47,11 @@
|
|
47 |
<url>Sinabs_Directcheckout_Helper_Url</url>
|
48 |
</rewrite>
|
49 |
</checkout>
|
|
|
|
|
|
|
|
|
|
|
50 |
</helpers>
|
51 |
</global>
|
52 |
<frontend>
|
47 |
<url>Sinabs_Directcheckout_Helper_Url</url>
|
48 |
</rewrite>
|
49 |
</checkout>
|
50 |
+
<customer>
|
51 |
+
<rewrite>
|
52 |
+
<address>Sinabs_Directcheckout_Helper_Address</address>
|
53 |
+
</rewrite>
|
54 |
+
</customer>
|
55 |
</helpers>
|
56 |
</global>
|
57 |
<frontend>
|
js/directcheckout/directcheckout.js
CHANGED
@@ -106,9 +106,7 @@ Directcheckout.Billing.prototype = {
|
|
106 |
_updateBillingRegion: function() {
|
107 |
var code = $('billing:country_id').getValue();
|
108 |
|
109 |
-
$('billing:region_id').
|
110 |
-
o.remove();
|
111 |
-
});
|
112 |
|
113 |
if (this.listRegion[code]) {
|
114 |
document.getElementById('billing:region_id').options[document.getElementById('billing:region_id').options.length] = new Option('Please select region, state or province', '');
|
@@ -149,10 +147,8 @@ Directcheckout.Shipping.prototype = {
|
|
149 |
},
|
150 |
_updateShippingRegion: function() {
|
151 |
var code = $('shipping:country_id').getValue();
|
152 |
-
|
153 |
-
$('shipping:region_id').
|
154 |
-
o.remove();
|
155 |
-
});
|
156 |
|
157 |
if (this.listRegion[code]) {
|
158 |
document.getElementById('shipping:region_id').options[document.getElementById('shipping:region_id').options.length] = new Option('Please select region, state or province', '');
|
106 |
_updateBillingRegion: function() {
|
107 |
var code = $('billing:country_id').getValue();
|
108 |
|
109 |
+
$('billing:region_id').length = 0;
|
|
|
|
|
110 |
|
111 |
if (this.listRegion[code]) {
|
112 |
document.getElementById('billing:region_id').options[document.getElementById('billing:region_id').options.length] = new Option('Please select region, state or province', '');
|
147 |
},
|
148 |
_updateShippingRegion: function() {
|
149 |
var code = $('shipping:country_id').getValue();
|
150 |
+
|
151 |
+
$('shipping:region_id').length = 0;
|
|
|
|
|
152 |
|
153 |
if (this.listRegion[code]) {
|
154 |
document.getElementById('shipping:region_id').options[document.getElementById('shipping:region_id').options.length] = new Option('Please select region, state or province', '');
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sinabs_Directcheckout</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Directcheckout Release 0.1.
|
10 |
<description>Increase your conversion rate through our one step checkout module.</description>
|
11 |
-
<notes>Release 0.1.1
|
12 |
<authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
-
<date>2014-01-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="Directcheckout"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Link.php" hash="e2c99a8ad1b2ff0c0e46779e8e781a38"/></dir><file name="Billing.php" hash="3566196fe02cfd6b6302a7c55dc0f4cb"/><file name="Coupon.php" hash="c3ece6a9e8c798034a964e06f021692c"/><file name="Gift.php" hash="bb9fb6d9e99f6e48f8e318ab15d92f27"/><file name="Links.php" hash="0e3348a234cccd82d04f33741b7914f3"/><file name="Newsletter.php" hash="ff4f476b8a62459ada10ada97b072876"/><file name="Shipping.php" hash="222ab5cb49fb254b0b798de4a69b9044"/></dir></dir><dir name="Helper"><file name="Data.php" hash="cf1d3e23eb8471d817ba616835b3c7bf"/><file name="Url.php" hash="d7f4da682505d1eed6c06d63458bdb24"/></dir><dir name="controllers"><dir name="Customer"><file name="AjaxController.php" hash="a29445ad4907034af82dbfc736991b0a"/></dir><file name="AjaxController.php" hash="fca216a1a1093278469abd3b9fd5594a"/><file name="IndexController.php" hash="5e3bb2ef6a37f8d57275587e5fd8b684"/></dir><dir name="etc"><file name="config.xml" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sinabs_Directcheckout</name>
|
4 |
+
<version>0.1.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Directcheckout Release 0.1.2</summary>
|
10 |
<description>Increase your conversion rate through our one step checkout module.</description>
|
11 |
+
<notes>Release 0.1.2 Fix bugs Magento CE 1.4+</notes>
|
12 |
<authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
+
<date>2014-01-23</date>
|
14 |
+
<time>09:49:38</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="Directcheckout"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Link.php" hash="e2c99a8ad1b2ff0c0e46779e8e781a38"/></dir><file name="Billing.php" hash="3566196fe02cfd6b6302a7c55dc0f4cb"/><file name="Coupon.php" hash="c3ece6a9e8c798034a964e06f021692c"/><file name="Gift.php" hash="bb9fb6d9e99f6e48f8e318ab15d92f27"/><file name="Links.php" hash="0e3348a234cccd82d04f33741b7914f3"/><file name="Newsletter.php" hash="ff4f476b8a62459ada10ada97b072876"/><file name="Shipping.php" hash="222ab5cb49fb254b0b798de4a69b9044"/></dir></dir><dir name="Helper"><file name="Address.php" hash="b8da94d8debe553a12a50368a153475c"/><file name="Data.php" hash="cf1d3e23eb8471d817ba616835b3c7bf"/><file name="Url.php" hash="d7f4da682505d1eed6c06d63458bdb24"/></dir><dir name="controllers"><dir name="Customer"><file name="AjaxController.php" hash="a29445ad4907034af82dbfc736991b0a"/></dir><file name="AjaxController.php" hash="fca216a1a1093278469abd3b9fd5594a"/><file name="IndexController.php" hash="5e3bb2ef6a37f8d57275587e5fd8b684"/></dir><dir name="etc"><file name="config.xml" hash="487569e0fe5836c65534d7be0c79b973"/><file name="system.xml" hash="09ed5ce446e4a564bc82dea994bc86a4"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="directcheckout"><dir name="checkout"><dir name="additional"><file name="agreements.phtml" hash="d4a63588cb46492263fb1dc934b8b2aa"/><file name="coupon.phtml" hash="708dffbebd44559974e089674dfad28d"/><file name="newsletter.phtml" hash="909a0084e07a83827df47ae04f531ab6"/></dir><dir name="gift"><file name="options.phtml" hash="945c0f916729b864b879a6f5f4a0dad4"/></dir><dir name="payment"><file name="methods.phtml" hash="a764824070152cbfd8965f54de04fbef"/></dir><file name="additional.phtml" hash="0a99c4ce5270b4ec6b0991eb833e93dc"/><file name="billing.phtml" hash="38c0fd17d763e1b30b30067ff6685722"/><file name="gift.phtml" hash="d7ab7ceb3424149f7cb3dae9c00c22b6"/><file name="review.phtml" hash="b834c89a12e1ee5353f5286db796ef55"/><file name="shipping.phtml" hash="c26c65eb137e8cadde1471f90308b159"/><file name="shipping_method.phtml" hash="333b3a89be3454746fe0343f3eafea94"/><file name="spo.phtml" hash="8c17c38c710394e6378926ba8107bb22"/><file name="summary.phtml" hash="ffdef5b2d1054cfb6a4b14b28e547cbe"/></dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="c2f0baf4cc8ac175dd7f3b5ac53d2fc6"/></dir><file name="forget.phtml" hash="a437f709a6e711668a2a2564be96a0ab"/><file name="login.phtml" hash="3585445d31384c5c88f65849ae4219c4"/></dir><file name="checkout.phtml" hash="7e78913b9f90fcf67cf65b7d8c7e6830"/></dir></dir><dir name="layout"><file name="directcheckout.xml" hash="eef64b48c7d222dcead72195e67cdbb8"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="directcheckout"><dir name="css"><file name="modal.css" hash="ff14481d15d473063ccbc1158867cf43"/><file name="styles.css" hash="af3e0051c28e12c38a943b57abf0b3a2"/></dir><dir name="images"><file name="button-loader.gif" hash="9a9cfbeae93874aa92295baf21ace29c"/><file name="directcheckout-step1.png" hash="fee760a1d5f3b0ea2b92afb78027a750"/><file name="directcheckout-step2.png" hash="b78af68848930f1be94ef4ed7afd9c9b"/><file name="directcheckout-step3.png" hash="59d0cdcad1de0cdf0141bcd2275f0bc8"/><file name="directcheckout-step4.png" hash="48060ab23605daa5dadd34be3eb35ae6"/><file name="directcheckout-stepfinal.png" hash="b03cf8ea88e987ceb42d966b234d7a1c"/><file name="line-gradient.gif" hash="bef9df2d426124dbe3d496407219190b"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="directcheckout"><file name="directcheckout.js" hash="44785d164857b2c572c2daffee7efab3"/><file name="modal.js" hash="c3b77dc52bba63e273e21414df4f0f77"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Sinabs_Directcheckout.csv" hash="a105fd3a42d9c12d57b137cc043b4f32"/></dir><dir name="fr_FR"><file name="Sinabs_Directcheckout.csv" hash="b820881ac64f310db71ee7da470abfb8"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_Directcheckout.xml" hash="8dfc7b08d0b331930caf63b6963f0356"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|