Version Notes
Release 0.1.0
Download this release
Release Info
Developer | Sinabs |
Extension | Sinabs_Directcheckout |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Billing.php +65 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Coupon.php +26 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Gift.php +89 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Links.php +44 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Newsletter.php +37 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Onepage/Link.php +33 -0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Shipping.php +66 -0
- app/code/community/Sinabs/Directcheckout/Helper/Data.php +87 -0
- app/code/community/Sinabs/Directcheckout/Helper/Url.php +31 -0
- app/code/community/Sinabs/Directcheckout/controllers/AjaxController.php +287 -0
- app/code/community/Sinabs/Directcheckout/controllers/Customer/AjaxController.php +112 -0
- app/code/community/Sinabs/Directcheckout/controllers/IndexController.php +69 -0
- app/code/community/Sinabs/Directcheckout/etc/config.xml +116 -0
- app/code/community/Sinabs/Directcheckout/etc/system.xml +98 -0
- app/design/frontend/default/default/layout/directcheckout.xml +74 -0
- app/design/frontend/default/default/template/directcheckout/checkout.phtml +95 -0
- app/design/frontend/default/default/template/directcheckout/checkout/additional.phtml +27 -0
- app/design/frontend/default/default/template/directcheckout/checkout/additional/agreements.phtml +50 -0
- app/design/frontend/default/default/template/directcheckout/checkout/additional/coupon.phtml +47 -0
- app/design/frontend/default/default/template/directcheckout/checkout/additional/newsletter.phtml +36 -0
- app/design/frontend/default/default/template/directcheckout/checkout/billing.phtml +216 -0
- app/design/frontend/default/default/template/directcheckout/checkout/gift.phtml +36 -0
- app/design/frontend/default/default/template/directcheckout/checkout/gift/options.phtml +55 -0
- app/design/frontend/default/default/template/directcheckout/checkout/payment/methods.phtml +51 -0
- app/design/frontend/default/default/template/directcheckout/checkout/review.phtml +27 -0
- app/design/frontend/default/default/template/directcheckout/checkout/shipping.phtml +131 -0
- app/design/frontend/default/default/template/directcheckout/checkout/shipping_method.phtml +78 -0
- app/design/frontend/default/default/template/directcheckout/checkout/spo.phtml +35 -0
- app/design/frontend/default/default/template/directcheckout/checkout/summary.phtml +74 -0
- app/design/frontend/default/default/template/directcheckout/customer/forget.phtml +51 -0
- app/design/frontend/default/default/template/directcheckout/customer/login.phtml +56 -0
- app/design/frontend/default/default/template/directcheckout/customer/widget/name.phtml +81 -0
- app/etc/modules/Sinabs_Directcheckout.xml +10 -0
- app/locale/en_US/Sinabs_Directcheckout.csv +7 -0
- app/locale/fr_FR/Sinabs_Directcheckout.csv +7 -0
- js/directcheckout/directcheckout.js +314 -0
- js/directcheckout/modal.js +600 -0
- package.xml +18 -0
- skin/frontend/default/default/directcheckout/css/modal.css +122 -0
- skin/frontend/default/default/directcheckout/css/styles.css +105 -0
- skin/frontend/default/default/directcheckout/images/button-loader.gif +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-step1.png +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-step2.png +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-step3.png +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-step4.png +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-stepfinal.png +0 -0
- skin/frontend/default/default/directcheckout/images/line-gradient.gif +0 -0
- skin/frontend/default/default/directcheckout/images/spinner.gif +0 -0
app/code/community/Sinabs/Directcheckout/Block/Checkout/Billing.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Billing extends Mage_Checkout_Block_Onepage_Billing
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Retrieve addresses list
|
24 |
+
*
|
25 |
+
* @param string $type
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function getAddressesHtmlSelect($type)
|
29 |
+
{
|
30 |
+
if ($this->isCustomerLoggedIn()) {
|
31 |
+
$options = array();
|
32 |
+
foreach ($this->getCustomer()->getAddresses() as $address) {
|
33 |
+
$options[] = array(
|
34 |
+
'value' => $address->getId(),
|
35 |
+
'label' => $address->format('oneline')
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
$addressId = $this->getAddress()->getCustomerAddressId();
|
40 |
+
if (empty($addressId)) {
|
41 |
+
if ($type=='billing') {
|
42 |
+
$address = $this->getCustomer()->getPrimaryBillingAddress();
|
43 |
+
} else {
|
44 |
+
$address = $this->getCustomer()->getPrimaryShippingAddress();
|
45 |
+
}
|
46 |
+
if ($address) {
|
47 |
+
$addressId = $address->getId();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
$select = $this->getLayout()->createBlock('core/html_select')
|
52 |
+
->setName($type.'_address_id')
|
53 |
+
->setId($type.'-address-select')
|
54 |
+
->setClass('address-select')
|
55 |
+
->setExtraParams('onchange="newAddress(\''.$type.'\', this.value)"')
|
56 |
+
->setValue($addressId)
|
57 |
+
->setOptions($options);
|
58 |
+
|
59 |
+
$select->addOption('', Mage::helper('checkout')->__('New Address'));
|
60 |
+
|
61 |
+
return $select->getHtml();
|
62 |
+
}
|
63 |
+
return '';
|
64 |
+
}
|
65 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Coupon.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Sinabs_Directcheckout_Block_Checkout_Coupon extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
const XML_PATH_DIRECTCHECKOUT_EXTRA_ENABLE_COUPON = 'directcheckout/extra/enable_coupon';
|
6 |
+
|
7 |
+
protected function _getQuote()
|
8 |
+
{
|
9 |
+
return Mage::getSingleton('checkout/cart')->getQuote();
|
10 |
+
}
|
11 |
+
|
12 |
+
public function isEnabled()
|
13 |
+
{
|
14 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_EXTRA_ENABLE_COUPON);
|
15 |
+
}
|
16 |
+
|
17 |
+
public function isCouponEnable()
|
18 |
+
{
|
19 |
+
return (string)$this->_getQuote()->getCouponCode() != '';
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getCouponCode()
|
23 |
+
{
|
24 |
+
return $this->_getQuote()->getCouponCode();
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Gift.php
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Gift extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* XML path allow gift's order
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
const XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ORDER = 'sales/gift_options/allow_order';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* XML path allow to add gift's items
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
const XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ITEMS = 'sales/gift_options/allow_items';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Is allowed gift's order or gift's items
|
36 |
+
*
|
37 |
+
* @return boolean
|
38 |
+
*/
|
39 |
+
public function isShow()
|
40 |
+
{
|
41 |
+
return Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ORDER) || Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ITEMS);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Is allowed gift's order
|
46 |
+
*
|
47 |
+
* @return boolean
|
48 |
+
*/
|
49 |
+
public function allowGiftOrder()
|
50 |
+
{
|
51 |
+
return Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ORDER);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Is allowed gift's items
|
56 |
+
*
|
57 |
+
* @return boolean
|
58 |
+
*/
|
59 |
+
public function allowGiftItems()
|
60 |
+
{
|
61 |
+
return Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ITEMS);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Is allowed all gift's message
|
66 |
+
*
|
67 |
+
* @return boolean
|
68 |
+
*/
|
69 |
+
public function allowGiftAll()
|
70 |
+
{
|
71 |
+
return Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ORDER) && Mage::getStoreConfig(self::XML_PATH_SALES_GIFT_OPTIONS_ALLOW_ITEMS);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Retrieve customer name
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function getCustomerName()
|
80 |
+
{
|
81 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
82 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
83 |
+
if ($customer->getId()) {
|
84 |
+
return $customer->getFirstname() . ' ' . $customer->getLastname();
|
85 |
+
}
|
86 |
+
}
|
87 |
+
return '';
|
88 |
+
}
|
89 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Links.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Links extends Mage_Checkout_Block_Links
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Add link on checkout page to parent block
|
24 |
+
*
|
25 |
+
* @return Mage_Checkout_Block_Links
|
26 |
+
*/
|
27 |
+
public function addCheckoutLink()
|
28 |
+
{
|
29 |
+
if (!$this->helper('checkout')->canOnepageCheckout()) {
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
$parentBlock = $this->getParentBlock();
|
34 |
+
if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) {
|
35 |
+
$text = $this->__('Checkout');
|
36 |
+
$parentBlock->addLink(
|
37 |
+
$text, (Mage::helper('directcheckout')->isEnabled()) ? 'directcheckout' : 'checkout', $text,
|
38 |
+
true, array('_secure' => true), 60, null,
|
39 |
+
'class="top-link-checkout"'
|
40 |
+
);
|
41 |
+
}
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Newsletter.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Newsletter extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* XML path extra newsletter
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
const XML_PATH_DIRECTCHECKOUT_EXTRA_ENABLE_NEWSLETTER = 'directcheckout/extra/enable_newsletter';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Display Newsletter
|
30 |
+
*
|
31 |
+
* @return boolean
|
32 |
+
*/
|
33 |
+
public function isEnabled()
|
34 |
+
{
|
35 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_EXTRA_ENABLE_NEWSLETTER);
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Onepage/Link.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Onepage_Link extends Mage_Checkout_Block_Onepage_Link
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Retrieve checkout URL
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getCheckoutUrl()
|
28 |
+
{
|
29 |
+
return $this->getUrl((Mage::helper('directcheckout')->isEnabled()) ? 'directcheckout' : 'checkout', array(
|
30 |
+
'_secure' => true
|
31 |
+
));
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Sinabs/Directcheckout/Block/Checkout/Shipping.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Block_Checkout_Shipping extends Mage_Checkout_Block_Onepage_Shipping
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Retrieve addresses list
|
24 |
+
*
|
25 |
+
* @param string $type
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function getAddressesHtmlSelect($type)
|
29 |
+
{
|
30 |
+
if ($this->isCustomerLoggedIn()) {
|
31 |
+
$options = array();
|
32 |
+
foreach ($this->getCustomer()->getAddresses() as $address) {
|
33 |
+
$options[] = array(
|
34 |
+
'value' => $address->getId(),
|
35 |
+
'label' => $address->format('oneline')
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
$addressId = $this->getAddress()->getCustomerAddressId();
|
40 |
+
if (empty($addressId)) {
|
41 |
+
if ($type=='billing') {
|
42 |
+
$address = $this->getCustomer()->getPrimaryBillingAddress();
|
43 |
+
} else {
|
44 |
+
$address = $this->getCustomer()->getPrimaryShippingAddress();
|
45 |
+
}
|
46 |
+
if ($address) {
|
47 |
+
$addressId = $address->getId();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
$select = $this->getLayout()->createBlock('core/html_select')
|
52 |
+
->setName($type.'_address_id')
|
53 |
+
->setId($type.'-address-select')
|
54 |
+
->setClass('address-select')
|
55 |
+
->setExtraParams('onchange="newAddress(\''.$type.'\', this.value)"')
|
56 |
+
->setValue($addressId)
|
57 |
+
->setOptions($options);
|
58 |
+
|
59 |
+
$select->addOption('', Mage::helper('checkout')->__('New Address'));
|
60 |
+
|
61 |
+
return $select->getHtml();
|
62 |
+
}
|
63 |
+
return '';
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
app/code/community/Sinabs/Directcheckout/Helper/Data.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* XML path allowed to order in guest
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
const XML_PATH_CHECKOUT_OPTIONS_GUEST_CHECKOUT = 'checkout/options/guest_checkout';
|
27 |
+
|
28 |
+
const XML_PATH_DIRECTCHECKOUT_GENERAL_ENABLED = 'directcheckout/general/enabled';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Is Enabled
|
32 |
+
*
|
33 |
+
* @return boolean
|
34 |
+
*/
|
35 |
+
public function isEnabled()
|
36 |
+
{
|
37 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GENERAL_ENABLED) && Mage::helper('core')->isModuleOutputEnabled('Sinabs_Directcheckout');
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Set Shipping default address
|
42 |
+
*
|
43 |
+
* @param array $data
|
44 |
+
* @return Mage_Core_Checkout_Model_Quote
|
45 |
+
*/
|
46 |
+
public function setDefaultShipping($data)
|
47 |
+
{
|
48 |
+
$region = (!isset($data['region']) || empty($data['region'])) ? "-" : $data['region'];
|
49 |
+
$region_id = (!isset($data['region_id']) || empty($data['region_id'])) ? "-" : $data['region_id'];
|
50 |
+
$city = (!isset($data['city']) || empty($data['city'])) ? "-" : $data['city'];
|
51 |
+
|
52 |
+
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
|
53 |
+
|
54 |
+
$quote->getShippingAddress()
|
55 |
+
->setCountryId($data['country_id'])
|
56 |
+
->setRegionId($region_id)
|
57 |
+
->setRegion($region)
|
58 |
+
->setCity($city)
|
59 |
+
->setCollectShippingRates(true);
|
60 |
+
|
61 |
+
$quote->getShippingAddress()->collectShippingRates();
|
62 |
+
$quote->setTotalsCollectedFlag(false);
|
63 |
+
$quote->save();
|
64 |
+
|
65 |
+
return $quote;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Is newsletter module enabled
|
70 |
+
*
|
71 |
+
* @return boolean
|
72 |
+
*/
|
73 |
+
public function isNewsletterEnabled()
|
74 |
+
{
|
75 |
+
return Mage::helper('core')->isModuleOutputEnabled('Mage_Newsletter');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Is guest order enabled
|
80 |
+
*
|
81 |
+
* @return boolean
|
82 |
+
*/
|
83 |
+
public function isGuestEnabled()
|
84 |
+
{
|
85 |
+
return Mage::getStoreConfig(self::XML_PATH_CHECKOUT_OPTIONS_GUEST_CHECKOUT);
|
86 |
+
}
|
87 |
+
}
|
app/code/community/Sinabs/Directcheckout/Helper/Url.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Helper_Url extends Mage_Checkout_Helper_Url
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Retrieve checkout URL
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getCheckoutUrl()
|
28 |
+
{
|
29 |
+
return $this->_getUrl((Mage::helper('directcheckout')->isEnabled()) ? 'directcheckout' : 'checkout');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Sinabs/Directcheckout/controllers/AjaxController.php
ADDED
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Action
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Billing address
|
24 |
+
*
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
+
private $_dataBillingAddress;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* XML path agreements config
|
31 |
+
*
|
32 |
+
*/
|
33 |
+
const XML_PATH_CHECKOUT_OPTIONS_ENABLE_AGREEMENTS = 'checkout/options/enable_agreements';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get Onepage Object
|
37 |
+
*
|
38 |
+
* @return Mage_Checkout_Model_Type_Onepage
|
39 |
+
*/
|
40 |
+
protected function _getOnepage()
|
41 |
+
{
|
42 |
+
return Mage::getSingleton('checkout/type_onepage');
|
43 |
+
}
|
44 |
+
|
45 |
+
protected function _getCart()
|
46 |
+
{
|
47 |
+
return Mage::getSingleton('checkout/cart');
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Update Shipping, Payment and resume
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
public function update_spoAction()
|
55 |
+
{
|
56 |
+
$data = $this->getRequest()->getPost('billing', array());
|
57 |
+
|
58 |
+
if ($data['use_for_shipping'] == '1') {
|
59 |
+
if($this->getRequest()->getParam('billing_address_id') && intval($this->getRequest()->getParam('billing_address_id')) > 0) {
|
60 |
+
$idAddress = $this->getRequest()->getParam('billing_address_id');
|
61 |
+
$address = Mage::getModel('customer/address')->load($idAddress);
|
62 |
+
$data['country_id'] = $address->getCountry();
|
63 |
+
} else {
|
64 |
+
$data = $this->getRequest()->getPost('billing', array());
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
if ($data['use_for_shipping'] == '0') {
|
69 |
+
if ($this->getRequest()->getParam('shipping_address_id') && intval($this->getRequest()->getParam('shipping_address_id')) > 0) {
|
70 |
+
$idAddress = $this->getRequest()->getParam('shipping_address_id');
|
71 |
+
$address = Mage::getModel('customer/address')->load($idAddress);
|
72 |
+
$data['country_id'] = $address->getCountry();
|
73 |
+
} else {
|
74 |
+
$data = $this->getRequest()->getPost('shipping', array());
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
if (!isset($data['country_id']) || empty($data['country_id'])) {
|
79 |
+
$data['country_id'] = Mage::getStoreConfig('general/country/default');
|
80 |
+
}
|
81 |
+
|
82 |
+
$region = (!isset($data['region']) || empty($data['region'])) ? "-" : $data['region'];
|
83 |
+
$region_id = (!isset($data['region_id']) || empty($data['region_id'])) ? "-" : $data['region_id'];
|
84 |
+
$city = (!isset($data['city']) || empty($data['city'])) ? "-" : $data['city'];
|
85 |
+
|
86 |
+
$quote = $this->_getOnepage()->getQuote();
|
87 |
+
|
88 |
+
$quote->getShippingAddress()
|
89 |
+
->setCountryId($data['country_id'])
|
90 |
+
->setRegionId($region_id)
|
91 |
+
->setRegion($region)
|
92 |
+
->setCity($city)
|
93 |
+
->setCollectShippingRates(true);
|
94 |
+
|
95 |
+
$quote->getBillingAddress()->setCountryId($data['country_id']);
|
96 |
+
$quote->getShippingAddress()->collectShippingRates();
|
97 |
+
$quote->setTotalsCollectedFlag(false);
|
98 |
+
|
99 |
+
$shippingMethod = $this->getRequest()->getParam('shipping_method');
|
100 |
+
$shippingRates = $quote->getShippingAddress()->getAllShippingRates();
|
101 |
+
if (count($shippingRates) == 1) {
|
102 |
+
$shippingMethod = $shippingRates[0]->getCode();
|
103 |
+
}
|
104 |
+
|
105 |
+
if ($shippingMethod != '') {
|
106 |
+
$quote->getShippingAddress()->setShippingMethod($shippingMethod);
|
107 |
+
}
|
108 |
+
|
109 |
+
$quote->collectTotals();
|
110 |
+
$quote->save();
|
111 |
+
|
112 |
+
$this->loadLayout(false);
|
113 |
+
$this->renderLayout();
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Save order
|
118 |
+
*
|
119 |
+
*/
|
120 |
+
public function save_orderAction()
|
121 |
+
{
|
122 |
+
$dataBilling = $this->getRequest()->getPost('billing', array());
|
123 |
+
$isSubscribed = $this->getRequest()->getPost('customer_subscribed', false);
|
124 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
125 |
+
$registered = $this->getRequest()->getParam('customer_register', false);
|
126 |
+
|
127 |
+
try {
|
128 |
+
$result = $this->_getOnepage()->saveBilling($dataBilling, $customerAddressId);
|
129 |
+
|
130 |
+
if (isset($result['error'])) {
|
131 |
+
throw new Exception($this->__("Please check billing address information"));
|
132 |
+
}
|
133 |
+
|
134 |
+
// Billing address and shipping address are different
|
135 |
+
if (!isset($dataBilling['use_for_shipping']) || $dataBilling['use_for_shipping'] == 0) {
|
136 |
+
$dataShipping = $this->getRequest()->getPost('shipping', array());
|
137 |
+
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
|
138 |
+
$result = $this->_getOnepage()->saveShipping($dataShipping, $customerAddressId);
|
139 |
+
if (isset($result['error'])) {
|
140 |
+
throw new Exception($this->__("Please check shipping address information"));
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
// Shipping Method
|
145 |
+
$shippingMethod = $this->getRequest()->getPost('shipping_method', '');
|
146 |
+
$result = $this->_getOnepage()->saveShippingMethod($shippingMethod);
|
147 |
+
if (isset($result['error'])) {
|
148 |
+
throw new Exception($this->__('Select Shipping Method'));
|
149 |
+
}
|
150 |
+
|
151 |
+
// Section redirection Paypal
|
152 |
+
// Save payment method
|
153 |
+
$data = $this->getRequest()->getPost('payment', array());
|
154 |
+
$result = $this->_getOnepage()->savePayment($data);
|
155 |
+
if (isset($result['error'])) {
|
156 |
+
throw new Exception($this->__('Payment method is not defined'));
|
157 |
+
}
|
158 |
+
|
159 |
+
// get section and redirect data
|
160 |
+
$redirectUrl = $this->_getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
|
161 |
+
if ($redirectUrl) {
|
162 |
+
$result['redirect'] = $redirectUrl;
|
163 |
+
$this->_getOnepage()->saveOrder();
|
164 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
165 |
+
return;
|
166 |
+
}
|
167 |
+
|
168 |
+
// Save payment method
|
169 |
+
$data = $this->getRequest()->getPost('payment', array());
|
170 |
+
$result = $this->_getOnepage()->savePayment($data);
|
171 |
+
if (isset($result['error'])) {
|
172 |
+
throw new Exception($this->__('Payment method is not defined'));
|
173 |
+
}
|
174 |
+
|
175 |
+
// Agreements
|
176 |
+
if (Mage::getStoreConfig(self::XML_PATH_CHECKOUT_OPTIONS_ENABLE_AGREEMENTS)) {
|
177 |
+
$data = $this->getRequest()->getPost('agreement', array());
|
178 |
+
if (!isset($data[1]) || $data[1] != '1') {
|
179 |
+
throw new Exception($this->__('Please agree to all the terms and conditions before placing the order.'));
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
if ($registered !== false) {
|
184 |
+
$this->_createCustomer($dataBilling, $isSubscribed);
|
185 |
+
}
|
186 |
+
|
187 |
+
$this->_getOnepage()->saveOrder();
|
188 |
+
|
189 |
+
$redirectUrl = $this->_getOnepage()->getCheckout()->getRedirectUrl();
|
190 |
+
if ($redirectUrl == '') $redirectUrl = "/checkout/onepage/success";
|
191 |
+
$result['success'] = true;
|
192 |
+
$result['error'] = false;
|
193 |
+
if (isset($redirectUrl)) {
|
194 |
+
$result['redirect'] = $redirectUrl;
|
195 |
+
}
|
196 |
+
Mage::getSingleton('checkout/cart')->truncate()->save();
|
197 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
198 |
+
} catch (Exception $e) {
|
199 |
+
$result['error'] = true;
|
200 |
+
$result['title'] = $this->__('Error');
|
201 |
+
$result['message'] = $e->getMessage();
|
202 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
203 |
+
return;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Verify and set coupon code
|
209 |
+
*
|
210 |
+
*/
|
211 |
+
public function update_couponAction()
|
212 |
+
{
|
213 |
+
$couponCode = (string) $this->getRequest()->getParam('coupon');
|
214 |
+
$response = array();
|
215 |
+
|
216 |
+
try {
|
217 |
+
$this->_getCart()
|
218 |
+
->getQuote()
|
219 |
+
->getShippingAddress()
|
220 |
+
->setCollectShippingRates(true);
|
221 |
+
$this->_getCart()
|
222 |
+
->getQuote()
|
223 |
+
->setCouponCode(strlen($couponCode) ? $couponCode : '')
|
224 |
+
->collectTotals()
|
225 |
+
->save();
|
226 |
+
|
227 |
+
if ($couponCode != $this->_getCart()->getQuote()->getCouponCode()) {
|
228 |
+
$response['error']= true;
|
229 |
+
$response['title'] = $this->__('Error');
|
230 |
+
$response['message'] = $this->__('Coupon code "%s" is not valid.', Mage::helper('core')->htmlEscape($couponCode));
|
231 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
232 |
+
return;
|
233 |
+
}
|
234 |
+
|
235 |
+
$response['success'] = true;
|
236 |
+
$response['error'] = false;
|
237 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
238 |
+
} catch (Mage_Core_Exception $e) {
|
239 |
+
$response['error'] = true;
|
240 |
+
$response['title'] = $this->__('Error');
|
241 |
+
$response['message'] = $e->getMessage();
|
242 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
243 |
+
return;
|
244 |
+
} catch (Exception $e) {
|
245 |
+
$response['error'] = true;
|
246 |
+
$response['title'] = $this->__('Error');
|
247 |
+
$response['message'] = $e->getMessage();
|
248 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
249 |
+
return;
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Create Customer
|
255 |
+
*
|
256 |
+
* @param array $data
|
257 |
+
* @return Mage_Customer_Model_Customer_Session
|
258 |
+
*/
|
259 |
+
private function _createCustomer($data, $isSubscribed = false)
|
260 |
+
{
|
261 |
+
$customer = Mage::getModel('customer/customer');
|
262 |
+
$email = $data['email'];
|
263 |
+
|
264 |
+
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
|
265 |
+
$customer->loadByEmail($email);
|
266 |
+
|
267 |
+
if(!$customer->getId()) {
|
268 |
+
$customer->setEmail($email);
|
269 |
+
$customer->setFirstname($data['firstname']);
|
270 |
+
$customer->setLastname($data['lastname']);
|
271 |
+
$customer->setPassword($data['customer_password']);
|
272 |
+
}
|
273 |
+
$customer->save();
|
274 |
+
$customer->setConfirmation(null);
|
275 |
+
$customer->save();
|
276 |
+
|
277 |
+
if ($customer->getId()) {
|
278 |
+
if ($isSubscribed !== false) {
|
279 |
+
Mage::getModel('newsletter/subscriber')->subscribe($customer->getEmail());
|
280 |
+
}
|
281 |
+
} else {
|
282 |
+
throw new Exception("Unable to create customer account");
|
283 |
+
}
|
284 |
+
|
285 |
+
return Mage::getSingleton('customer/session')->loginById($customer->getId());
|
286 |
+
}
|
287 |
+
}
|
app/code/community/Sinabs/Directcheckout/controllers/Customer/AjaxController.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_Customer_AjaxController extends Mage_Core_Controller_Front_Action
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Authentication form
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
public function loginAction()
|
27 |
+
{
|
28 |
+
$this->loadLayout(false);
|
29 |
+
$this->renderLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Authentication form post action
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
public function loginPostAction()
|
37 |
+
{
|
38 |
+
$login = $this->getRequest()->getParam('login');
|
39 |
+
$password = $this->getRequest()->getParam('password');
|
40 |
+
$response = array('success' => false);
|
41 |
+
|
42 |
+
if ($login && $password) {
|
43 |
+
try {
|
44 |
+
Mage::getsingleton('customer/session')->login($login, $password);
|
45 |
+
} catch (Exception $e) {
|
46 |
+
$response['success'] = false;
|
47 |
+
$response['message'] = $e->getMessage();
|
48 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
$response['success'] = true;
|
53 |
+
$response['message'] = $this->__('Successful authentication, you will be redirected in two seconds');
|
54 |
+
$response['redirect'] = Mage::getUrl('directcheckout');
|
55 |
+
$response['timeout'] = 2000;
|
56 |
+
} else {
|
57 |
+
$response['success'] = false;
|
58 |
+
$response['message'] = $this->__('All fields are required');
|
59 |
+
}
|
60 |
+
|
61 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Forgot password form
|
66 |
+
*
|
67 |
+
*/
|
68 |
+
public function forgetAction()
|
69 |
+
{
|
70 |
+
$this->loadLayout(false);
|
71 |
+
$this->renderLayout();
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Forgot password form post action
|
76 |
+
*
|
77 |
+
*/
|
78 |
+
public function forgetPostAction()
|
79 |
+
{
|
80 |
+
$email = (string) $this->getRequest()->getPost('customer-email');
|
81 |
+
|
82 |
+
if ($email) {
|
83 |
+
$result = array();
|
84 |
+
if (!Zend_Validate::is($email, 'EmailAddress')) {
|
85 |
+
$result['success'] = false;
|
86 |
+
$result['message'] = $this->__('Invalid email address.');
|
87 |
+
}
|
88 |
+
|
89 |
+
$customer = Mage::getModel('customer/customer')
|
90 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
91 |
+
->loadByEmail($email);
|
92 |
+
|
93 |
+
if ($customer->getId()) {
|
94 |
+
try {
|
95 |
+
$newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
|
96 |
+
$customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
|
97 |
+
$customer->sendPasswordResetConfirmationEmail();
|
98 |
+
} catch (Exception $e) {
|
99 |
+
$result['error'] = 1;
|
100 |
+
$result['message'] = $e->getMessage();
|
101 |
+
}
|
102 |
+
}
|
103 |
+
$result['success'] = true;
|
104 |
+
$result['message'] = Mage::helper('customer')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('customer')->htmlEscape($email));
|
105 |
+
} else {
|
106 |
+
$result['success'] = false;
|
107 |
+
$result['message'] = $this->__('Please enter your email.');
|
108 |
+
}
|
109 |
+
|
110 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
111 |
+
}
|
112 |
+
}
|
app/code/community/Sinabs/Directcheckout/controllers/IndexController.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Sinabs
|
16 |
+
* @package Sinabs_Directcheckout
|
17 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Sinabs_Directcheckout_IndexController extends Mage_Core_Controller_Front_Action
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* XML Path page title
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
const XML_PATH_DIRECTCHECKOUT_GENERAL_PAGE_TITLE = 'directcheckout/general/page_title';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* IndexAction
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function indexAction()
|
33 |
+
{
|
34 |
+
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
|
35 |
+
$data['country_id'] = Mage::getStoreConfig('general/country/default');
|
36 |
+
|
37 |
+
if (!$quote->hasItems() || $quote->getHasError()) {
|
38 |
+
$this->_redirect('checkout/cart');
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
if (!$quote->validateMinimumAmount()) {
|
43 |
+
Mage::getSingleton('checkout/session')->addError(Mage::getStoreConfig('sales/minimum_order/error_message'));
|
44 |
+
$this->_redirect('checkout/cart');
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
|
48 |
+
if (!Mage::helper('directcheckout')->isEnabled()) {
|
49 |
+
$this->_redirect('checkout');
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
Mage::helper('directcheckout/data')->setDefaultShipping($data);
|
54 |
+
|
55 |
+
$this->loadLayout();
|
56 |
+
$this->getLayout()->getBlock('head')->setTitle(Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GENERAL_PAGE_TITLE));
|
57 |
+
$this->renderLayout();
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Gift Action
|
62 |
+
*
|
63 |
+
*/
|
64 |
+
public function giftAction()
|
65 |
+
{
|
66 |
+
$this->loadLayout(false);
|
67 |
+
$this->renderLayout();
|
68 |
+
}
|
69 |
+
}
|
app/code/community/Sinabs/Directcheckout/etc/config.xml
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Sinabs
|
17 |
+
* @package Sinabs_Directcheckout
|
18 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<Sinabs_Directcheckout>
|
26 |
+
<version>0.1.1</version>
|
27 |
+
</Sinabs_Directcheckout>
|
28 |
+
</modules>
|
29 |
+
<global>
|
30 |
+
<blocks>
|
31 |
+
<directcheckout>
|
32 |
+
<class>Sinabs_Directcheckout_Block</class>
|
33 |
+
</directcheckout>
|
34 |
+
<checkout>
|
35 |
+
<rewrite>
|
36 |
+
<onepage_link>Sinabs_Directcheckout_Block_Checkout_Onepage_Link</onepage_link>
|
37 |
+
<links>Sinabs_Directcheckout_Block_Checkout_Links</links>
|
38 |
+
</rewrite>
|
39 |
+
</checkout>
|
40 |
+
</blocks>
|
41 |
+
<helpers>
|
42 |
+
<directcheckout>
|
43 |
+
<class>Sinabs_Directcheckout_Helper</class>
|
44 |
+
</directcheckout>
|
45 |
+
<checkout>
|
46 |
+
<rewrite>
|
47 |
+
<url>Sinabs_Directcheckout_Helper_Url</url>
|
48 |
+
</rewrite>
|
49 |
+
</checkout>
|
50 |
+
</helpers>
|
51 |
+
</global>
|
52 |
+
<frontend>
|
53 |
+
<routers>
|
54 |
+
<directcheckout>
|
55 |
+
<use>standard</use>
|
56 |
+
<args>
|
57 |
+
<module>Sinabs_Directcheckout</module>
|
58 |
+
<frontName>directcheckout</frontName>
|
59 |
+
</args>
|
60 |
+
</directcheckout>
|
61 |
+
</routers>
|
62 |
+
<layout>
|
63 |
+
<updates>
|
64 |
+
<directcheckout>
|
65 |
+
<file>directcheckout.xml</file>
|
66 |
+
</directcheckout>
|
67 |
+
</updates>
|
68 |
+
</layout>
|
69 |
+
<translate>
|
70 |
+
<modules>
|
71 |
+
<Sinabs_Directcheckout>
|
72 |
+
<files>
|
73 |
+
<default>Sinabs_Directcheckout.csv</default>
|
74 |
+
</files>
|
75 |
+
</Sinabs_Directcheckout>
|
76 |
+
</modules>
|
77 |
+
</translate>
|
78 |
+
</frontend>
|
79 |
+
<adminhtml>
|
80 |
+
<translate>
|
81 |
+
<modules>
|
82 |
+
<Sinabs_Directcheckout>
|
83 |
+
<files>
|
84 |
+
<default>Sinabs_Directcheckout.csv</default>
|
85 |
+
</files>
|
86 |
+
</Sinabs_Directcheckout>
|
87 |
+
</modules>
|
88 |
+
</translate>
|
89 |
+
<acl>
|
90 |
+
<resources>
|
91 |
+
<admin>
|
92 |
+
<children>
|
93 |
+
<system>
|
94 |
+
<children>
|
95 |
+
<config>
|
96 |
+
<children>
|
97 |
+
<directcheckout translate="title" module="directcheckout">
|
98 |
+
<title>Section Directcheckout</title>
|
99 |
+
</directcheckout>
|
100 |
+
</children>
|
101 |
+
</config>
|
102 |
+
</children>
|
103 |
+
</system>
|
104 |
+
</children>
|
105 |
+
</admin>
|
106 |
+
</resources>
|
107 |
+
</acl>
|
108 |
+
</adminhtml>
|
109 |
+
<default>
|
110 |
+
<directcheckout>
|
111 |
+
<general>
|
112 |
+
<page_title>Directcheckout</page_title>
|
113 |
+
</general>
|
114 |
+
</directcheckout>
|
115 |
+
</default>
|
116 |
+
</config>
|
app/code/community/Sinabs/Directcheckout/etc/system.xml
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Sinabs
|
17 |
+
* @package Sinabs_Directcheckout
|
18 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<tabs>
|
25 |
+
<sinabs transtale="label" module="directcheckout">
|
26 |
+
<label>Sinabs</label>
|
27 |
+
<sort_order>1000</sort_order>
|
28 |
+
</sinabs>
|
29 |
+
</tabs>
|
30 |
+
<sections>
|
31 |
+
<directcheckout translate="label" module="directcheckout">
|
32 |
+
<label>Direct checkout</label>
|
33 |
+
<tab>sinabs</tab>
|
34 |
+
<frontend_type>text</frontend_type>
|
35 |
+
<sort_order>101</sort_order>
|
36 |
+
<show_in_default>1</show_in_default>
|
37 |
+
<show_in_website>1</show_in_website>
|
38 |
+
<show_in_store>1</show_in_store>
|
39 |
+
<groups>
|
40 |
+
<general translate="label">
|
41 |
+
<label>General</label>
|
42 |
+
<frontend_type>text</frontend_type>
|
43 |
+
<sort_order>10</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
<fields>
|
48 |
+
<enabled translate="label">
|
49 |
+
<label>Enabled</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
52 |
+
<sort_order>10</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 |
+
</enabled>
|
57 |
+
<page_title translate="label">
|
58 |
+
<label>Page Title</label>
|
59 |
+
<frontend_type>text</frontend_type>
|
60 |
+
<sort_order>20</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
</page_title>
|
65 |
+
</fields>
|
66 |
+
</general>
|
67 |
+
<extra translate="label">
|
68 |
+
<label>Extra</label>
|
69 |
+
<frontend_type>text</frontend_type>
|
70 |
+
<sort_order>20</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
<fields>
|
75 |
+
<enable_newsletter translate="label">
|
76 |
+
<label>Enable Newsletter</label>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
79 |
+
<sort_order>10</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</enable_newsletter>
|
84 |
+
<enable_coupon translate="label">
|
85 |
+
<label>Enable Coupon Code</label>
|
86 |
+
<frontend_type>select</frontend_type>
|
87 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
88 |
+
<sort_order>20</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</enable_coupon>
|
93 |
+
</fields>
|
94 |
+
</extra>
|
95 |
+
</groups>
|
96 |
+
</directcheckout>
|
97 |
+
</sections>
|
98 |
+
</config>
|
app/design/frontend/default/default/layout/directcheckout.xml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package default_default
|
24 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<directcheckout_index_index>
|
31 |
+
<reference name="root">
|
32 |
+
<action method="setTemplate">
|
33 |
+
<template>page/1column.phtml</template>
|
34 |
+
</action>
|
35 |
+
</reference>
|
36 |
+
<reference name="head">
|
37 |
+
<action method="addItem"><type>skin_css</type><stylesheet>directcheckout/css/styles.css</stylesheet></action>
|
38 |
+
<action method="addItem"><type>skin_css</type><stylesheet>directcheckout/css/modal.css</stylesheet></action>
|
39 |
+
<action method="addItem"><type>js</type><name>directcheckout/modal.js</name></action>
|
40 |
+
<action method="addItem"><type>js</type><name>directcheckout/directcheckout.js</name></action>
|
41 |
+
</reference>
|
42 |
+
<reference name="content">
|
43 |
+
<block type="checkout/onepage" name="directcheckout.checkout" template="directcheckout/checkout.phtml">
|
44 |
+
<block type="directcheckout/checkout_billing" name="directcheckout.checkout.billing" as="billing" template="directcheckout/checkout/billing.phtml" />
|
45 |
+
<block type="directcheckout/checkout_shipping" name="directcheckout.checkout.shipping" as="shipping" template="directcheckout/checkout/shipping.phtml" />
|
46 |
+
<block type="checkout/onepage_payment_methods" name="payment_methods" as="payment_methods" template="directcheckout/checkout/payment/methods.phtml" />
|
47 |
+
<block type="checkout/onepage_shipping_method_available" name="shipping_methods" as="shipping.methods" template="directcheckout/checkout/shipping_method.phtml" />
|
48 |
+
<block type="checkout/cart_totals" name="order.summary" as="summary" template="directcheckout/checkout/summary.phtml" />
|
49 |
+
<block type="core/template" name="additional" as="additional" template="directcheckout/checkout/additional.phtml">
|
50 |
+
<block type="checkout/agreements" name="checkout.agreements" template="directcheckout/checkout/additional/agreements.phtml" ifconfig="checkout/options/enable_agreements" />
|
51 |
+
<block type="directcheckout/checkout_newsletter" name="checkout.newsletter" template="directcheckout/checkout/additional/newsletter.phtml" />
|
52 |
+
<block type="directcheckout/checkout_coupon" name="coupon" template="directcheckout/checkout/additional/coupon.phtml" />
|
53 |
+
<!--<block type="directcheckout/checkout_gift" name="gift" template="directcheckout/checkout/gift.phtml" />-->
|
54 |
+
</block>
|
55 |
+
</block>
|
56 |
+
</reference>
|
57 |
+
</directcheckout_index_index>
|
58 |
+
<directcheckout_ajax_update_spo>
|
59 |
+
<block type="checkout/onepage_payment_methods" output="toHtml" name="update_spo" template="directcheckout/checkout/spo.phtml">
|
60 |
+
<block type="checkout/onepage_payment_methods" name="payment_methods" template="directcheckout/checkout/payment/methods.phtml" />
|
61 |
+
<block type="checkout/onepage_shipping_method_available" name="shipping_methods" template="directcheckout/checkout/shipping_method.phtml" />
|
62 |
+
<block type="checkout/cart_totals" name="order.summary" as="summary" template="directcheckout/checkout/summary.phtml" />
|
63 |
+
</block>
|
64 |
+
</directcheckout_ajax_update_spo>
|
65 |
+
<directcheckout_customer_ajax_login>
|
66 |
+
<block type="core/template" output="toHtml" name="customer.login" template="directcheckout/customer/login.phtml" />
|
67 |
+
</directcheckout_customer_ajax_login>
|
68 |
+
<directcheckout_customer_ajax_forget>
|
69 |
+
<block type="core/template" output="toHtml" name="customer.forget" template="directcheckout/customer/forget.phtml" />
|
70 |
+
</directcheckout_customer_ajax_forget>
|
71 |
+
<directcheckout_index_gift>
|
72 |
+
<block type="simplebuying/checkout_gift" output="toHtml" name="gift.options" template="directcheckout/checkout/gift/options.phtml" />
|
73 |
+
</directcheckout_index_gift>
|
74 |
+
</layout>
|
app/design/frontend/default/default/template/directcheckout/checkout.phtml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div id="directcheckout-wrapper">
|
28 |
+
<h1 class="directcheckout-title"><?php echo $this->__('Checkout'); ?></h1>
|
29 |
+
<?php if (!$this->isCustomerLoggedIn()) : ?>
|
30 |
+
<a class="modalbox" href="<?php echo $this->getUrl('directcheckout/customer_ajax/login'); ?>" title="<?php echo $this->__('Login'); ?>"><?php echo $this->__('Login'); ?></a>
|
31 |
+
<?php else : ?>
|
32 |
+
<button class="button" onclick="self.location='<?php echo $this->getUrl('customer/account/logout'); ?>';"><span><span><?php echo $this->__('Logout'); ?></span></span></button>
|
33 |
+
<?php endif; ?>
|
34 |
+
<div id="directcheckout-columns-wrapper">
|
35 |
+
<form id="directcheckout-form" method="post" action="">
|
36 |
+
<div class="directcheckout-col1">
|
37 |
+
<div id="billing_address">
|
38 |
+
<?php echo $this->getChildHtml('billing'); ?>
|
39 |
+
</div>
|
40 |
+
<div id="shipping_address">
|
41 |
+
<?php echo $this->getChildHtml('shipping'); ?>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<div class="directcheckout-col2">
|
45 |
+
<div id="shipping_methods">
|
46 |
+
<h3 class="step2"><?php echo $this->__('Shipping Methods'); ?></h3>
|
47 |
+
<div id="shipping_methods_list">
|
48 |
+
<?php echo $this->getChildHtml('shipping.methods'); ?>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<div id="payment_methods">
|
52 |
+
<h3 class="step3"><?php echo $this->__('Payment Methods'); ?></h3>
|
53 |
+
<div id="payment_methods_list">
|
54 |
+
<?php echo $this->getChildHtml('payment_methods'); ?>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<div class="directcheckout-col3">
|
59 |
+
<div id="review-order">
|
60 |
+
<h3 class="stepfinal"><?php echo $this->__('Order Review'); ?></h3>
|
61 |
+
<div id="review_order">
|
62 |
+
<?php echo $this->getChildHtml('summary'); ?>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
<div id="directcheckout-additional">
|
66 |
+
<?php echo $this->getChildHtml('additional'); ?>
|
67 |
+
</div>
|
68 |
+
<button type="button" onclick="saveOrder(); return false;" title="<?php echo $this->__('Checkout'); ?>" id="submit-order" class="button btn-proceed-checkout btn-checkout">
|
69 |
+
<span>
|
70 |
+
<span>
|
71 |
+
<?php echo $this->__('Checkout'); ?>
|
72 |
+
</span>
|
73 |
+
</span>
|
74 |
+
</button>
|
75 |
+
<span class="please-wait" id="review-please-wait" style="display:none;">
|
76 |
+
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Submitting order information...') ?>" title="<?php echo $this->__('Submitting order information...') ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>
|
77 |
+
</span>
|
78 |
+
</div>
|
79 |
+
</form>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<script type="text/javascript">
|
84 |
+
var urlSaveOrder = '<?php echo $this->getUrl('directcheckout/ajax/save_order'); ?>';
|
85 |
+
var urlSpo = '<?php echo $this->getUrl('directcheckout/ajax/update_spo'); ?>';
|
86 |
+
var urlCoupon = '<?php echo $this->getUrl('directcheckout/ajax/update_coupon'); ?>';
|
87 |
+
var listRegionJson = <?php echo $this->helper('directory')->getRegionJson(); ?>;
|
88 |
+
|
89 |
+
document.observe('dom:loaded', function() {
|
90 |
+
new Directcheckout();
|
91 |
+
new Directcheckout.Billing({ listRegion: listRegionJson });
|
92 |
+
new Directcheckout.Shipping({ listRegion: listRegionJson });
|
93 |
+
checkUseForShipping(false);
|
94 |
+
});
|
95 |
+
</script>
|
app/design/frontend/default/default/template/directcheckout/checkout/additional.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php echo $this->getChildHtml() ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/additional/agreements.phtml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Mage_Checkout_Block_Agreements
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php if (!$this->getAgreements()) return; ?>
|
33 |
+
<?php foreach ($this->getAgreements() as $_a): ?>
|
34 |
+
<div class="agreement-links">
|
35 |
+
<input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->htmlEscape($_a->getCheckboxText()) ?>" class="checkbox" />
|
36 |
+
<label for="agreement-<?php echo $_a->getId()?>">
|
37 |
+
<a href="javascript:;" onclick="Modalbox.show($('agreements-content'), { title: '<?php echo $this->__('Agreements'); ?>'});" class="inline"><?php echo $this->htmlEscape($_a->getCheckboxText()) ?></a>
|
38 |
+
</label>
|
39 |
+
<div style="display:none;">
|
40 |
+
<div class="agreement-content" id="agreements-content">
|
41 |
+
<h3><?php echo $this->__('Agreements'); ?></h3>
|
42 |
+
<?php if ($_a->getIsHtml()):?>
|
43 |
+
<?php echo $_a->getContent() ?>
|
44 |
+
<?php else:?>
|
45 |
+
<?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
|
46 |
+
<?php endif; ?>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<?php endforeach ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/additional/coupon.phtml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Sinabs_Directcheckout_Block_Checkout_Coupon
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php if (!$this->isEnabled()) return; ?>
|
33 |
+
<?php $_isCouponEnable = $this->isCouponEnable(); ?>
|
34 |
+
<div id="directcheckout-discount-wrapper">
|
35 |
+
<div class="directcheckout-discount">
|
36 |
+
<div class="directcheckout-input">
|
37 |
+
<input type="text" name="coupon_code" id="coupon_code" class="input-text" placeholder="<?php echo $this->__('Coupon Code'); ?>" value="<?php echo $this->getCouponCode(); ?>" <?php echo $this->isCouponEnable() ? 'readonly' : ''; ?>/>
|
38 |
+
<button type="button" id="coupon_add" title="<?php echo $this->__('Apply Coupon'); ?>" class="button" value="<?php echo $this->__('OK'); ?>" onclick="updateCouponCode();" style="<?php echo ($_isCouponEnable) ? 'display:none;' : ''; ?>">
|
39 |
+
<span>
|
40 |
+
<span><?php echo $this->__('OK'); ?></span>
|
41 |
+
</span>
|
42 |
+
</button>
|
43 |
+
<a class="x-delete" id="coupon_delete" onclick="updateCouponCode('delete');" style="<?php echo (!$_isCouponEnable) ? 'display:none' : ''; ?>">X</a>
|
44 |
+
<div id="button-loading"></div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
app/design/frontend/default/default/template/directcheckout/checkout/additional/newsletter.phtml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Sinabs_Directcheckout_Block_Checkout_Newsletter
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php if (!$this->isEnabled()) return; ?>
|
33 |
+
<?php if ($this->helper('directcheckout')->isNewsletterEnabled()) : ?>
|
34 |
+
<input type="checkbox" name="customer_subscribed" id="customer_subscribed" class="checkbox" checked="checked" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" />
|
35 |
+
<label for="customer_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
|
36 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/billing.phtml
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Sinabs_Directcheckout_Block_Checkout_Billing
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php $_isGuestEnabled = $this->helper('directcheckout')->isGuestEnabled(); ?>
|
33 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
34 |
+
<div class="my-account">
|
35 |
+
<h3 class="step1"><?php echo $this->__('My Account'); ?></h3>
|
36 |
+
<div class="field">
|
37 |
+
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
38 |
+
<div class="input-box">
|
39 |
+
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
<?php if ($_isGuestEnabled) : ?>
|
43 |
+
<div class="field">
|
44 |
+
<input type="checkbox" name="customer_register" class="checkbox" id="customer-register" checked="checked" />
|
45 |
+
<label for="customer-register"><?php echo $this->__('Create an account'); ?></label>
|
46 |
+
</div>
|
47 |
+
<?php endif; ?>
|
48 |
+
<div id="wrapper-register" style="<?php echo $_isGuestEnabled ? 'display:none;' : ''; ?>">
|
49 |
+
<div class="field">
|
50 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
51 |
+
<div class="input-box">
|
52 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
<div class="field">
|
56 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
57 |
+
<div class="input-box">
|
58 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<?php endif; ?>
|
64 |
+
|
65 |
+
<h3 <?php echo ($this->isCustomerLoggedIn()) ? 'class="step1"' : ''; ?>><?php echo $this->__('Billing Address'); ?></h3>
|
66 |
+
|
67 |
+
<?php if ($this->customerHasAddresses()): ?>
|
68 |
+
<label for="billing-address-select">
|
69 |
+
<?php echo $this->__('Select a billing address from your address book or enter a new address.') ?>
|
70 |
+
</label>
|
71 |
+
<div class="input-box">
|
72 |
+
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
73 |
+
</div>
|
74 |
+
<?php endif; ?>
|
75 |
+
|
76 |
+
<div id="billingForm" <?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
77 |
+
<input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
|
78 |
+
<div class="field">
|
79 |
+
<?php
|
80 |
+
echo $this->getLayout()
|
81 |
+
->createBlock('customer/widget_name')
|
82 |
+
->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())
|
83 |
+
->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')
|
84 |
+
->setFieldNameFormat('billing[%s]')
|
85 |
+
->setTemplate('directcheckout/customer/widget/name.phtml')
|
86 |
+
->toHtml()
|
87 |
+
?>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
<div class="spacer"></div>
|
91 |
+
|
92 |
+
<div class="field">
|
93 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
94 |
+
<div class="input-box">
|
95 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
<div class="field">
|
99 |
+
<label id="label_region_billing" for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
100 |
+
<div class="input-box">
|
101 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
102 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
103 |
+
</select>
|
104 |
+
<input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
109 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
110 |
+
<div class="input-box">
|
111 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
112 |
+
</div>
|
113 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
114 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
115 |
+
<div class="input-box address-line2">
|
116 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
117 |
+
</div>
|
118 |
+
<?php endfor; ?>
|
119 |
+
|
120 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
121 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
|
122 |
+
<div class="input-box">
|
123 |
+
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
124 |
+
</div>
|
125 |
+
<?php endif; ?>
|
126 |
+
|
127 |
+
<div class="postcode-city">
|
128 |
+
<div class="postcode">
|
129 |
+
<div class="field">
|
130 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
131 |
+
<div class="input-box">
|
132 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
<div class="city">
|
137 |
+
<div class="field">
|
138 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
139 |
+
<div class="input-box">
|
140 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
|
141 |
+
</div>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
<div class="spacer"></div>
|
147 |
+
|
148 |
+
<div class="phone-fax">
|
149 |
+
<div class="phone">
|
150 |
+
<div class="field">
|
151 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
152 |
+
<div class="input-box">
|
153 |
+
<input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
|
154 |
+
</div>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
<div class="fax">
|
158 |
+
<div class="field">
|
159 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
160 |
+
<div class="input-box">
|
161 |
+
<input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
|
162 |
+
</div>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
<div class="spacer"></div>
|
168 |
+
|
169 |
+
<div class="field">
|
170 |
+
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
171 |
+
<div class="input-box">
|
172 |
+
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
|
176 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
177 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
178 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
179 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
180 |
+
<?php if ($_dob->isEnabled()): ?>
|
181 |
+
<div class="field">
|
182 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
183 |
+
</div>
|
184 |
+
<?php endif; ?>
|
185 |
+
<?php if ($_gender->isEnabled()): ?>
|
186 |
+
<div class="field">
|
187 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
188 |
+
</div>
|
189 |
+
<?php endif ?>
|
190 |
+
<?php endif ?>
|
191 |
+
|
192 |
+
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
193 |
+
<?php if ($_taxvat->isEnabled()): ?>
|
194 |
+
<?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
195 |
+
<?php endif ?>
|
196 |
+
<?php endif; ?>
|
197 |
+
|
198 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
199 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
200 |
+
<?php else:?>
|
201 |
+
<input type="hidden" name="billing[save_in_address_book]" value="1" />
|
202 |
+
<?php endif; ?>
|
203 |
+
|
204 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
205 |
+
<?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div class="different-address">
|
209 |
+
<?php if ($this->canShip()): ?>
|
210 |
+
<input type="checkbox" onchange="checkUseForShipping(this.checked)" id="different-address-input" /> <?php echo $this->__('Ship to different address') ?>
|
211 |
+
<?php endif; ?>
|
212 |
+
</div>
|
213 |
+
|
214 |
+
<?php if ($this->canShip()): ?>
|
215 |
+
<input type="hidden" name="billing[use_for_shipping]" id="use_for_shipping" value="1" />
|
216 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/gift.phtml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Sinabs_Directcheckout_Block_Checkout_Gift
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<?php if ($this->isShow()) : ?>
|
33 |
+
<ul>
|
34 |
+
<li><a href="<?php echo $this->getUrl('directcheckout/index/gift'); ?>" class="modalbox" title="<?php echo $this->__('Gift Options'); ?>">Ajouter des options cadeau</a></li>
|
35 |
+
</ul>
|
36 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/gift/options.phtml
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php if ($this->allowGiftAll()) : ?>
|
28 |
+
<h4>Options cadeau pour toute la commande</h4>
|
29 |
+
<?php elseif ($this->allowGiftOrder()) : ?>
|
30 |
+
<h4>Option cadeau pour toute la commande</h4>
|
31 |
+
<ul class="form-list">
|
32 |
+
<li class="fields">
|
33 |
+
<div class="field">
|
34 |
+
<label for="gift-message-whole-from"><?php echo $this->__('From'); ?></label>
|
35 |
+
<div class="input-box">
|
36 |
+
<input type="text" name="giftmessage[][from]" id="gift-message-whole-from" title="<?php echo $this->__('From'); ?>" value="<?php echo $this->getCustomerName(); ?>" class="input-text" />
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
<div class="field">
|
40 |
+
<label for="gift-message-whole-to"><?php echo $this->__('To'); ?></label>
|
41 |
+
<div class="input-box">
|
42 |
+
<input type="text" name="giftmessage[][to]" id="gift-message-whole-to" title="<?php echo $this->__('To'); ?>" value="" class="input-text" />
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</li>
|
46 |
+
<li>
|
47 |
+
<label for="gift-message-whole-message"><?php echo $this->__('Message'); ?></label>
|
48 |
+
<div class="input-box">
|
49 |
+
<textarea name="giftmessage[][message]" title="<?php echo $this->__('Message'); ?>" class="input-text giftmessage-area" rows="5" cols="10"></textarea>
|
50 |
+
</div>
|
51 |
+
</li>
|
52 |
+
<button type="submit" class="button"><span><span><?php echo $this->__('Submit'); ?></span></span></button>
|
53 |
+
</ul>
|
54 |
+
<?php else : ?>
|
55 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/payment/methods.phtml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
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">
|
40 |
+
<input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" />
|
41 |
+
</span>
|
42 |
+
<?php $oneMethod = $_code; ?>
|
43 |
+
<?php endif; ?>
|
44 |
+
<label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
|
45 |
+
<?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
|
46 |
+
<?php echo $html; ?>
|
47 |
+
<?php endif; ?>
|
48 |
+
</li>
|
49 |
+
<?php endforeach; ?>
|
50 |
+
</ul>
|
51 |
+
</div>
|
app/design/frontend/default/default/template/directcheckout/checkout/review.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
-
|
app/design/frontend/default/default/template/directcheckout/checkout/shipping.phtml
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* @see Sinabs_Directcheckout_Block_Checkout_Shipping
|
30 |
+
*/
|
31 |
+
?>
|
32 |
+
<h3><?php echo $this->__('Shipping Address'); ?></h3>
|
33 |
+
<?php if ($this->customerHasAddresses()): ?>
|
34 |
+
<label for="shipping-address-select"><?php echo $this->__('Select a shipping address from your address book or enter a new address.') ?></label>
|
35 |
+
<div class="input-box">
|
36 |
+
<?php echo $this->getAddressesHtmlSelect('shipping') ?>
|
37 |
+
</div>
|
38 |
+
<?php endif ?>
|
39 |
+
|
40 |
+
<div id="shippingForm"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif ?>>
|
41 |
+
<input type="hidden" name="shipping[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="shipping:address_id" />
|
42 |
+
<?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('shipping:%s')->setFieldNameFormat('shipping[%s]')->toHtml() ?>
|
43 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
44 |
+
<label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
45 |
+
<div class="input-box">
|
46 |
+
<input type="text" title="<?php echo $this->__('Street Address') ?>" name="shipping[street][]" id="shipping:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
47 |
+
</div>
|
48 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
49 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
50 |
+
<div class="input-box address-line2">
|
51 |
+
<input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="shipping[street][]" id="shipping:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
|
52 |
+
</div>
|
53 |
+
<?php endfor; ?>
|
54 |
+
|
55 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
56 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
57 |
+
<div class="input-box">
|
58 |
+
<input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
|
59 |
+
</div>
|
60 |
+
<?php endif; ?>
|
61 |
+
|
62 |
+
<div class="field">
|
63 |
+
<label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
64 |
+
<div class="input-box">
|
65 |
+
<?php echo $this->getCountryHtmlSelect('shipping') ?>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
<div class="field">
|
69 |
+
<label id="label_region_shipping" for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
70 |
+
<div class="input-box">
|
71 |
+
<select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
72 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
73 |
+
</select>
|
74 |
+
<input type="text" id="shipping:region" name="shipping[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div class="postcode-city">
|
79 |
+
<div class="postcode">
|
80 |
+
<div class="field">
|
81 |
+
<label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
82 |
+
<div class="input-box">
|
83 |
+
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="shipping[postcode]" id="shipping:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
<div class="city">
|
88 |
+
<div class="field">
|
89 |
+
<label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
90 |
+
<div class="input-box">
|
91 |
+
<input type="text" title="<?php echo $this->__('City') ?>" name="shipping[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="shipping:city" />
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
<div class="spacer"></div>
|
98 |
+
|
99 |
+
<div class="phone-fax">
|
100 |
+
<div class="phone">
|
101 |
+
<div class="field">
|
102 |
+
<label for="shipping:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
103 |
+
<div class="input-box">
|
104 |
+
<input type="text" name="shipping[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="shipping:telephone" />
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
<div class="fax">
|
109 |
+
<div class="field">
|
110 |
+
<label for="shipping:fax"><?php echo $this->__('Fax') ?></label>
|
111 |
+
<div class="input-box">
|
112 |
+
<input type="text" name="shipping[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="shipping:fax" />
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
|
118 |
+
<div class="spacer"></div>
|
119 |
+
|
120 |
+
<div class="fields">
|
121 |
+
<label for="shipping:company"><?php echo $this->__('Company') ?></label>
|
122 |
+
<div class="input-box">
|
123 |
+
<input type="text" id="shipping:company" name="shipping[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
127 |
+
<input type="checkbox" name="shipping[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="shipping:save_in_address_book" <?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="shipping:save_in_address_book"><?php echo $this->__('Save in address book') ?></label></li>
|
128 |
+
<?php else:?>
|
129 |
+
<input type="hidden" name="shipping[save_in_address_book]" value="1" />
|
130 |
+
<?php endif;?>
|
131 |
+
</div>
|
app/design/frontend/default/default/template/directcheckout/checkout/shipping_method.phtml
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_shippingRateGroups = $this->getShippingRates(); ?>
|
28 |
+
<?php if (!$_shippingRateGroups): ?>
|
29 |
+
<p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
|
30 |
+
<?php else: ?>
|
31 |
+
<dl class="sp-methods">
|
32 |
+
<?php $shippingCodePrice = array(); ?>
|
33 |
+
<?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
|
34 |
+
<dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
|
35 |
+
<dd>
|
36 |
+
<ul>
|
37 |
+
<?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
|
38 |
+
<?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
|
39 |
+
<li>
|
40 |
+
<?php if ($_rate->getErrorMessage()): ?>
|
41 |
+
<ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
|
42 |
+
<?php else: ?>
|
43 |
+
<?php if ($_sole) : ?>
|
44 |
+
<span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
|
45 |
+
<?php else: ?>
|
46 |
+
<input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> onclick="updateSpo('shipping');" class="radio"/>
|
47 |
+
<?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
|
48 |
+
<script type="text/javascript">
|
49 |
+
//<![CDATA[
|
50 |
+
lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
|
51 |
+
//]]>
|
52 |
+
</script>
|
53 |
+
<?php endif; ?>
|
54 |
+
|
55 |
+
<?php endif; ?>
|
56 |
+
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
|
57 |
+
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
|
58 |
+
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
|
59 |
+
<?php echo $_excl; ?>
|
60 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
61 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
62 |
+
<?php endif; ?>
|
63 |
+
</label>
|
64 |
+
<?php endif ?>
|
65 |
+
</li>
|
66 |
+
<?php endforeach; ?>
|
67 |
+
</ul>
|
68 |
+
</dd>
|
69 |
+
<?php endforeach; ?>
|
70 |
+
</dl>
|
71 |
+
<script type="text/javascript">
|
72 |
+
//<![CDATA[
|
73 |
+
<?php if (!empty($shippingCodePrice)): ?>
|
74 |
+
var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
|
75 |
+
<?php endif; ?>
|
76 |
+
//]]>
|
77 |
+
</script>
|
78 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/spo.phtml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$data = array(
|
29 |
+
'shipping_methods' => $this->getChildHtml('shipping_methods'),
|
30 |
+
'payment_methods' => $this->getChildHtml('payment_methods'),
|
31 |
+
'summary' => $this->getChildHtml('summary'),
|
32 |
+
);
|
33 |
+
|
34 |
+
echo Zend_Json::encode($data);
|
35 |
+
?>
|
app/design/frontend/default/default/template/directcheckout/checkout/summary.phtml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<table class="table table-bordered table-striped">
|
28 |
+
<thead>
|
29 |
+
<tr>
|
30 |
+
<th><?php echo $this->__('Product'); ?></th>
|
31 |
+
<th><?php echo $this->__('Qty'); ?></th>
|
32 |
+
<th><?php echo $this->__('Subtotal'); ?></th>
|
33 |
+
</tr>
|
34 |
+
</thead>
|
35 |
+
<?php foreach ($this->getItems() as $item) : ?>
|
36 |
+
<tr>
|
37 |
+
<td class="name"><?php echo $item->getName(); ?></td>
|
38 |
+
<td class="qty"><?php echo $item->getQty(); ?></td>
|
39 |
+
<td class="total">
|
40 |
+
<span class="price"><?php echo $this->helper('checkout')->formatPrice($item->getRowTotal()); ?></span>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<?php endforeach; ?>
|
44 |
+
</table>
|
45 |
+
|
46 |
+
<table class="table table-striped">
|
47 |
+
<?php foreach ($this->getTotals() as $total) : ?>
|
48 |
+
<tr>
|
49 |
+
<td class="title">
|
50 |
+
<?php
|
51 |
+
$code = $total->getCode();
|
52 |
+
$value = $total->getValue();
|
53 |
+
|
54 |
+
if ($code == 'subtotal') {
|
55 |
+
$totalName = $this->__('Subtotal');
|
56 |
+
} elseif ($code == 'shipping') {
|
57 |
+
$totalName = $this->__('Shipping');
|
58 |
+
} elseif($code == 'grand_total') {
|
59 |
+
$totalName = $this->__('Grand total');
|
60 |
+
} else {
|
61 |
+
$totalName = $total->getTitle();
|
62 |
+
}
|
63 |
+
|
64 |
+
echo $totalName;
|
65 |
+
?>
|
66 |
+
</td>
|
67 |
+
<td class="total">
|
68 |
+
<span class="price">
|
69 |
+
<?php echo $this->helper('checkout')->formatPrice($value); ?>
|
70 |
+
</span>
|
71 |
+
</td>
|
72 |
+
</tr>
|
73 |
+
<?php endforeach; ?>
|
74 |
+
</table>
|
app/design/frontend/default/default/template/directcheckout/customer/forget.phtml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div id="customer-forget-wrapper">
|
28 |
+
<div id="customer-forget-password">
|
29 |
+
<h3><?php echo $this->__('Forget Password'); ?></h3>
|
30 |
+
<form action="<?php echo $this->getUrl('directcheckout/customer_ajax/forgetPost'); ?>" method="post">
|
31 |
+
<fieldset>
|
32 |
+
<p><?php echo $this->__('Please enter your email:') ?></p>
|
33 |
+
<ul class="form-list">
|
34 |
+
<li>
|
35 |
+
<label for="customer-email"><?php echo $this->__('Email Address'); ?></label>
|
36 |
+
<div class="input-box">
|
37 |
+
<input type="text" class="input-text required-entry validate-email" name="customer-email" />
|
38 |
+
</div>
|
39 |
+
</li>
|
40 |
+
</ul>
|
41 |
+
<br />
|
42 |
+
<button class="button" title="<?php echo $this->__('Send'); ?>">
|
43 |
+
<span>
|
44 |
+
<span><?php echo $this->__('Send'); ?></span>
|
45 |
+
</span>
|
46 |
+
</button>
|
47 |
+
</fieldset>
|
48 |
+
</form>
|
49 |
+
<a class="modalbox" href="<?php echo $this->getUrl('directcheckout/customer_ajax/login'); ?>" title="<?php echo $this->__('Login'); ?>"><?php echo $this->__('Back'); ?></a>
|
50 |
+
</div>
|
51 |
+
</div>
|
app/design/frontend/default/default/template/directcheckout/customer/login.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div id="customer-login-form-wrapper">
|
28 |
+
<h3><?php echo $this->__('Login'); ?></h3>
|
29 |
+
<div id="msg-error"></div>
|
30 |
+
<form action="<?php echo $this->getUrl('directcheckout/customer_ajax/loginPost'); ?>" id="customer-login-form">
|
31 |
+
<fieldset>
|
32 |
+
<p><?php echo $this->__('Please log in below:') ?></p>
|
33 |
+
<ul class="form-list">
|
34 |
+
<li>
|
35 |
+
<label for="login"><?php echo $this->__('Email Address'); ?></label>
|
36 |
+
<div class="input-box">
|
37 |
+
<input type="text" class="input-text required-entry validate-email" name="login" id="customer-login"/>
|
38 |
+
</div>
|
39 |
+
</li>
|
40 |
+
<li>
|
41 |
+
<label for="password"><?php echo $this->__('Password'); ?></label>
|
42 |
+
<div class="input-box">
|
43 |
+
<input type="password" class="input-text required-entry" name="password" id="password" />
|
44 |
+
</div>
|
45 |
+
</li>
|
46 |
+
</ul>
|
47 |
+
<br />
|
48 |
+
<button class="button" title="<?php echo $this->__('Login'); ?>">
|
49 |
+
<span>
|
50 |
+
<span><?php echo $this->__('Login'); ?></span>
|
51 |
+
</span>
|
52 |
+
</button>
|
53 |
+
</fieldset>
|
54 |
+
</form>
|
55 |
+
<a class="modalbox" href="<?php echo $this->getUrl('directcheckout/customer_ajax/forget'); ?>" title="<?php echo $this->__('Forgot Password'); ?>" id="customer-forget-link"><?php echo $this->__('Forgot Password'); ?></a>
|
56 |
+
</div>
|
app/design/frontend/default/default/template/directcheckout/customer/widget/name.phtml
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Sinabs_Directcheckout
|
23 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div class="<?php echo $this->getContainerClassName()?>">
|
28 |
+
<?php if ($this->showPrefix()): ?>
|
29 |
+
<div class="field name-prefix">
|
30 |
+
<label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('prefix') ?></label>
|
31 |
+
<div class="input-box">
|
32 |
+
<?php if ($this->getPrefixOptions() === false): ?>
|
33 |
+
<input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?> />
|
34 |
+
<?php else: ?>
|
35 |
+
<select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->getStoreLabel('prefix') ?>" class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>" <?php echo $this->getFieldParams() ?>>
|
36 |
+
<?php foreach ($this->getPrefixOptions() as $_option): ?>
|
37 |
+
<option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
|
38 |
+
<?php endforeach; ?>
|
39 |
+
</select>
|
40 |
+
<?php endif; ?>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
<?php endif; ?>
|
44 |
+
<div class="field name-firstname">
|
45 |
+
<label for="<?php echo $this->getFieldId('firstname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('firstname') ?></label>
|
46 |
+
<div class="input-box">
|
47 |
+
<input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> />
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<?php if ($this->showMiddlename()): ?>
|
51 |
+
<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?>
|
52 |
+
<div class="field name-middlename">
|
53 |
+
<label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label>
|
54 |
+
<div class="input-box">
|
55 |
+
<input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> />
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<?php endif; ?>
|
59 |
+
<div class="field name-lastname">
|
60 |
+
<label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('lastname') ?></label>
|
61 |
+
<div class="input-box">
|
62 |
+
<input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> />
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
<?php if ($this->showSuffix()): ?>
|
66 |
+
<div class="field name-suffix">
|
67 |
+
<label for="<?php echo $this->getFieldId('suffix')?>"<?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?><?php echo $this->getStoreLabel('suffix') ?></label>
|
68 |
+
<div class="input-box">
|
69 |
+
<?php if ($this->getSuffixOptions() === false): ?>
|
70 |
+
<input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?> />
|
71 |
+
<?php else: ?>
|
72 |
+
<select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->getStoreLabel('suffix') ?>" class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>" <?php echo $this->getFieldParams() ?>>
|
73 |
+
<?php foreach ($this->getSuffixOptions() as $_option): ?>
|
74 |
+
<option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
|
75 |
+
<?php endforeach; ?>
|
76 |
+
</select>
|
77 |
+
<?php endif; ?>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<?php endif; ?>
|
81 |
+
</div>
|
app/etc/modules/Sinabs_Directcheckout.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Sinabs_Directcheckout>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
</Sinabs_Directcheckout>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/locale/en_US/Sinabs_Directcheckout.csv
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Successful authentication, you will be redirected in two seconds","Successful authentication, you will be redirected in two seconds"
|
2 |
+
"Please check billing address information","Please check billing address information"
|
3 |
+
"Please check shiping address information","Please check shiping address information"
|
4 |
+
"Unable to create customer account", "Unable to create customer account"
|
5 |
+
"Error", "Error"
|
6 |
+
"Enable Newsletter", "Enable Newsletter"
|
7 |
+
"Enable Coupon Code", "Enable Coupon Code"
|
app/locale/fr_FR/Sinabs_Directcheckout.csv
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Successful authentication, you will be redirected in two seconds","Votre connexion a réussi, vous allez être redirigé dans deux secondes."
|
2 |
+
"Please check billing address information","Erreur dans la saisie de l'adresse de facturation"
|
3 |
+
"Please check shiping address information","Erreur dans la saisie de l'adresse de livraison"
|
4 |
+
"Unable to create customer account", "Impossible de créer le compte client"
|
5 |
+
"Error", "Erreur"
|
6 |
+
"Enable Newsletter", "Activer la newsletter"
|
7 |
+
"Enable Coupon Code", "Activer le code de réduction"
|
js/directcheckout/directcheckout.js
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Magento
|
3 |
+
*
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/afl-3.0.php
|
10 |
+
* If you did not receive a copy of the license and are unable to
|
11 |
+
* obtain it through the world-wide-web, please send an email
|
12 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
13 |
+
*
|
14 |
+
* DISCLAIMER
|
15 |
+
*
|
16 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
17 |
+
* versions in the future. If you wish to customize Magento for your
|
18 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
19 |
+
*
|
20 |
+
* @category Sinabs
|
21 |
+
* @package js
|
22 |
+
* @copyright Copyright (c) 2014 Sinabs (http://www.sinabs.fr)
|
23 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
24 |
+
*/
|
25 |
+
if (typeof Directcheckout == 'undefined') {
|
26 |
+
var Directcheckout = {};
|
27 |
+
}
|
28 |
+
|
29 |
+
// Simplebuying
|
30 |
+
Directcheckout = Class.create();
|
31 |
+
Directcheckout.prototype = {
|
32 |
+
initialize: function() {
|
33 |
+
this._initModalbox();
|
34 |
+
this._initFormSubmit();
|
35 |
+
this._initRegister();
|
36 |
+
},
|
37 |
+
_initRegister: function() {
|
38 |
+
var el = $('customer-register');
|
39 |
+
if (el != null) {
|
40 |
+
if (el.checked) {
|
41 |
+
this.toggleRegisterForm();
|
42 |
+
}
|
43 |
+
el.observe('change', (function(e) {
|
44 |
+
this.toggleRegisterForm();
|
45 |
+
}).bind(this));
|
46 |
+
}
|
47 |
+
},
|
48 |
+
_initModalbox: function() {
|
49 |
+
document.observe('click', function(event) {
|
50 |
+
var element = $(Event.element(event));
|
51 |
+
if(element.readAttribute('class') == 'modalbox') {
|
52 |
+
Event.stop(event);
|
53 |
+
Modalbox.show(element.readAttribute('href'), {
|
54 |
+
title: element.readAttribute('title')
|
55 |
+
});
|
56 |
+
}
|
57 |
+
});
|
58 |
+
},
|
59 |
+
_initFormSubmit: function() {
|
60 |
+
document.observe('submit', function(event) {
|
61 |
+
Event.stop(event);
|
62 |
+
var element = Event.element(event);
|
63 |
+
$(element).request({
|
64 |
+
method: 'post',
|
65 |
+
onLoading: function() {
|
66 |
+
showLoader($(element));
|
67 |
+
},
|
68 |
+
onComplete: function(t) {
|
69 |
+
var response = t.responseText.evalJSON();
|
70 |
+
if (typeof(response.message) != 'undefined') {
|
71 |
+
$(element).update(response.message).innerHTML;
|
72 |
+
}
|
73 |
+
if (typeof(response.redirect) != 'undefined') {
|
74 |
+
if (typeof(response.timeout) != 'undefined') {
|
75 |
+
setTimeout(function() { window.location.href = response.redirect }, response.timeout);
|
76 |
+
} else {
|
77 |
+
window.location.href = response.redirect;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
});
|
82 |
+
});
|
83 |
+
},
|
84 |
+
toggleRegisterForm: function() {
|
85 |
+
var c = $('wrapper-register').getStyle('display');
|
86 |
+
$('wrapper-register').setStyle({ display: (c == 'none') ? 'block' : 'none' });
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
// Simplebuying Billing
|
91 |
+
Directcheckout.Billing = Class.create();
|
92 |
+
Directcheckout.Billing.prototype = {
|
93 |
+
initialize: function(args) {
|
94 |
+
this.listRegion = args.listRegion;
|
95 |
+
this._initBillingRegion();
|
96 |
+
},
|
97 |
+
_initBillingRegion: function() {
|
98 |
+
this._updateBillingRegion();
|
99 |
+
$('billing:country_id').observe('change', (function(e) {
|
100 |
+
this._updateBillingRegion();
|
101 |
+
if ($('use_for_shipping').value == 1) {
|
102 |
+
updateSpo();
|
103 |
+
}
|
104 |
+
}).bind(this));
|
105 |
+
},
|
106 |
+
_updateBillingRegion: function() {
|
107 |
+
var code = $('billing:country_id').getValue();
|
108 |
+
|
109 |
+
$('billing:region_id').select('option').each(function(o) {
|
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', '');
|
115 |
+
for (var i in this.listRegion[code]) {
|
116 |
+
document.getElementById('billing:region_id').options[document.getElementById('billing:region_id').options.length] = new Option(this.listRegion[code][i].name, i);
|
117 |
+
}
|
118 |
+
$('billing:region_id').setStyle({ display: 'block' });
|
119 |
+
$('billing:region').setStyle({ display: 'none' });
|
120 |
+
} else {
|
121 |
+
$('billing:region_id').setStyle({ display: 'none' });
|
122 |
+
$('billing:region').setStyle({ display: 'block' });
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
// Simplebuying Shipping
|
128 |
+
Directcheckout.Shipping = Class.create();
|
129 |
+
Directcheckout.Shipping.prototype = {
|
130 |
+
initialize: function(args) {
|
131 |
+
this.listRegion = args.listRegion;
|
132 |
+
this._initShippingRegion();
|
133 |
+
},
|
134 |
+
_initShippingRegion: function() {
|
135 |
+
this._updateShippingRegion();
|
136 |
+
$('shipping:country_id').observe('change', (function(e) {
|
137 |
+
this._updateShippingRegion();
|
138 |
+
updateSpo();
|
139 |
+
}).bind(this));
|
140 |
+
},
|
141 |
+
_changeShippingMethod: function() {
|
142 |
+
$$('[name="shipping_method"]').each(function(r, i) {
|
143 |
+
$(r).observe('change', function(e) {
|
144 |
+
if ($('use_for_shipping').value == 0) {
|
145 |
+
updateSpo('shipping');
|
146 |
+
}
|
147 |
+
});
|
148 |
+
});
|
149 |
+
},
|
150 |
+
_updateShippingRegion: function() {
|
151 |
+
var code = $('shipping:country_id').getValue();
|
152 |
+
|
153 |
+
$('shipping:region_id').select('option').each(function(o) {
|
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', '');
|
159 |
+
for (var i in this.listRegion[code]) {
|
160 |
+
document.getElementById('shipping:region_id').options[document.getElementById('shipping:region_id').options.length] = new Option(this.listRegion[code][i].name, i);
|
161 |
+
}
|
162 |
+
$('shipping:region_id').setStyle({ display: 'block' });
|
163 |
+
$('shipping:region').setStyle({ display: 'none' });
|
164 |
+
} else {
|
165 |
+
$('shipping:region_id').setStyle({ display: 'none' });
|
166 |
+
$('shipping:region').setStyle({ display: 'block' });
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Functions
|
173 |
+
*/
|
174 |
+
|
175 |
+
currentPaymentMethod = null;
|
176 |
+
|
177 |
+
// Check if "use for shipping" checked
|
178 |
+
function checkUseForShipping(o) {
|
179 |
+
$('shipping_address').setStyle({display: o ? 'block' : 'none'});
|
180 |
+
$('use_for_shipping').value = (o == true) ? 0 : 1;
|
181 |
+
updateSpo();
|
182 |
+
}
|
183 |
+
|
184 |
+
// Payment method switch and display associated content
|
185 |
+
function switchPaymentMethod(method) {
|
186 |
+
var el = $('payment_form_' + method);
|
187 |
+
if (currentPaymentMethod != null) {
|
188 |
+
var elCurrent = $('payment_form_' + currentPaymentMethod);
|
189 |
+
elCurrent.setStyle({ display: 'none' });
|
190 |
+
}
|
191 |
+
if (el) {
|
192 |
+
$(el).setStyle({ display: 'block' });
|
193 |
+
currentPaymentMethod = method;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
// New address selected
|
199 |
+
function newAddress(adType, value) {
|
200 |
+
if (value == '') {
|
201 |
+
$(adType + 'Form').setStyle({ display: 'block' });
|
202 |
+
} else {
|
203 |
+
$(adType + 'Form').setStyle({ display: 'none' });
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
// Display loader on element e
|
208 |
+
function showLoader(e) {
|
209 |
+
html = '<div class="directcheckout-loading-wrapper"><div class="directcheckout-loading"></div></div>';
|
210 |
+
$(e).update(html).innerHTML;
|
211 |
+
}
|
212 |
+
|
213 |
+
// Update Shipping, Billing and Summary
|
214 |
+
function updateSpo(mode) {
|
215 |
+
new Ajax.Request(urlSpo, {
|
216 |
+
parameters: $('directcheckout-form').serialize(true),
|
217 |
+
onLoading: function() {
|
218 |
+
if (mode != 'shipping' && mode != 'payment' && mode != 'review') {
|
219 |
+
showLoader($('shipping_methods_list'));
|
220 |
+
}
|
221 |
+
if (mode != 'payment' && mode != 'review') {
|
222 |
+
showLoader($('payment_methods_list'));
|
223 |
+
}
|
224 |
+
|
225 |
+
showLoader($('review_order'));
|
226 |
+
},
|
227 |
+
onSuccess: function(t) {
|
228 |
+
var response = t.responseText.evalJSON();
|
229 |
+
if (mode != 'shipping' && mode != 'payment') {
|
230 |
+
$('shipping_methods_list').update(response.shipping_methods).innerHTML;
|
231 |
+
}
|
232 |
+
if (mode != 'payment') {
|
233 |
+
$('payment_methods_list').update(response.payment_methods).innerHTML;
|
234 |
+
}
|
235 |
+
$('review_order').update(response.summary).innerHTML;
|
236 |
+
}
|
237 |
+
});
|
238 |
+
}
|
239 |
+
|
240 |
+
// Save Order
|
241 |
+
function saveOrder() {
|
242 |
+
var myForm = new VarienForm('directcheckout-form', true);
|
243 |
+
if(myForm.validator && myForm.validator.validate()) {
|
244 |
+
new Ajax.Request(urlSaveOrder, {
|
245 |
+
parameters: $('directcheckout-form').serialize(true),
|
246 |
+
onLoading: function() {
|
247 |
+
$('submit-order').setStyle({ display: 'none' });
|
248 |
+
$('review-please-wait').setStyle({ display: 'block' });
|
249 |
+
},
|
250 |
+
onSuccess: function(t) {
|
251 |
+
$('submit-order').setStyle({ display: 'block' });
|
252 |
+
$('review-please-wait').setStyle({ display: 'none' });
|
253 |
+
|
254 |
+
var response = t.responseText.evalJSON();
|
255 |
+
if (response.error) {
|
256 |
+
str = "<p>";
|
257 |
+
if (typeof(response.message) == 'string') {
|
258 |
+
Modalbox.show(str + response.message + '</p>', {title:(response.title && typeof(response.title) == 'string') ? response.title : 'Error'});
|
259 |
+
} else {
|
260 |
+
response.message.each(function(i, r) {
|
261 |
+
str += r + '<br />';
|
262 |
+
Modalbox.show(str);
|
263 |
+
});
|
264 |
+
}
|
265 |
+
} else {
|
266 |
+
if (response.redirect) {
|
267 |
+
self.location = response.redirect;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
});
|
272 |
+
}
|
273 |
+
return false;
|
274 |
+
}
|
275 |
+
|
276 |
+
// Update coupon code
|
277 |
+
function updateCouponCode(action) {
|
278 |
+
var container = $('directcheckout-discount-wrapper');
|
279 |
+
if (container != null) {
|
280 |
+
var couponCode = $('coupon_code').value;
|
281 |
+
if (couponCode != '') {
|
282 |
+
new Ajax.Request(urlCoupon, {
|
283 |
+
parameters: {
|
284 |
+
coupon: (action == 'delete') ? '' : couponCode
|
285 |
+
},
|
286 |
+
onLoading: function() {
|
287 |
+
$('coupon_delete').setStyle({ display: 'none' });
|
288 |
+
$('coupon_add').setStyle({ display: 'none' });
|
289 |
+
$('button-loading').setStyle({ display: 'block' });
|
290 |
+
},
|
291 |
+
onSuccess: function(t) {
|
292 |
+
var response = t.responseText.evalJSON();
|
293 |
+
if (response.success == true) {
|
294 |
+
$('button-loading').setStyle({ display: 'none' });
|
295 |
+
if (action == 'delete') {
|
296 |
+
$('coupon_add').setStyle({ display: 'block' });
|
297 |
+
$('coupon_delete').setStyle({ display: 'none' });
|
298 |
+
$('coupon_code').removeAttribute('readonly')
|
299 |
+
} else {
|
300 |
+
$('coupon_add').setStyle({ display: 'none' });
|
301 |
+
$('coupon_delete').setStyle({ display: 'block' });
|
302 |
+
$('coupon_code').setAttribute('readonly', 'readonly');
|
303 |
+
}
|
304 |
+
updateSpo('review');
|
305 |
+
} else {
|
306 |
+
$('button-loading').setStyle({ display: 'none' });
|
307 |
+
$('coupon_add').setStyle({ display: 'block' });
|
308 |
+
Modalbox.show('<p>' + response.message + '</p>', {title:(response.title && typeof(response.title) == 'string') ? response.title : 'Error'});
|
309 |
+
}
|
310 |
+
}
|
311 |
+
});
|
312 |
+
}
|
313 |
+
}
|
314 |
+
}
|
js/directcheckout/modal.js
ADDED
@@ -0,0 +1,600 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
//
|
2 |
+
// ModalBox - The pop-up window thingie with AJAX, based on Prototype JS framework.
|
3 |
+
//
|
4 |
+
// Created by Andrew Okonetchnikov
|
5 |
+
// Copyright 2006-2010 okonet.ru. All rights reserved.
|
6 |
+
//
|
7 |
+
// Licensed under MIT license.
|
8 |
+
//
|
9 |
+
|
10 |
+
if (Object.isUndefined(Prototype.Browser.IE6)) {
|
11 |
+
Prototype.Browser.IE6 = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1 && navigator.appVersion.indexOf("MSIE 6.0") != -1 && !window.XMLHttpRequest);
|
12 |
+
}
|
13 |
+
|
14 |
+
if (!window.Modalbox)
|
15 |
+
var Modalbox = {};
|
16 |
+
|
17 |
+
Modalbox.Methods = {
|
18 |
+
overrideAlert: false, // Override standard browser alert message with ModalBox
|
19 |
+
focusableElements: [],
|
20 |
+
currFocused: 0,
|
21 |
+
initialized: false, // Modalbox is visible
|
22 |
+
active: true, // Modalbox is visible and active
|
23 |
+
options: {
|
24 |
+
title: "ModalBox Window", // Title of the ModalBox window
|
25 |
+
overlayClose: true, // Close modal box by clicking on overlay
|
26 |
+
width: 500, // Default width in px
|
27 |
+
height: 90, // Default height in px
|
28 |
+
overlayOpacity: 0.65, // Default overlay opacity
|
29 |
+
overlayDuration: 0.25, // Default overlay fade in/out duration in seconds
|
30 |
+
slideDownDuration: 0.5, // Default Modalbox appear slide down effect in seconds
|
31 |
+
slideUpDuration: 0.5, // Default Modalbox hiding slide up effect in seconds
|
32 |
+
resizeDuration: 0.25, // Default resize duration seconds
|
33 |
+
inactiveFade: true, // Fades MB window on inactive state
|
34 |
+
transitions: true, // Toggles transition effects. Transitions are enabled by default
|
35 |
+
loadingString: "Please wait. Loading...", // Default loading string message
|
36 |
+
closeString: "Close window", // Default title attribute for close window link
|
37 |
+
closeValue: "×", // Default string for close link in the header
|
38 |
+
params: {},
|
39 |
+
method: 'get', // Default Ajax request method
|
40 |
+
autoFocusing: true, // Toggles auto-focusing for form elements. Disable for long text pages.
|
41 |
+
aspnet: false, // Should be true when using with ASP.NET controls. When true Modalbox window will be injected into the first form element.
|
42 |
+
resizeCSSID: ''
|
43 |
+
},
|
44 |
+
_options: {},
|
45 |
+
|
46 |
+
setOptions: function(options) {
|
47 |
+
Object.extend(this.options, options || {});
|
48 |
+
},
|
49 |
+
|
50 |
+
_init: function(options) {
|
51 |
+
// Setting up original options with default options
|
52 |
+
Object.extend(this._options, this.options);
|
53 |
+
this.setOptions(options);
|
54 |
+
|
55 |
+
// Creating the overlay
|
56 |
+
this.MBoverlay = new Element("div", {id: "MB_overlay", style: "opacity: 0"});
|
57 |
+
|
58 |
+
// Creating the modal window
|
59 |
+
this.MBwindowwrapper = new Element("div", {id: "MB_windowwrapper"}).update(
|
60 |
+
this.MBwindow = new Element("div", {id: "MB_window", style: "display: none"}).update(
|
61 |
+
this.MBframe = new Element("div", {id: "MB_frame"}).update(
|
62 |
+
this.MBheader = new Element("div", {id: "MB_header"}).update(
|
63 |
+
this.MBcaption = new Element("div", {id: "MB_caption"})
|
64 |
+
)
|
65 |
+
)
|
66 |
+
)
|
67 |
+
);
|
68 |
+
|
69 |
+
this.MBclose = new Element("a", {id: "MB_close", title: this.options.closeString, href: "#"}).update("<span>" + this.options.closeValue + "</span>");
|
70 |
+
this.MBheader.insert({'bottom':this.MBclose});
|
71 |
+
|
72 |
+
this.MBcontent = new Element("div", {id: "MB_content"}).update(
|
73 |
+
this.MBloading = new Element("div", {id: "MB_loading"}).update(this.options.loadingString)
|
74 |
+
);
|
75 |
+
this.MBframe.insert({'bottom':this.MBcontent});
|
76 |
+
|
77 |
+
// Inserting into DOM. If parameter set and form element have been found will inject into it. Otherwise will inject into body as topmost element.
|
78 |
+
// Be sure to set padding and marging to null via CSS for both body and (in case of asp.net) form elements.
|
79 |
+
var injectToEl = this.options.aspnet ? $(document.body).down('form') : $(document.body);
|
80 |
+
injectToEl.insert({'top':this.MBwindowwrapper});
|
81 |
+
injectToEl.insert({'top':this.MBoverlay});
|
82 |
+
|
83 |
+
var scrollOffsets = document.viewport.getScrollOffsets();
|
84 |
+
if (scrollOffsets[1] > 0) {
|
85 |
+
$('MB_window').setStyle({top:scrollOffsets[1] + 'px'});
|
86 |
+
}
|
87 |
+
|
88 |
+
//apparently the X offset may also come in question
|
89 |
+
if (scrollOffsets[0] > 0) {
|
90 |
+
$('MB_window').setStyle({left:scrollOffsets[0] + 'px'});
|
91 |
+
}
|
92 |
+
|
93 |
+
Event.observe(window, 'scroll', function() {
|
94 |
+
scrollOffsets = document.viewport.getScrollOffsets();
|
95 |
+
$('MB_window').setStyle({top:scrollOffsets[1] + 'px'});
|
96 |
+
$('MB_window').setStyle({left:scrollOffsets[0] + 'px'});
|
97 |
+
});
|
98 |
+
|
99 |
+
// Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing
|
100 |
+
this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
|
101 |
+
this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
102 |
+
|
103 |
+
//Adding event observers
|
104 |
+
this.hideObserver = this._hide.bindAsEventListener(this);
|
105 |
+
this.kbdObserver = this._kbdHandler.bindAsEventListener(this);
|
106 |
+
this.resizeObserver = this._setWidthAndPosition.bindAsEventListener(this);
|
107 |
+
this._initObservers();
|
108 |
+
|
109 |
+
this.initialized = true; // Mark as initialized
|
110 |
+
},
|
111 |
+
|
112 |
+
show: function(content, options) {
|
113 |
+
if (!this.initialized) this._init(options); // Check if MB is already initialized
|
114 |
+
|
115 |
+
this._cleanUpContentIDs();
|
116 |
+
|
117 |
+
this.content = content;
|
118 |
+
this.setOptions(options);
|
119 |
+
|
120 |
+
if (this.options.title) { // Updating title of the MB
|
121 |
+
this.MBcaption.update(this.options.title);
|
122 |
+
} else { // If title isn't given, the header will not displayed
|
123 |
+
this.MBheader.hide();
|
124 |
+
this.MBcaption.hide();
|
125 |
+
}
|
126 |
+
|
127 |
+
if (this.MBwindow.style.display == "none") { // First modal box appearing
|
128 |
+
this._appear();
|
129 |
+
this.event("onShow"); // Passing onShow callback
|
130 |
+
} else { // If MB already on the screen, update it
|
131 |
+
this._update();
|
132 |
+
this.event("onUpdate"); // Passing onUpdate callback
|
133 |
+
}
|
134 |
+
},
|
135 |
+
|
136 |
+
hide: function(options) { // External hide method to use from external HTML and JS
|
137 |
+
if (this.initialized) {
|
138 |
+
// Reading for options/callbacks except if event given as a parameter
|
139 |
+
if (options && !Object.isFunction(options.element))
|
140 |
+
Object.extend(this.options, options);
|
141 |
+
this.event("beforeHide"); // Passing beforeHide callback
|
142 |
+
if (this.options.transitions) {
|
143 |
+
Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, transition: Effect.Transitions.sinoidal, afterFinish: this._deinit.bind(this) });
|
144 |
+
} else {
|
145 |
+
this.MBwindow.hide();
|
146 |
+
this._deinit();
|
147 |
+
}
|
148 |
+
Event.stopObserving(window, 'scroll');
|
149 |
+
} else {
|
150 |
+
throw("Modalbox is not initialized.");
|
151 |
+
}
|
152 |
+
},
|
153 |
+
|
154 |
+
_hide: function(event) { // Internal hide method to use with overlay and close link
|
155 |
+
event.stop(); // Stop event propagation for link elements
|
156 |
+
// When clicked on overlay we'll check the option and in case of overlayClose == false we'll break hiding execution [Fix for #139]
|
157 |
+
if (event.element().id == 'MB_overlay' && !this.options.overlayClose) return false;
|
158 |
+
this.hide();
|
159 |
+
},
|
160 |
+
|
161 |
+
alert: function(message){
|
162 |
+
var html = '<div class="MB_alert"><p>' + message + '</p><input type="button" onclick="Modalbox.hide()" value="OK" /></div>';
|
163 |
+
Modalbox.show(html, {title: 'Alert: ' + document.title, width: 300});
|
164 |
+
},
|
165 |
+
|
166 |
+
_appear: function() { // First appearing of MB
|
167 |
+
if (Prototype.Browser.IE6) { // Preparing IE 6 for showing modalbox
|
168 |
+
window.scrollTo(0,0);
|
169 |
+
this._prepareIEHtml("100%", "hidden");
|
170 |
+
this._prepareIESelects("hidden");
|
171 |
+
}
|
172 |
+
this._setWidth();
|
173 |
+
if(this.options.transitions) {
|
174 |
+
this.MBoverlay.setOpacity(0);
|
175 |
+
new Effect.Fade(this.MBoverlay, {
|
176 |
+
from: 0,
|
177 |
+
to: this.options.overlayOpacity,
|
178 |
+
duration: this.options.overlayDuration,
|
179 |
+
afterFinish: (function() {
|
180 |
+
new Effect.SlideDown(this.MBwindow, {
|
181 |
+
duration: this.options.slideDownDuration,
|
182 |
+
transition: Effect.Transitions.sinoidal,
|
183 |
+
afterFinish: this.loadContent.bind(this)
|
184 |
+
});
|
185 |
+
}).bind(this)
|
186 |
+
});
|
187 |
+
} else {
|
188 |
+
this.MBoverlay.setOpacity(this.options.overlayOpacity);
|
189 |
+
this.MBwindow.show();
|
190 |
+
this.loadContent();
|
191 |
+
}
|
192 |
+
Event.observe(window, "resize", this.resizeObserver);
|
193 |
+
},
|
194 |
+
|
195 |
+
resize: function(byWidth, byHeight, options) { // Change size of MB without content reloading
|
196 |
+
var oWidth = $(this.MBoverlay).getWidth();
|
197 |
+
var wHeight = $(this.MBwindow).getHeight();
|
198 |
+
var wWidth = $(this.MBwindow).getWidth();
|
199 |
+
var hHeight = $(this.MBheader).getHeight();
|
200 |
+
var cHeight = $(this.MBcontent).getHeight();
|
201 |
+
var newHeight = ((wHeight - hHeight + byHeight) < cHeight) ? (cHeight + hHeight) : (wHeight + byHeight);
|
202 |
+
|
203 |
+
var el = $(this.MBwindow);
|
204 |
+
var contentEl = $(this.MBcontent);
|
205 |
+
var windowBottomMargin = 10;
|
206 |
+
newHeight += windowBottomMargin;
|
207 |
+
var windowOffset = (parseInt(el.getStyle('margin-top'), 0) + parseInt(el.getStyle('margin-bottom'), 0) + parseInt(el.getStyle('border-top-width'), 0) + parseInt(el.getStyle('border-bottom-width'), 0)) + windowBottomMargin;
|
208 |
+
var contentPadding = (parseInt(contentEl.getStyle('padding-top')) + parseInt(contentEl.getStyle('padding-bottom')));
|
209 |
+
|
210 |
+
if ((newHeight + windowOffset + contentPadding) > document.viewport.getHeight()) {
|
211 |
+
// adjust window height to account for margins and border widths
|
212 |
+
newHeight = document.viewport.getHeight() - windowOffset - windowBottomMargin;
|
213 |
+
// calculate content height including header height and padding values
|
214 |
+
newcHeight = newHeight - hHeight - parseInt($(this.MBframe).getStyle('padding-bottom'), 0) - parseInt($(this.MBcontent).getStyle('padding-bottom'), 0);
|
215 |
+
$(this.MBcontent).setStyle({height:newcHeight + 'px'});
|
216 |
+
} else if ($(this.MBcontent).getStyle('height')) {
|
217 |
+
// release any MB_content height set prior to establish scrollbars in content area
|
218 |
+
$(this.MBcontent).setStyle({height:''});
|
219 |
+
}
|
220 |
+
|
221 |
+
var newWidth = wWidth + byWidth;
|
222 |
+
//var newStyle = {width: newWidth + "px", height: newHeight + "px", left: (o.width - newWidth)/2 + "px"};
|
223 |
+
var newStyle = {width: newWidth + "px", height: newHeight + "px"};
|
224 |
+
this.options.width = newWidth;
|
225 |
+
if (options) this.setOptions(options); // Passing callbacks
|
226 |
+
if (this.options.transitions && !Modalbox.animating) {
|
227 |
+
Modalbox.animating = true;
|
228 |
+
new Effect.Morph(this.MBwindow, {
|
229 |
+
style: newStyle,
|
230 |
+
duration: this.options.resizeDuration,
|
231 |
+
beforeStart: function(fx){
|
232 |
+
fx.element.setStyle({overflow: "hidden"}); // Fix for MSIE 6 to resize correctly
|
233 |
+
},
|
234 |
+
afterFinish: (function(fx) {
|
235 |
+
fx.element.setStyle({overflow: "visible"});
|
236 |
+
this.event("_afterResize"); // Passing internal callback
|
237 |
+
this.event("afterResize"); // Passing callback
|
238 |
+
Modalbox.animating = false;
|
239 |
+
}).bind(this)
|
240 |
+
});
|
241 |
+
} else {
|
242 |
+
this.MBwindow.setStyle(newStyle);
|
243 |
+
(function() {
|
244 |
+
this.event("_afterResize"); // Passing internal callback
|
245 |
+
this.event("afterResize"); // Passing callback
|
246 |
+
}).bind(this).defer();
|
247 |
+
}
|
248 |
+
},
|
249 |
+
|
250 |
+
resizeToContent: function(options){
|
251 |
+
// Resizes the modalbox window to the actual content height.
|
252 |
+
// This might be useful to resize modalbox after some content modifications which were changed content height.
|
253 |
+
|
254 |
+
if (typeof options == "undefined") {
|
255 |
+
options = {};
|
256 |
+
}
|
257 |
+
|
258 |
+
// check to see if MB_content includes any images
|
259 |
+
var mbimages = $('MB_content').select('img');
|
260 |
+
var totalimages = mbimages.length;
|
261 |
+
if (mbimages[0]) {
|
262 |
+
if (typeof options.imagesloaded == "undefined") {
|
263 |
+
|
264 |
+
var loadedImages = $A();
|
265 |
+
var loadedImageTotal = 0;
|
266 |
+
mbimages.each(function(o,idx) {
|
267 |
+
loadedImages[idx] = new Image();
|
268 |
+
loadedImages[idx].src = o.src;
|
269 |
+
loadedImages[idx].onload = function() {
|
270 |
+
loadedImageTotal++;
|
271 |
+
if (loadedImageTotal == totalimages) {
|
272 |
+
// make sure all images have been rendered by checking their height
|
273 |
+
var imageincomplete = false;
|
274 |
+
mbimages.each(function(i) {
|
275 |
+
if (i.height == 0) {
|
276 |
+
imageincomplete = true;
|
277 |
+
}
|
278 |
+
});
|
279 |
+
if (imageincomplete || Modalbox.animating) {
|
280 |
+
// some image hasn't been rendered yet, trigger resize loop until it is
|
281 |
+
Modalbox.resizeToContent();
|
282 |
+
} else {
|
283 |
+
// trigger one final resize, but set imagesloaded option to skip inspection of images
|
284 |
+
options.imagesloaded = true;
|
285 |
+
Modalbox.resizeToContent(options);
|
286 |
+
}
|
287 |
+
}
|
288 |
+
}
|
289 |
+
})
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
var byWidth = 0, byHeight = this.options.height - this.MBwindow.getHeight();
|
294 |
+
if (options.resizeCSSID && $(options.resizeCSSID)) {
|
295 |
+
// byWidth is the amount of pixels needed to increase/decrease window to meet width of options.resizeCSSID
|
296 |
+
// plus a 10 pixel margin to accommodate scrollbars
|
297 |
+
byWidth = $(options.resizeCSSID).getWidth() - $(this.MBwindow).getWidth() + (parseInt($(this.MBcontent).getStyle('padding-left'), 0) + parseInt($(this.MBcontent).getStyle('padding-right'), 0)) + 15;
|
298 |
+
}
|
299 |
+
if (byHeight != 0) {
|
300 |
+
this.resize(byWidth, byHeight, options);
|
301 |
+
}
|
302 |
+
},
|
303 |
+
|
304 |
+
resizeToInclude: function(element, options){
|
305 |
+
// Resizes the modalbox window to the cumulative height of element. Calculations are using CSS properties for margins and border.
|
306 |
+
// This method might be useful to resize modalbox before including or updating content.
|
307 |
+
|
308 |
+
var el = $(element);
|
309 |
+
var elHeight = el.getHeight() + parseInt(el.getStyle('margin-top'), 0) + parseInt(el.getStyle('margin-bottom'), 0) + parseInt(el.getStyle('border-top-width'), 0) + parseInt(el.getStyle('border-bottom-width'), 0);
|
310 |
+
if (elHeight > 0) {
|
311 |
+
this.resize(0, elHeight, options);
|
312 |
+
}
|
313 |
+
},
|
314 |
+
|
315 |
+
_update: function() { // Updating MB in case of wizards
|
316 |
+
this.MBcontent.update($(this.MBloading).update(this.options.loadingString));
|
317 |
+
this.loadContent();
|
318 |
+
},
|
319 |
+
|
320 |
+
loadContent: function() {
|
321 |
+
if (this.event("beforeLoad") != false) { // If callback passed false, skip loading of the content
|
322 |
+
if (typeof this.content == 'string') {
|
323 |
+
var htmlRegExp = new RegExp(/<\/?[^>]+>/gi);
|
324 |
+
if (htmlRegExp.test(this.content)) { // Plain HTML given as a parameter
|
325 |
+
this._processContent(this.content);
|
326 |
+
} else { // URL given as a parameter. We'll request it via Ajax
|
327 |
+
new Ajax.Request(this.content, {
|
328 |
+
method: this.options.method.toLowerCase(),
|
329 |
+
parameters: this.options.params,
|
330 |
+
onComplete: (function(response) {
|
331 |
+
this._processContent(response.responseText);
|
332 |
+
}).bind(this),
|
333 |
+
onException: function(instance, exception){
|
334 |
+
Modalbox.hide();
|
335 |
+
throw('Modalbox Loading Error: ' + exception);
|
336 |
+
}
|
337 |
+
});
|
338 |
+
}
|
339 |
+
} else if (typeof this.content == 'object') { // HTML Object is given
|
340 |
+
this._insertContent(this.content);
|
341 |
+
} else {
|
342 |
+
this.hide();
|
343 |
+
throw('Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)');
|
344 |
+
}
|
345 |
+
}
|
346 |
+
},
|
347 |
+
|
348 |
+
_processContent: function(content) {
|
349 |
+
var html = content.stripScripts(), scripts = content.extractScripts();
|
350 |
+
this._insertContent(html, function() {
|
351 |
+
scripts.map(function(script) {
|
352 |
+
return eval(script.replace("<!--", "").replace("// -->", ""));
|
353 |
+
}, window);
|
354 |
+
});
|
355 |
+
},
|
356 |
+
|
357 |
+
_insertContent: function(content, callback) {
|
358 |
+
this.MBcontent.hide().update();
|
359 |
+
|
360 |
+
if (typeof content == 'string') { // Plain HTML is given
|
361 |
+
this.MBcontent.insert(new Element("div", { style: "display: none" }).update(content)).down().show();
|
362 |
+
} else if (typeof content == 'object') { // HTML Object is given
|
363 |
+
var _htmlObj = content.cloneNode(true); // If node is already a part of DOM we'll clone it
|
364 |
+
// If cloneable element has ID attribute defined, modify it to prevent duplicates
|
365 |
+
if (content.id) content.id = "MB_" + content.id;
|
366 |
+
// Add prefix for IDs on all elements inside the DOM node
|
367 |
+
$(content).select('*[id]').each(function(el) { el.id = "MB_" + el.id; });
|
368 |
+
this.MBcontent.insert(_htmlObj).down('div').show();
|
369 |
+
if (Prototype.Browser.IE6) { // Toggling back visibility for hidden selects in IE
|
370 |
+
this._prepareIESelects("", "#MB_content ");
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
// Prepare and resize modal box for content
|
375 |
+
if (this.options.height == this._options.height) {
|
376 |
+
this.resize((this.options.width - $(this.MBwindow).getWidth()), this.MBcontent.getHeight() - $(this.MBwindow).getHeight() + this.MBheader.getHeight(), {
|
377 |
+
afterResize: (function() {
|
378 |
+
this._putContent.bind(this, callback).defer(); // MSIE fix
|
379 |
+
}).bind(this)
|
380 |
+
});
|
381 |
+
} else { // Height is defined. Creating a scrollable window
|
382 |
+
this._setWidth();
|
383 |
+
this.MBcontent.setStyle({
|
384 |
+
overflow: 'auto',
|
385 |
+
height: this.MBwindow.getHeight() - this.MBheader.getHeight() - 13 + 'px'
|
386 |
+
});
|
387 |
+
this._putContent.bind(this, callback).defer(); // MSIE fix
|
388 |
+
}
|
389 |
+
},
|
390 |
+
|
391 |
+
_putContent: function(callback) {
|
392 |
+
this.MBcontent.show();
|
393 |
+
this._findFocusableElements();
|
394 |
+
this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button)
|
395 |
+
if (Object.isFunction(callback))
|
396 |
+
callback(); // Executing internal JS from loaded content
|
397 |
+
this.event("afterLoad"); // Passing callback
|
398 |
+
},
|
399 |
+
|
400 |
+
activate: function(options) {
|
401 |
+
this.setOptions(options);
|
402 |
+
this.active = true;
|
403 |
+
if (this.options.overlayClose)
|
404 |
+
this.MBoverlay.observe("click", this.hideObserver);
|
405 |
+
this.MBclose.observe("click", this.hideObserver).show();
|
406 |
+
if (this.options.transitions && this.options.inactiveFade)
|
407 |
+
new Effect.Appear(this.MBwindow, {duration: this.options.slideUpDuration});
|
408 |
+
},
|
409 |
+
|
410 |
+
deactivate: function(options) {
|
411 |
+
this.setOptions(options);
|
412 |
+
this.active = false;
|
413 |
+
if (this.options.overlayClose)
|
414 |
+
this.MBoverlay.stopObserving("click", this.hideObserver);
|
415 |
+
this.MBclose.stopObserving("click", this.hideObserver).hide();
|
416 |
+
if (this.options.transitions && this.options.inactiveFade)
|
417 |
+
new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: 0.75});
|
418 |
+
},
|
419 |
+
|
420 |
+
_initObservers: function() {
|
421 |
+
this.MBclose.observe("click", this.hideObserver);
|
422 |
+
if (this.options.overlayClose)
|
423 |
+
this.MBoverlay.observe("click", this.hideObserver);
|
424 |
+
// Gecko and Opera are moving focus a way too fast, all other browsers are okay with keydown
|
425 |
+
var kbdEvent = (Prototype.Browser.Gecko || Prototype.Browser.Opera) ? "keypress" : "keydown";
|
426 |
+
Event.observe(document, kbdEvent, this.kbdObserver);
|
427 |
+
},
|
428 |
+
|
429 |
+
_removeObservers: function() {
|
430 |
+
this.MBclose.stopObserving("click", this.hideObserver);
|
431 |
+
if (this.options.overlayClose)
|
432 |
+
this.MBoverlay.stopObserving("click", this.hideObserver);
|
433 |
+
var kbdEvent = (Prototype.Browser.Gecko || Prototype.Browser.Opera) ? "keypress" : "keydown";
|
434 |
+
Event.stopObserving(document, kbdEvent, this.kbdObserver);
|
435 |
+
},
|
436 |
+
|
437 |
+
_setFocus: function() {
|
438 |
+
// Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded.
|
439 |
+
if (this.options.autoFocusing) { // autoFocusing should is enabled in options. Fixes #30
|
440 |
+
if (this.focusableElements.length) {
|
441 |
+
var firstEl = this.focusableElements.find(function (el){
|
442 |
+
return el.tabIndex == 1;
|
443 |
+
}) || this.focusableElements.first();
|
444 |
+
this.currFocused = this.focusableElements.toArray().indexOf(firstEl);
|
445 |
+
firstEl.focus(); // Focus on first focusable element except close button
|
446 |
+
} else if (this.MBclose.visible()) {
|
447 |
+
this.MBclose.focus(); // If no focusable elements exist focus on close button
|
448 |
+
}
|
449 |
+
}
|
450 |
+
},
|
451 |
+
|
452 |
+
_findFocusableElements: function() { // Collect form elements and links from MB content
|
453 |
+
// TODO maybe add :enabled to select and textarea elements
|
454 |
+
this.focusableElements = this.MBcontent.select('input:not([type=hidden]):enabled, select, textarea, button, a[href]');
|
455 |
+
},
|
456 |
+
|
457 |
+
_kbdHandler: function(event) {
|
458 |
+
var node = event.element();
|
459 |
+
switch(event.keyCode) {
|
460 |
+
case Event.KEY_TAB:
|
461 |
+
event.stop();
|
462 |
+
this._findFocusableElements();
|
463 |
+
if (!this.focusableElements.length) return false; // Do nothing if there is no elements to gain focus
|
464 |
+
|
465 |
+
// Switching currFocused to the element which was focused by mouse instead of TAB-key. Fix for #134
|
466 |
+
if (node != this.focusableElements[this.currFocused])
|
467 |
+
this.currFocused = this.focusableElements.indexOf(node);
|
468 |
+
|
469 |
+
if (!event.shiftKey) { // Focusing in direct order
|
470 |
+
if (this.currFocused >= this.focusableElements.length - 1) {
|
471 |
+
this.currFocused = 0;
|
472 |
+
} else {
|
473 |
+
this.currFocused++;
|
474 |
+
}
|
475 |
+
} else { // Shift key is pressed. Focusing in reverse order
|
476 |
+
if (this.currFocused <= 0) {
|
477 |
+
this.currFocused = this.focusableElements.length - 1;
|
478 |
+
} else {
|
479 |
+
this.currFocused--;
|
480 |
+
}
|
481 |
+
}
|
482 |
+
this.focusableElements[this.currFocused].focus();
|
483 |
+
break;
|
484 |
+
case Event.KEY_ESC:
|
485 |
+
if (this.active) this._hide(event);
|
486 |
+
break;
|
487 |
+
case 32:
|
488 |
+
this._preventScroll(event);
|
489 |
+
break;
|
490 |
+
case 0: // For Gecko browsers compatibility
|
491 |
+
if (event.which == 32) this._preventScroll(event);
|
492 |
+
break;
|
493 |
+
case Event.KEY_UP:
|
494 |
+
case Event.KEY_DOWN:
|
495 |
+
case Event.KEY_PAGEDOWN:
|
496 |
+
case Event.KEY_PAGEUP:
|
497 |
+
case Event.KEY_HOME:
|
498 |
+
case Event.KEY_END:
|
499 |
+
var tagName = node.tagName.toLowerCase();
|
500 |
+
// Safari operates in slightly different way. This realization is still buggy in Safari.
|
501 |
+
if (Prototype.Browser.WebKit && !["textarea", "select"].include(tagName)) {
|
502 |
+
event.stop();
|
503 |
+
} else if ((tagName == "input" && ["submit", "button"].include(node.type)) || (tagName == "a")) {
|
504 |
+
event.stop();
|
505 |
+
}
|
506 |
+
break;
|
507 |
+
}
|
508 |
+
},
|
509 |
+
|
510 |
+
_preventScroll: function(event) { // Disabling scrolling by "space" key
|
511 |
+
if (!["input", "textarea", "select", "button"].include(event.element().tagName.toLowerCase()))
|
512 |
+
event.stop();
|
513 |
+
},
|
514 |
+
|
515 |
+
_deinit: function() {
|
516 |
+
this._removeObservers();
|
517 |
+
Event.stopObserving(window, "resize", this.resizeObserver);
|
518 |
+
if (this.options.transitions) {
|
519 |
+
Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) });
|
520 |
+
} else {
|
521 |
+
this.MBoverlay.hide();
|
522 |
+
this._removeElements();
|
523 |
+
}
|
524 |
+
this.MBcontent.setStyle({overflow: '', height: ''});
|
525 |
+
},
|
526 |
+
|
527 |
+
_cleanUpContentIDs: function() {
|
528 |
+
// Replace prefixes 'MB_' in IDs for the original content
|
529 |
+
if (typeof this.content == 'object') {
|
530 |
+
if (this.content.id && this.content.id.match(/MB_/)) {
|
531 |
+
this.content.id = this.content.id.replace(/MB_/, "");
|
532 |
+
}
|
533 |
+
|
534 |
+
this.content.select('*[id]').each(function(el) {
|
535 |
+
el.id = el.id.replace(/MB_/, "");
|
536 |
+
});
|
537 |
+
}
|
538 |
+
},
|
539 |
+
|
540 |
+
_removeElements: function() {
|
541 |
+
if (Prototype.Browser.Opera) { // Remove overlay after-effects in Opera
|
542 |
+
window.scrollBy(0, 0);
|
543 |
+
}
|
544 |
+
this.MBoverlay.remove();
|
545 |
+
$(this.MBwindowwrapper).remove();
|
546 |
+
if (Prototype.Browser.IE6) {
|
547 |
+
this._prepareIEHtml("", ""); // If set to auto MSIE will show horizontal scrolling
|
548 |
+
this._prepareIESelects("");
|
549 |
+
window.scrollTo(this.initScrollX, this.initScrollY);
|
550 |
+
}
|
551 |
+
|
552 |
+
this._cleanUpContentIDs();
|
553 |
+
|
554 |
+
// Initialized will be set to false
|
555 |
+
this.initialized = false;
|
556 |
+
this.event("afterHide"); // Passing afterHide callback
|
557 |
+
this.setOptions(this._options); // Settings options object into initial state
|
558 |
+
},
|
559 |
+
|
560 |
+
_setWidth: function() { // Set size
|
561 |
+
this.MBwindow.setStyle({width: this.options.width + "px", height: this.options.height + "px"});
|
562 |
+
},
|
563 |
+
|
564 |
+
_setWidthAndPosition: function() {
|
565 |
+
this.MBwindow.setStyle({
|
566 |
+
width: this.options.width + "px"
|
567 |
+
});
|
568 |
+
},
|
569 |
+
|
570 |
+
_prepareIEHtml: function(height, overflow) {
|
571 |
+
// IE6 requires width and height set to 100% and overflow hidden
|
572 |
+
$$('html, body').invoke('setStyle', {
|
573 |
+
width: height,
|
574 |
+
height: height,
|
575 |
+
overflow: overflow
|
576 |
+
});
|
577 |
+
},
|
578 |
+
|
579 |
+
_prepareIESelects: function(visibility, prefix) {
|
580 |
+
// Toggle visibility for select elements
|
581 |
+
$$((prefix || "") + "select").invoke('setStyle', {
|
582 |
+
'visibility': visibility
|
583 |
+
});
|
584 |
+
},
|
585 |
+
|
586 |
+
event: function(eventName) {
|
587 |
+
var r = true;
|
588 |
+
if (this.options[eventName]) {
|
589 |
+
var returnValue = this.options[eventName](); // Executing callback
|
590 |
+
this.options[eventName] = null; // Removing callback after execution
|
591 |
+
if (!Object.isUndefined(returnValue))
|
592 |
+
r = returnValue;
|
593 |
+
}
|
594 |
+
return r;
|
595 |
+
}
|
596 |
+
};
|
597 |
+
|
598 |
+
Object.extend(Modalbox, Modalbox.Methods);
|
599 |
+
|
600 |
+
if (Modalbox.overrideAlert) window.alert = Modalbox.alert;
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Sinabs_Directcheckout</name>
|
4 |
+
<version>0.1.0</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.0</summary>
|
10 |
+
<description>Increase your conversion rate through our one step checkout module.</description>
|
11 |
+
<notes>Release 0.1.0</notes>
|
12 |
+
<authors><author><name>Sinabs</name><user>sinabs_fr</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
+
<date>2014-01-17</date>
|
14 |
+
<time>10:01:35</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="Directcheckout"><dir name="Block"><dir name="Checkout"><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"/><dir name="Onepage"><file name="Link.php" hash="e2c99a8ad1b2ff0c0e46779e8e781a38"/></dir><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"><file name="AjaxController.php" hash="fca216a1a1093278469abd3b9fd5594a"/><dir name="Customer"><file name="AjaxController.php" hash="a29445ad4907034af82dbfc736991b0a"/></dir><file name="IndexController.php" hash="5e3bb2ef6a37f8d57275587e5fd8b684"/></dir><dir name="etc"><file name="config.xml" hash="e9c6abe2756d50fe6501533891d7777b"/><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><file name="additional.phtml" hash="0a99c4ce5270b4ec6b0991eb833e93dc"/><file name="billing.phtml" hash="38c0fd17d763e1b30b30067ff6685722"/><dir name="gift"><file name="options.phtml" hash="945c0f916729b864b879a6f5f4a0dad4"/></dir><file name="gift.phtml" hash="d7ab7ceb3424149f7cb3dae9c00c22b6"/><dir name="payment"><file name="methods.phtml" hash="a764824070152cbfd8965f54de04fbef"/></dir><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="5c1c0749070ab102474f1fc9538b4e7d"/></dir><file name="checkout.phtml" hash="7e78913b9f90fcf67cf65b7d8c7e6830"/><dir name="customer"><file name="forget.phtml" hash="a437f709a6e711668a2a2564be96a0ab"/><file name="login.phtml" hash="3585445d31384c5c88f65849ae4219c4"/><dir name="widget"><file name="name.phtml" hash="c2f0baf4cc8ac175dd7f3b5ac53d2fc6"/></dir></dir></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="0acf5e39b6a0b5dd38033cab4268a0da"/><file name="modal.js" hash="c3b77dc52bba63e273e21414df4f0f77"/></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Sinabs_Directcheckout.csv" hash="a105fd3a42d9c12d57b137cc043b4f32"/></dir><dir name="fr_FR"><file name="Sinabs_Directcheckout.csv" hash="b820881ac64f310db71ee7da470abfb8"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_Directcheckout.xml" hash="8dfc7b08d0b331930caf63b6963f0356"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/default/default/directcheckout/css/modal.css
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
modalbox.css
|
3 |
+
|
4 |
+
Modalbox project
|
5 |
+
|
6 |
+
Created by Andrew Okonetchnikov.
|
7 |
+
Copyright 2006-2010 okonet.ru. All rights reserved.
|
8 |
+
|
9 |
+
Licensed under MIT license.
|
10 |
+
*/
|
11 |
+
|
12 |
+
#MB_overlay {
|
13 |
+
position: absolute;
|
14 |
+
margin: auto;
|
15 |
+
top: 0; left: 0;
|
16 |
+
width: 100%; height: 100%;
|
17 |
+
z-index: 9999;
|
18 |
+
border: 0;
|
19 |
+
background-color: #000!important;
|
20 |
+
}
|
21 |
+
#MB_overlay[id] { position: fixed; }
|
22 |
+
|
23 |
+
#MB_windowwrapper {
|
24 |
+
position:absolute;
|
25 |
+
top:0;
|
26 |
+
width:100%;
|
27 |
+
}
|
28 |
+
|
29 |
+
#MB_window {
|
30 |
+
position:relative;
|
31 |
+
margin-left:auto;
|
32 |
+
margin-right:auto;
|
33 |
+
top:0;
|
34 |
+
left:0;
|
35 |
+
border: 0 solid;
|
36 |
+
text-align: left;
|
37 |
+
z-index: 10000;
|
38 |
+
}
|
39 |
+
#MB_window[id] { position: relative; }
|
40 |
+
|
41 |
+
#MB_frame {
|
42 |
+
position: relative;
|
43 |
+
background-color: #EFEFEF;
|
44 |
+
height: 100%;
|
45 |
+
}
|
46 |
+
|
47 |
+
#MB_header {
|
48 |
+
margin: 0;
|
49 |
+
padding: 0;
|
50 |
+
}
|
51 |
+
|
52 |
+
#MB_content {
|
53 |
+
position: relative;
|
54 |
+
padding: 6px .75em;
|
55 |
+
overflow: auto;
|
56 |
+
}
|
57 |
+
|
58 |
+
#MB_caption {
|
59 |
+
font: bold 100% "Lucida Grande", Arial, sans-serif;
|
60 |
+
text-shadow: #FFF 0 1px 0;
|
61 |
+
padding: .5em 2em .5em .75em;
|
62 |
+
margin: 0;
|
63 |
+
text-align: left;
|
64 |
+
}
|
65 |
+
|
66 |
+
#MB_close {
|
67 |
+
display: block;
|
68 |
+
position: absolute;
|
69 |
+
right: 5px; top: 4px;
|
70 |
+
padding: 2px 3px;
|
71 |
+
font-weight: bold;
|
72 |
+
text-decoration: none;
|
73 |
+
font-size: 13px;
|
74 |
+
}
|
75 |
+
#MB_close:hover {
|
76 |
+
background: transparent;
|
77 |
+
}
|
78 |
+
|
79 |
+
#MB_loading {
|
80 |
+
padding: 1.5em;
|
81 |
+
text-indent: -10000px;
|
82 |
+
background: transparent url(../images/spinner.gif) 50% 0 no-repeat;
|
83 |
+
}
|
84 |
+
|
85 |
+
/* Color scheme */
|
86 |
+
#MB_window {
|
87 |
+
background-color: #EFEFEF;
|
88 |
+
color: #000;
|
89 |
+
|
90 |
+
-webkit-box-shadow: 0 0 64px #000;
|
91 |
+
-moz-box-shadow: #000 0 0 64px;
|
92 |
+
box-shadow: 0 0 64px #000;
|
93 |
+
}
|
94 |
+
#MB_frame {
|
95 |
+
padding-bottom: 4px;
|
96 |
+
|
97 |
+
-webkit-border-bottom-left-radius: 4px;
|
98 |
+
-webkit-border-bottom-right-radius: 4px;
|
99 |
+
|
100 |
+
-moz-border-radius-bottomleft: 4px;
|
101 |
+
-moz-border-radius-bottomright: 4px;
|
102 |
+
|
103 |
+
border-bottom-left-radius: 4px;
|
104 |
+
border-bottom-right-radius: 4px;
|
105 |
+
}
|
106 |
+
|
107 |
+
#MB_content { border-top: 1px solid #F9F9F9; }
|
108 |
+
|
109 |
+
#MB_header {
|
110 |
+
background-color: #DDD;
|
111 |
+
border-bottom: 1px solid #CCC;
|
112 |
+
}
|
113 |
+
#MB_caption { color: #000 }
|
114 |
+
#MB_close { color: #777 }
|
115 |
+
#MB_close:hover { color: #000 }
|
116 |
+
|
117 |
+
|
118 |
+
/* Alert message */
|
119 |
+
.MB_alert {
|
120 |
+
margin: 10px 0;
|
121 |
+
text-align: center;
|
122 |
+
}
|
skin/frontend/default/default/directcheckout/css/styles.css
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#directcheckout-wrapper { background: #fff; border: 1px solid #DEDEDE; padding: 20px; }
|
2 |
+
|
3 |
+
/* Login Form */
|
4 |
+
#customer-login-form-wrapper { padding: 10px; text-align: left; }
|
5 |
+
|
6 |
+
/* Forget Password */
|
7 |
+
#customer-forget-password { padding: 10px; text-align: left; }
|
8 |
+
|
9 |
+
/* Columns */
|
10 |
+
#directcheckout-columns-wrapper { border-top: 1px solid #DEDEDE; min-height: 30em; overflow: hidden; margin-top: 10px; }
|
11 |
+
.directcheckout-col1 { width: 33%; float: left; margin-right: 15px; padding-top: 15px; background: url('../images/line-gradient.gif') no-repeat scroll right top; }
|
12 |
+
.directcheckout-col2 { width: 29%; float: left; margin-right: 15px; padding-right: 15px; padding-top: 15px; background: url('../images/line-gradient.gif') no-repeat scroll right top; }
|
13 |
+
.directcheckout-col3 { width: 32%; float: left; padding-top: 15px; }
|
14 |
+
|
15 |
+
/* Forms */
|
16 |
+
.input-box input { width: 90%; }
|
17 |
+
.input-box select { width: 90%; }
|
18 |
+
.field { margin-top: 5px; }
|
19 |
+
.my-account { margin-bottom: 20px; }
|
20 |
+
|
21 |
+
/* Addresses */
|
22 |
+
#shipping_address { display: none; }
|
23 |
+
.customer-name .name-firstname { float: left; margin-right: 5px; }
|
24 |
+
.customer-name .name-firstname input { width: 87%; }
|
25 |
+
.customer-name .name-lastname { float: left; }
|
26 |
+
.customer-name .name-lastname input { width: 87%; }
|
27 |
+
.address-line2 { margin-top: 5px; }
|
28 |
+
.postcode-city .postcode { float: left; margin-right: 5px; }
|
29 |
+
.postcode-city .postcode input { width: 87%; }
|
30 |
+
.postcode-city .city { float: left; }
|
31 |
+
.postcode-city .city input { width: 87%; }
|
32 |
+
.phone-fax .phone { float: left; margin-right: 5px; }
|
33 |
+
.phone-fax .phone input { width: 87%; }
|
34 |
+
.phone-fax .fax { float: left; }
|
35 |
+
.phone-fax .fax input { width: 87%; }
|
36 |
+
.different-address { padding: 5px; margin-top: 10px; }
|
37 |
+
|
38 |
+
/* Agreements */
|
39 |
+
.agreement-content { text-align: left; }
|
40 |
+
|
41 |
+
/* Extra */
|
42 |
+
#directcheckout-additional { padding: 10px; margin-bottom: 20px; margin-top: 10px; }
|
43 |
+
|
44 |
+
/* Coupon */
|
45 |
+
.directcheckout-discount { margin-top: 20px; }
|
46 |
+
.directcheckout-discount .directcheckout-input button { float: right; }
|
47 |
+
.x-delete { color: #a1b9ed; cursor: pointer; text-decoration: none; float: right; width: 16px; font-family: "Lucida Sans", "Lucida Sans Unicode", sans-serif; font-size: 15px; }
|
48 |
+
.x-delete:hover { color: #36c; }
|
49 |
+
#button-loading { background: url(../images/button-loader.gif) no-repeat; float: right; width: 16px; height: 16px; display: none; margin: 2px 5px; }
|
50 |
+
|
51 |
+
/* Forms */
|
52 |
+
.directcheckout-input { border: 1px solid #ececec; width: 100%; background: #fff; height: 22px; padding: 2px; }
|
53 |
+
.directcheckout-input input { border: none; height: 18px; width: 80%; }
|
54 |
+
|
55 |
+
/* Steps */
|
56 |
+
h3.step1 { height: 35px; background: url('../images/directcheckout-step1.png') no-repeat; padding-left: 29px; }
|
57 |
+
h3.step2 { height: 35px; background: url('../images/directcheckout-step2.png') no-repeat; padding-left: 29px; }
|
58 |
+
h3.step3 { height: 35px; background: url('../images/directcheckout-step3.png') no-repeat; padding-left: 29px; }
|
59 |
+
h3.step4 { height: 35px; background: url('../images/directcheckout-step4.png') no-repeat; padding-left: 29px; }
|
60 |
+
h3.stepfinal { height: 35px; background: url('../images/directcheckout-stepfinal.png') no-repeat; padding-left: 29px; }
|
61 |
+
|
62 |
+
/* Tools */
|
63 |
+
.spacer { clear: both; }
|
64 |
+
.simple-loading-wrapper { width: 100%; height: 100%; }
|
65 |
+
.directcheckout-loading { width: 50px; height: 50px; background: url('../images/spinner.gif') no-repeat; margin: auto; }
|
66 |
+
|
67 |
+
/* Bootstrap Table */
|
68 |
+
table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;}
|
69 |
+
.table{width:100%;margin-bottom:20px;}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;}
|
70 |
+
.table th{font-weight:bold;}
|
71 |
+
.table thead th{vertical-align:bottom;}
|
72 |
+
.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;}
|
73 |
+
.table tbody+tbody{border-top:2px solid #dddddd;}
|
74 |
+
.table-condensed th,.table-condensed td{padding:4px 5px;}
|
75 |
+
.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;}
|
76 |
+
.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;}
|
77 |
+
.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;}
|
78 |
+
.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;}
|
79 |
+
.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;}
|
80 |
+
.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;}
|
81 |
+
.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;}
|
82 |
+
.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;}
|
83 |
+
.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;}
|
84 |
+
.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5;}
|
85 |
+
table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0;}
|
86 |
+
.table td.span1,.table th.span1{float:none;width:44px;margin-left:0;}
|
87 |
+
.table td.span2,.table th.span2{float:none;width:124px;margin-left:0;}
|
88 |
+
.table td.span3,.table th.span3{float:none;width:204px;margin-left:0;}
|
89 |
+
.table td.span4,.table th.span4{float:none;width:284px;margin-left:0;}
|
90 |
+
.table td.span5,.table th.span5{float:none;width:364px;margin-left:0;}
|
91 |
+
.table td.span6,.table th.span6{float:none;width:444px;margin-left:0;}
|
92 |
+
.table td.span7,.table th.span7{float:none;width:524px;margin-left:0;}
|
93 |
+
.table td.span8,.table th.span8{float:none;width:604px;margin-left:0;}
|
94 |
+
.table td.span9,.table th.span9{float:none;width:684px;margin-left:0;}
|
95 |
+
.table td.span10,.table th.span10{float:none;width:764px;margin-left:0;}
|
96 |
+
.table td.span11,.table th.span11{float:none;width:844px;margin-left:0;}
|
97 |
+
.table td.span12,.table th.span12{float:none;width:924px;margin-left:0;}
|
98 |
+
.table tbody tr.success td{background-color:#dff0d8;}
|
99 |
+
.table tbody tr.error td{background-color:#f2dede;}
|
100 |
+
.table tbody tr.warning td{background-color:#fcf8e3;}
|
101 |
+
.table tbody tr.info td{background-color:#d9edf7;}
|
102 |
+
.table-hover tbody tr.success:hover td{background-color:#d0e9c6;}
|
103 |
+
.table-hover tbody tr.error:hover td{background-color:#ebcccc;}
|
104 |
+
.table-hover tbody tr.warning:hover td{background-color:#faf2cc;}
|
105 |
+
.table-hover tbody tr.info:hover td{background-color:#c4e3f3;}
|
skin/frontend/default/default/directcheckout/images/button-loader.gif
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-step1.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-step2.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-step3.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-step4.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-stepfinal.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/line-gradient.gif
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/spinner.gif
ADDED
Binary file
|