Sinabs_Directcheckout - Version 0.2.2

Version Notes

Release 0.2.2

Download this release

Release Info

Developer Magento Core Team
Extension Sinabs_Directcheckout
Version 0.2.2
Comparing to
See all releases


Code changes from version 0.2.1 to 0.2.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/controllers/AjaxController.php CHANGED
@@ -109,7 +109,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
109
  $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
110
  $result = $this->getOnepage()->saveShipping($data, $customerAddressId);
111
  } else {
112
- $result = $this->getOnepage()->saveShipping($data);
113
  }
114
 
115
  $shippingMethod = $this->getRequest()->getParam('shipping_method');
@@ -292,9 +292,13 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
292
  $itemId = (int)$this->getRequest()->getParam('itemId');
293
 
294
  try {
295
- $cart = $this->_getCart()->updateItem($itemId, array(
296
  'qty' => $qty
297
- ));
 
 
 
 
298
  $cart->save();
299
  $response['success'] = true;
300
  $this->getResponse()->setBody(Zend_Json::encode($response));
109
  $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
110
  $result = $this->getOnepage()->saveShipping($data, $customerAddressId);
111
  } else {
112
+ $result = $this->getOnepage()->saveShipping($data, '');
113
  }
114
 
115
  $shippingMethod = $this->getRequest()->getParam('shipping_method');
292
  $itemId = (int)$this->getRequest()->getParam('itemId');
293
 
294
  try {
295
+ /*$cart = $this->_getCart()->updateItem($itemId, array(
296
  'qty' => $qty
297
+ ));*/
298
+ $cart = $this->_getCart()->updateItems(array($itemId => array(
299
+ 'qty' => $qty
300
+ )));
301
+
302
  $cart->save();
303
  $response['success'] = true;
304
  $this->getResponse()->setBody(Zend_Json::encode($response));
app/code/community/Sinabs/Directcheckout/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
  <config>
24
  <modules>
25
  <Sinabs_Directcheckout>
26
- <version>0.2.1</version>
27
  </Sinabs_Directcheckout>
28
  </modules>
29
  <global>
@@ -47,6 +47,11 @@
47
  <url>Sinabs_Directcheckout_Helper_Url</url>
48
  </rewrite>
49
  </checkout>
 
 
 
 
 
50
  </helpers>
51
  </global>
52
  <frontend>
23
  <config>
24
  <modules>
25
  <Sinabs_Directcheckout>
26
+ <version>0.2.2</version>
27
  </Sinabs_Directcheckout>
28
  </modules>
29
  <global>
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>
app/design/frontend/default/default/template/directcheckout/checkout/payment/methods.phtml CHANGED
@@ -26,14 +26,14 @@
26
  ?>
27
  <?php
28
  $_methods = $this->getMethods();
29
- $_oneMethod = count($methods) <= 1;
30
  ?>
31
  <div id="billing_methods">
32
  <ul>
33
  <?php foreach ($_methods as $_method) : ?>
34
  <li>
35
  <?php $_code = $_method->getCode(); ?>
36
- <?php if (!$oneMethod) : ?>
37
  <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->htmlEscape($_method->getTitle()) ?>" onclick="switchPaymentMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
38
  <?php else : ?>
39
  <span class="no-display">
26
  ?>
27
  <?php
28
  $_methods = $this->getMethods();
29
+ $_oneMethod = count($_methods) <= 1;
30
  ?>
31
  <div id="billing_methods">
32
  <ul>
33
  <?php foreach ($_methods as $_method) : ?>
34
  <li>
35
  <?php $_code = $_method->getCode(); ?>
36
+ <?php if (!$_oneMethod) : ?>
37
  <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->htmlEscape($_method->getTitle()) ?>" onclick="switchPaymentMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
38
  <?php else : ?>
39
  <span class="no-display">
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sinabs_Directcheckout</name>
4
- <version>0.2.1</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.2.1</summary>
10
  <description>Increase your conversion rate through our one step checkout module.</description>
11
- <notes>Release 0.2.1</notes>
12
  <authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
13
- <date>2014-07-08</date>
14
- <time>12:26:50</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="193dfb1f6b44663468304353471dcd6b"/><file name="Links.php" hash="0e3348a234cccd82d04f33741b7914f3"/><file name="Newsletter.php" hash="ff4f476b8a62459ada10ada97b072876"/><file name="Shipping.php" hash="222ab5cb49fb254b0b798de4a69b9044"/></dir><dir name="Product"><file name="View.php" hash="0b4aa3a055111cd04cf114990844a0f1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="3422436a33070566271f2a04d5e849ef"/><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="133af9af54a59a7c2cbcf45461b341a1"/><file name="IndexController.php" hash="d5cf6b12790d223e427c5a878a285d95"/></dir><dir name="etc"><file name="config.xml" hash="13dd5ddc43015c68290187fb502a9865"/><file name="system.xml" hash="8c4bbc65b58468b4a1a3701024abe431"/></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"><dir name="gift"><file name="options.phtml" hash="813200c301bbd82fc3abc3bec1f40df9"/></dir><file name="agreements.phtml" hash="d4a63588cb46492263fb1dc934b8b2aa"/><file name="coupon.phtml" hash="708dffbebd44559974e089674dfad28d"/><file name="gift.phtml" hash="32e8ccab51fb030823821f0861cf328f"/><file name="newsletter.phtml" hash="909a0084e07a83827df47ae04f531ab6"/></dir><dir name="payment"><file name="methods.phtml" hash="a764824070152cbfd8965f54de04fbef"/></dir><file name="additional.phtml" hash="0a99c4ce5270b4ec6b0991eb833e93dc"/><file name="billing.phtml" hash="bed43dd7d753a07c516726a3ed0d0d13"/><file name="review.phtml" hash="b834c89a12e1ee5353f5286db796ef55"/><file name="shipping.phtml" hash="d2fd7fb79940c926f0a2e58358996ad2"/><file name="shipping_method.phtml" hash="333b3a89be3454746fe0343f3eafea94"/><file name="spo.phtml" hash="8c17c38c710394e6378926ba8107bb22"/><file name="summary.phtml" hash="dc7e216f97a09745b43c4d6237b87b21"/></dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="3a873fd64b5794442482a4bd7dc2f3ff"/></dir><file name="forget.phtml" hash="a437f709a6e711668a2a2564be96a0ab"/><file name="login.phtml" hash="3585445d31384c5c88f65849ae4219c4"/></dir><dir name="product"><file name="view.phtml" hash="30cd9ea747586db3123101c44f032a79"/></dir><file name="checkout.phtml" hash="f21c5a0b1bc21b02192241667c651ac2"/></dir></dir><dir name="layout"><file name="directcheckout.xml" hash="7ac9318dafdf1afe04525e93dee42f44"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sinabs_directcheckout.xml" hash="723b268e3dad8923e61df5dea3c3f286"/></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="c632d061241f84815f1d20d741a8c660"/></dir><dir name="images"><dir name="icon"><file name="accept.png" hash="8bfed48756f192ed7afe6eaa4799aae4"/></dir><file name="button-loader.gif" hash="9a9cfbeae93874aa92295baf21ace29c"/><file name="directcheckout-autocomplete-marker.png" hash="90f6a52d9db9166d00cb5de860bf6b04"/><file name="directcheckout-qty-add.gif" hash="7914e57701ca26f5c8bf23c6bc3e1f25"/><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="sinabs-dc-step1.png" hash="98eadf15c37c4863c80c4f4aa6cbfa55"/><file name="sinabs-dc-step2.png" hash="d5693c14a040db352232b715b082a515"/><file name="sinabs-dc-step3.png" hash="1f0ac49961ca8803101f1b317af21fae"/><file name="sinabs-dc-stepfinal.png" hash="445449c05281611c49e1d448af21afb6"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="directcheckout"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="e95071b013a8de26669d31a5fa3d9081"/></dir><file name="directcheckout.js" hash="a8563ce53bf2ce6805b58bce8df4a132"/><file name="modal.js" hash="c3b77dc52bba63e273e21414df4f0f77"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Sinabs_Directcheckout.csv" hash="950d6b2d9e7a086166714714c608e0ad"/></dir><dir name="fr_FR"><file name="Sinabs_Directcheckout.csv" hash="523bc6037b3dced4813a826476f8600d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_Directcheckout.xml" hash="8dfc7b08d0b331930caf63b6963f0356"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sinabs_Directcheckout</name>
4
+ <version>0.2.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.2.2</summary>
10
  <description>Increase your conversion rate through our one step checkout module.</description>
11
+ <notes>Release 0.2.2</notes>
12
  <authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
13
+ <date>2014-08-04</date>
14
+ <time>13:11:19</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="193dfb1f6b44663468304353471dcd6b"/><file name="Links.php" hash="0e3348a234cccd82d04f33741b7914f3"/><file name="Newsletter.php" hash="ff4f476b8a62459ada10ada97b072876"/><file name="Shipping.php" hash="222ab5cb49fb254b0b798de4a69b9044"/></dir><dir name="Product"><file name="View.php" hash="0b4aa3a055111cd04cf114990844a0f1"/></dir></dir><dir name="Helper"><file name="Address.php" hash="b8da94d8debe553a12a50368a153475c"/><file name="Data.php" hash="3422436a33070566271f2a04d5e849ef"/><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="d6e9406baf222f07012c5c3059452842"/><file name="IndexController.php" hash="d5cf6b12790d223e427c5a878a285d95"/></dir><dir name="etc"><file name="config.xml" hash="1b3d267d088e45ba64ef3f23719a95c4"/><file name="system.xml" hash="8c4bbc65b58468b4a1a3701024abe431"/></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"><dir name="gift"><file name="options.phtml" hash="813200c301bbd82fc3abc3bec1f40df9"/></dir><file name="agreements.phtml" hash="d4a63588cb46492263fb1dc934b8b2aa"/><file name="coupon.phtml" hash="708dffbebd44559974e089674dfad28d"/><file name="gift.phtml" hash="32e8ccab51fb030823821f0861cf328f"/><file name="newsletter.phtml" hash="909a0084e07a83827df47ae04f531ab6"/></dir><dir name="payment"><file name="methods.phtml" hash="aa73574ae3707c0807c83ae4bbed3f9e"/></dir><file name="additional.phtml" hash="0a99c4ce5270b4ec6b0991eb833e93dc"/><file name="billing.phtml" hash="bed43dd7d753a07c516726a3ed0d0d13"/><file name="review.phtml" hash="b834c89a12e1ee5353f5286db796ef55"/><file name="shipping.phtml" hash="d2fd7fb79940c926f0a2e58358996ad2"/><file name="shipping_method.phtml" hash="333b3a89be3454746fe0343f3eafea94"/><file name="spo.phtml" hash="8c17c38c710394e6378926ba8107bb22"/><file name="summary.phtml" hash="dc7e216f97a09745b43c4d6237b87b21"/></dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="3a873fd64b5794442482a4bd7dc2f3ff"/></dir><file name="forget.phtml" hash="a437f709a6e711668a2a2564be96a0ab"/><file name="login.phtml" hash="3585445d31384c5c88f65849ae4219c4"/></dir><dir name="product"><file name="view.phtml" hash="30cd9ea747586db3123101c44f032a79"/></dir><file name="checkout.phtml" hash="f21c5a0b1bc21b02192241667c651ac2"/></dir></dir><dir name="layout"><file name="directcheckout.xml" hash="7ac9318dafdf1afe04525e93dee42f44"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sinabs_directcheckout.xml" hash="723b268e3dad8923e61df5dea3c3f286"/></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="c632d061241f84815f1d20d741a8c660"/></dir><dir name="images"><dir name="icon"><file name="accept.png" hash="8bfed48756f192ed7afe6eaa4799aae4"/></dir><file name="button-loader.gif" hash="9a9cfbeae93874aa92295baf21ace29c"/><file name="directcheckout-autocomplete-marker.png" hash="90f6a52d9db9166d00cb5de860bf6b04"/><file name="directcheckout-qty-add.gif" hash="7914e57701ca26f5c8bf23c6bc3e1f25"/><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="sinabs-dc-step1.png" hash="98eadf15c37c4863c80c4f4aa6cbfa55"/><file name="sinabs-dc-step2.png" hash="d5693c14a040db352232b715b082a515"/><file name="sinabs-dc-step3.png" hash="1f0ac49961ca8803101f1b317af21fae"/><file name="sinabs-dc-stepfinal.png" hash="445449c05281611c49e1d448af21afb6"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="directcheckout"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="e95071b013a8de26669d31a5fa3d9081"/></dir><file name="directcheckout.js" hash="a8563ce53bf2ce6805b58bce8df4a132"/><file name="modal.js" hash="c3b77dc52bba63e273e21414df4f0f77"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Sinabs_Directcheckout.csv" hash="950d6b2d9e7a086166714714c608e0ad"/></dir><dir name="fr_FR"><file name="Sinabs_Directcheckout.csv" hash="523bc6037b3dced4813a826476f8600d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_Directcheckout.xml" hash="8dfc7b08d0b331930caf63b6963f0356"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>