Version Notes
Release 0.2.0
Download this release
Release Info
Developer | Magento Core Team |
Extension | Sinabs_Directcheckout |
Version | 0.2.0 |
Comparing to | |
See all releases |
Code changes from version 0.1.6 to 0.2.0
- app/code/community/Sinabs/Directcheckout/Block/Checkout/Gift.php +24 -0
- app/code/community/Sinabs/Directcheckout/Helper/Address.php +0 -55
- app/code/community/Sinabs/Directcheckout/Helper/Data.php +113 -1
- app/code/community/Sinabs/Directcheckout/controllers/AjaxController.php +131 -13
- app/code/community/Sinabs/Directcheckout/controllers/IndexController.php +0 -10
- app/code/community/Sinabs/Directcheckout/etc/config.xml +11 -6
- app/code/community/Sinabs/Directcheckout/etc/system.xml +82 -0
- app/design/adminhtml/default/default/layout/sinabs_directcheckout.xml +7 -0
- app/design/frontend/default/default/layout/directcheckout.xml +7 -4
- app/design/frontend/default/default/template/directcheckout/checkout.phtml +14 -6
- app/design/frontend/default/default/template/directcheckout/checkout/{gift.phtml → additional/gift.phtml} +1 -1
- app/design/frontend/default/default/template/directcheckout/checkout/additional/gift/options.phtml +63 -0
- app/design/frontend/default/default/template/directcheckout/checkout/billing.phtml +100 -83
- app/design/frontend/default/default/template/directcheckout/checkout/gift/options.phtml +0 -55
- app/design/frontend/default/default/template/directcheckout/checkout/shipping.phtml +72 -49
- app/design/frontend/default/default/template/directcheckout/checkout/summary.phtml +5 -1
- app/design/frontend/default/default/template/directcheckout/customer/widget/name.phtml +6 -6
- app/design/frontend/default/default/template/directcheckout/product/view.phtml +0 -26
- app/locale/en_US/Sinabs_Directcheckout.csv +7 -2
- app/locale/fr_FR/Sinabs_Directcheckout.csv +12 -3
- js/directcheckout/directcheckout.js +357 -5
- js/directcheckout/jscolor/arrow.gif +0 -0
- js/directcheckout/jscolor/cross.gif +0 -0
- js/directcheckout/jscolor/demo.html +12 -0
- js/directcheckout/jscolor/hs.png +0 -0
- js/directcheckout/jscolor/hv.png +0 -0
- js/directcheckout/jscolor/jscolor.js +997 -0
- package.xml +6 -6
- skin/frontend/default/default/directcheckout/css/styles.css +24 -8
- skin/frontend/default/default/directcheckout/images/directcheckout-autocomplete-marker.png +0 -0
- skin/frontend/default/default/directcheckout/images/directcheckout-qty-add.gif +0 -0
- skin/frontend/default/default/directcheckout/images/icon/accept.png +0 -0
- skin/frontend/default/default/directcheckout/images/sinabs-dc-step1.png +0 -0
- skin/frontend/default/default/directcheckout/images/sinabs-dc-step2.png +0 -0
- skin/frontend/default/default/directcheckout/images/sinabs-dc-step3.png +0 -0
- skin/frontend/default/default/directcheckout/images/sinabs-dc-stepfinal.png +0 -0
app/code/community/Sinabs/Directcheckout/Block/Checkout/Gift.php
CHANGED
@@ -86,4 +86,28 @@ class Sinabs_Directcheckout_Block_Checkout_Gift extends Mage_Core_Block_Template
|
|
86 |
}
|
87 |
return '';
|
88 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
86 |
}
|
87 |
return '';
|
88 |
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Retrieve current quote ID
|
92 |
+
*
|
93 |
+
* @return int
|
94 |
+
*/
|
95 |
+
public function getQuoteId()
|
96 |
+
{
|
97 |
+
return $quote = Mage::getSingleton('checkout/type_onepage')->getQuote()->getId();
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Retrieve gift Message
|
102 |
+
*
|
103 |
+
* @return mixed Mage_Giftmessage_Model_Message | null
|
104 |
+
*/
|
105 |
+
public function getMessage()
|
106 |
+
{
|
107 |
+
$id = Mage::getSingleton('checkout/type_onepage')->getQuote()->getGiftMessageId();
|
108 |
+
if ($id) {
|
109 |
+
return Mage::getModel('giftmessage/message')->load($id);
|
110 |
+
}
|
111 |
+
return null;
|
112 |
+
}
|
113 |
}
|
app/code/community/Sinabs/Directcheckout/Helper/Address.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sinabs_Directcheckout_Helper_Address extends Mage_Customer_Helper_Address
|
4 |
-
{
|
5 |
-
const XML_PATH_VAT_FRONTEND_VISIBILITY = 'customer/create_account/vat_frontend_visibility';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Get string with frontend validation classes for attribute
|
9 |
-
*
|
10 |
-
* @param string $attributeCode
|
11 |
-
* @return string
|
12 |
-
*/
|
13 |
-
public function getAttributeValidationClass($attributeCode)
|
14 |
-
{
|
15 |
-
/** @var $attribute Mage_Customer_Model_Attribute */
|
16 |
-
$attribute = isset($this->_attributes[$attributeCode]) ? $this->_attributes[$attributeCode]
|
17 |
-
: Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode);
|
18 |
-
$class = $attribute ? $attribute->getFrontend()->getClass() : '';
|
19 |
-
|
20 |
-
if (in_array($attributeCode, array('firstname', 'middlename', 'lastname', 'prefix', 'suffix', 'taxvat'))) {
|
21 |
-
if ($class && !$attribute->getIsVisible()) {
|
22 |
-
$class = ''; // address attribute is not visible thus its validation rules are not applied
|
23 |
-
}
|
24 |
-
|
25 |
-
/** @var $customerAttribute Mage_Customer_Model_Attribute */
|
26 |
-
$customerAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
|
27 |
-
$class .= $customerAttribute && $customerAttribute->getIsVisible()
|
28 |
-
? $customerAttribute->getFrontend()->getClass() : '';
|
29 |
-
$class = implode(' ', array_unique(array_filter(explode(' ', $class))));
|
30 |
-
}
|
31 |
-
|
32 |
-
return $class;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Check whether VAT ID validation is enabled
|
37 |
-
*
|
38 |
-
* @param Mage_Core_Model_Store|string|int $store
|
39 |
-
* @return bool
|
40 |
-
*/
|
41 |
-
public function isVatValidationEnabled($store = null)
|
42 |
-
{
|
43 |
-
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store);
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Check if VAT ID address attribute has to be shown on frontend (on Customer Address management forms)
|
48 |
-
*
|
49 |
-
* @return boolean
|
50 |
-
*/
|
51 |
-
public function isVatAttributeVisible()
|
52 |
-
{
|
53 |
-
return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_FRONTEND_VISIBILITY);
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sinabs/Directcheckout/Helper/Data.php
CHANGED
@@ -44,6 +44,48 @@ class Sinabs_Directcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
44 |
*/
|
45 |
const XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_QTY = 'directcheckout/options/update_qty';
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
* Is Enabled
|
49 |
*
|
@@ -102,7 +144,7 @@ class Sinabs_Directcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
102 |
return Mage::getStoreConfig(self::XML_PATH_CHECKOUT_OPTIONS_GUEST_CHECKOUT);
|
103 |
}
|
104 |
|
105 |
-
|
106 |
* Is Quickview Enable
|
107 |
*
|
108 |
* @return boolean
|
@@ -121,4 +163,74 @@ class Sinabs_Directcheckout_Helper_Data extends Mage_Core_Helper_Abstract
|
|
121 |
{
|
122 |
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_QTY);
|
123 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
44 |
*/
|
45 |
const XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_QTY = 'directcheckout/options/update_qty';
|
46 |
|
47 |
+
/**
|
48 |
+
* XML path refresh order summary when postcode change
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
const XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_POSTCODE = 'directcheckout/options/update_postcode';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* XML path refresh order summary when postcode change
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
const XML_PATH_DIRECTCHECKOUT_OPTIONS_ICONS_COLOR = 'directcheckout/options/icons_color';
|
58 |
+
|
59 |
+
/**
|
60 |
+
* XML path enable address autocomplete
|
61 |
+
*
|
62 |
+
*/
|
63 |
+
const XML_PATH_DIRECTCHECKOUT_GOOGLE_ENABLED = 'directcheckout/google/enabled';
|
64 |
+
|
65 |
+
/**
|
66 |
+
* XML path enable display address form
|
67 |
+
*
|
68 |
+
*/
|
69 |
+
const XML_PATH_DIRECTCHECKOUT_GOOGLE_DISPLAYFORM = 'directcheckout/google/displayform';
|
70 |
+
|
71 |
+
/**
|
72 |
+
* XML path address autocomplete placeholder
|
73 |
+
*
|
74 |
+
*/
|
75 |
+
const XML_PATH_DIRECTCHECKOUT_GOOGLE_PLACEHOLDER = 'directcheckout/google/placeholder';
|
76 |
+
|
77 |
+
/**
|
78 |
+
* XML path enable fax field
|
79 |
+
*
|
80 |
+
*/
|
81 |
+
const XML_PATH_DIRECTCHECKOUT_CHECKOUT_FIELDS_ENABLED_FAX = 'directcheckout/checkout_fields/enabled_fax';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* XML path enable society fax
|
85 |
+
*
|
86 |
+
*/
|
87 |
+
const XML_PATH_DIRECTCHECKOUT_CHECKOUT_FIELDS_ENABLED_SOCIETY = 'directcheckout/checkout_fields/enabled_society';
|
88 |
+
|
89 |
/**
|
90 |
* Is Enabled
|
91 |
*
|
144 |
return Mage::getStoreConfig(self::XML_PATH_CHECKOUT_OPTIONS_GUEST_CHECKOUT);
|
145 |
}
|
146 |
|
147 |
+
/**
|
148 |
* Is Quickview Enable
|
149 |
*
|
150 |
* @return boolean
|
163 |
{
|
164 |
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_QTY);
|
165 |
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Can refresh when post code change
|
169 |
+
*
|
170 |
+
* @return boolean
|
171 |
+
*/
|
172 |
+
public function canRefreshOnPostCodeChange()
|
173 |
+
{
|
174 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_OPTIONS_UPDATE_POSTCODE);
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Return hexa code of icons color
|
179 |
+
*
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public function getIconsColor()
|
183 |
+
{
|
184 |
+
return '#' . Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_OPTIONS_ICONS_COLOR);
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Is address autocomple enabled
|
189 |
+
*
|
190 |
+
* @return boolean
|
191 |
+
*/
|
192 |
+
public function isAddressAutocompleteEnabled()
|
193 |
+
{
|
194 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GOOGLE_ENABLED);
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Can display address form when google address selected
|
199 |
+
*
|
200 |
+
* @return string
|
201 |
+
*/
|
202 |
+
public function canDisplayAddressForm()
|
203 |
+
{
|
204 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GOOGLE_DISPLAYFORM);
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Get address autocomplete placeholder
|
209 |
+
*
|
210 |
+
* @return string
|
211 |
+
*/
|
212 |
+
public function getAddressPlaceholder()
|
213 |
+
{
|
214 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GOOGLE_PLACEHOLDER);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Is enabled Fax field
|
219 |
+
*
|
220 |
+
* @return boolean
|
221 |
+
*/
|
222 |
+
public function isEnabledFaxField()
|
223 |
+
{
|
224 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_CHECKOUT_FIELDS_ENABLED_FAX);
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Is enabled society field
|
229 |
+
*
|
230 |
+
* @return boolean
|
231 |
+
*/
|
232 |
+
public function isEnabledSocietyField()
|
233 |
+
{
|
234 |
+
return Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_CHECKOUT_FIELDS_ENABLED_SOCIETY);
|
235 |
+
}
|
236 |
}
|
app/code/community/Sinabs/Directcheckout/controllers/AjaxController.php
CHANGED
@@ -42,6 +42,11 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
42 |
return Mage::getSingleton('checkout/type_onepage');
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
45 |
protected function _getCart()
|
46 |
{
|
47 |
return Mage::getSingleton('checkout/cart');
|
@@ -50,6 +55,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
50 |
/**
|
51 |
* Update Shipping, Payment and resume
|
52 |
*
|
|
|
53 |
*/
|
54 |
public function update_spoAction()
|
55 |
{
|
@@ -82,6 +88,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
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 |
|
@@ -90,20 +97,30 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
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 |
-
|
102 |
$shippingMethod = $shippingRates[0]->getCode();
|
103 |
}
|
104 |
|
105 |
if ($shippingMethod != '') {
|
106 |
$quote->getShippingAddress()->setShippingMethod($shippingMethod);
|
|
|
107 |
}
|
108 |
|
109 |
$quote->collectTotals();
|
@@ -116,6 +133,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
116 |
/**
|
117 |
* Save order
|
118 |
*
|
|
|
119 |
*/
|
120 |
public function save_orderAction()
|
121 |
{
|
@@ -179,9 +197,9 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
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->
|
185 |
}
|
186 |
|
187 |
$this->_getOnepage()->saveOrder();
|
@@ -193,8 +211,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
193 |
if (isset($redirectUrl)) {
|
194 |
$result['redirect'] = $redirectUrl;
|
195 |
}
|
196 |
-
Mage::getSingleton('checkout/cart')->truncate();
|
197 |
-
Mage::getSingleton('checkout/cart')->save();
|
198 |
$this->getResponse()->setBody(Zend_Json::encode($result));
|
199 |
} catch (Exception $e) {
|
200 |
$result['error'] = true;
|
@@ -208,6 +225,7 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
208 |
/**
|
209 |
* Verify and set coupon code
|
210 |
*
|
|
|
211 |
*/
|
212 |
public function update_couponAction()
|
213 |
{
|
@@ -251,6 +269,17 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
251 |
}
|
252 |
}
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
/**
|
255 |
* Update product qty
|
256 |
*
|
@@ -263,13 +292,9 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
263 |
$itemId = (int)$this->getRequest()->getParam('itemId');
|
264 |
|
265 |
try {
|
266 |
-
$cart = $this->_getCart()->
|
267 |
-
|
268 |
-
|
269 |
-
'qty' => $qty
|
270 |
-
)
|
271 |
-
)
|
272 |
-
);
|
273 |
$cart->save();
|
274 |
$response['success'] = true;
|
275 |
$this->getResponse()->setBody(Zend_Json::encode($response));
|
@@ -296,4 +321,97 @@ class Sinabs_Directcheckout_AjaxController extends Mage_Core_Controller_Front_Ac
|
|
296 |
$this->getLayout()->getBlock('directcheckout.product')->setProduct($product);
|
297 |
$this->renderLayout();
|
298 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
}
|
42 |
return Mage::getSingleton('checkout/type_onepage');
|
43 |
}
|
44 |
|
45 |
+
/**
|
46 |
+
* Get cart
|
47 |
+
*
|
48 |
+
* @return Mage_Checkout_Model_Cart
|
49 |
+
*/
|
50 |
protected function _getCart()
|
51 |
{
|
52 |
return Mage::getSingleton('checkout/cart');
|
55 |
/**
|
56 |
* Update Shipping, Payment and resume
|
57 |
*
|
58 |
+
* @return void
|
59 |
*/
|
60 |
public function update_spoAction()
|
61 |
{
|
88 |
$region = (!isset($data['region']) || empty($data['region'])) ? "-" : $data['region'];
|
89 |
$region_id = (!isset($data['region_id']) || empty($data['region_id'])) ? "-" : $data['region_id'];
|
90 |
$city = (!isset($data['city']) || empty($data['city'])) ? "-" : $data['city'];
|
91 |
+
$postcode = (!isset($data['postcode']) || empty($data['postcode'])) ? "-" : $data['postcode'];
|
92 |
|
93 |
$quote = $this->_getOnepage()->getQuote();
|
94 |
|
97 |
->setRegionId($region_id)
|
98 |
->setRegion($region)
|
99 |
->setCity($city)
|
100 |
+
->setPostcode($postcode)
|
101 |
->setCollectShippingRates(true);
|
102 |
|
103 |
$quote->getBillingAddress()->setCountryId($data['country_id']);
|
104 |
$quote->getShippingAddress()->collectShippingRates();
|
105 |
$quote->setTotalsCollectedFlag(false);
|
106 |
+
|
107 |
+
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
108 |
+
if ($isLoggedIn) {
|
109 |
+
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
|
110 |
+
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
|
111 |
+
} else {
|
112 |
+
$result = $this->getOnepage()->saveShipping($data);
|
113 |
+
}
|
114 |
+
|
115 |
$shippingMethod = $this->getRequest()->getParam('shipping_method');
|
116 |
$shippingRates = $quote->getShippingAddress()->getAllShippingRates();
|
117 |
+
if (count($shippingRates) == 1) {
|
118 |
$shippingMethod = $shippingRates[0]->getCode();
|
119 |
}
|
120 |
|
121 |
if ($shippingMethod != '') {
|
122 |
$quote->getShippingAddress()->setShippingMethod($shippingMethod);
|
123 |
+
//var_dump($quote->getShippingAddress()->getShippingMethod());die;
|
124 |
}
|
125 |
|
126 |
$quote->collectTotals();
|
133 |
/**
|
134 |
* Save order
|
135 |
*
|
136 |
+
* @return void
|
137 |
*/
|
138 |
public function save_orderAction()
|
139 |
{
|
197 |
throw new Exception($this->__('Please agree to all the terms and conditions before placing the order.'));
|
198 |
}
|
199 |
}
|
200 |
+
|
201 |
if ($registered !== false) {
|
202 |
+
$this->_createCustomer($dataBilling, $isSubscribed);
|
203 |
}
|
204 |
|
205 |
$this->_getOnepage()->saveOrder();
|
211 |
if (isset($redirectUrl)) {
|
212 |
$result['redirect'] = $redirectUrl;
|
213 |
}
|
214 |
+
//Mage::getSingleton('checkout/cart')->truncate()->save();
|
|
|
215 |
$this->getResponse()->setBody(Zend_Json::encode($result));
|
216 |
} catch (Exception $e) {
|
217 |
$result['error'] = true;
|
225 |
/**
|
226 |
* Verify and set coupon code
|
227 |
*
|
228 |
+
* @return void
|
229 |
*/
|
230 |
public function update_couponAction()
|
231 |
{
|
269 |
}
|
270 |
}
|
271 |
|
272 |
+
/**
|
273 |
+
* Create Customer
|
274 |
+
*
|
275 |
+
* @param array $data
|
276 |
+
* @return Mage_Customer_Model_Customer_Session
|
277 |
+
*/
|
278 |
+
private function _createCustomer($data, $isSubscribed = false)
|
279 |
+
{
|
280 |
+
$this->_getOnepage()->getQuote()->setCheckoutMethod(Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER);
|
281 |
+
}
|
282 |
+
|
283 |
/**
|
284 |
* Update product qty
|
285 |
*
|
292 |
$itemId = (int)$this->getRequest()->getParam('itemId');
|
293 |
|
294 |
try {
|
295 |
+
$cart = $this->_getCart()->updateItem($itemId, array(
|
296 |
+
'qty' => $qty
|
297 |
+
));
|
|
|
|
|
|
|
|
|
298 |
$cart->save();
|
299 |
$response['success'] = true;
|
300 |
$this->getResponse()->setBody(Zend_Json::encode($response));
|
321 |
$this->getLayout()->getBlock('directcheckout.product')->setProduct($product);
|
322 |
$this->renderLayout();
|
323 |
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Gift Action
|
327 |
+
*
|
328 |
+
* @return void
|
329 |
+
*/
|
330 |
+
public function giftAction()
|
331 |
+
{
|
332 |
+
$this->loadLayout(false);
|
333 |
+
$this->renderLayout();
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Add gift options
|
338 |
+
*
|
339 |
+
* @return void
|
340 |
+
*/
|
341 |
+
public function giftPostAction()
|
342 |
+
{
|
343 |
+
$response = array();
|
344 |
+
$quote = $this->_getOnepage()->getQuote();
|
345 |
+
$data = $this->getRequest()->getParam('giftmessage');
|
346 |
+
|
347 |
+
if (is_array($data)) {
|
348 |
+
foreach ($data as $entityId => $message) {
|
349 |
+
$giftMessage = Mage::getModel('giftmessage/message');
|
350 |
+
|
351 |
+
switch ($message['type']) {
|
352 |
+
case 'quote':
|
353 |
+
$entity = $quote;
|
354 |
+
break;
|
355 |
+
case 'quote_item':
|
356 |
+
$entity = $quote->getItemById($entityId);
|
357 |
+
break;
|
358 |
+
case 'quote_address':
|
359 |
+
$entity = $quote->getAddressById($message['address'])->getItemById($entityId);
|
360 |
+
break;
|
361 |
+
default:
|
362 |
+
$entity = $quote;
|
363 |
+
break;
|
364 |
+
}
|
365 |
+
|
366 |
+
if($entity->getGiftMessageId()) {
|
367 |
+
$giftMessage->load($entity->getGiftMessageId());
|
368 |
+
}
|
369 |
+
|
370 |
+
if(trim($message['message']) == '') {
|
371 |
+
if($giftMessage->getId()) {
|
372 |
+
try{
|
373 |
+
$giftMessage->delete();
|
374 |
+
$entity->setGiftMessageId(0)->save();
|
375 |
+
} catch (Exception $e) {
|
376 |
+
$response['success'] = false;
|
377 |
+
$response['error'] = true;
|
378 |
+
$response['message'] = $e->getMessage();
|
379 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
380 |
+
}
|
381 |
+
}
|
382 |
+
continue;
|
383 |
+
}
|
384 |
+
|
385 |
+
try {
|
386 |
+
$giftMessage->setSender($message['from'])
|
387 |
+
->setRecipient($message['to'])
|
388 |
+
->setMessage($message['message'])
|
389 |
+
->save();
|
390 |
+
|
391 |
+
$entity->setGiftMessageId($giftMessage->getId())->save();
|
392 |
+
} catch (Exception $e) {
|
393 |
+
$response['success'] = false;
|
394 |
+
$response['error'] = true;
|
395 |
+
$response['message'] = $e->getMessage();
|
396 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
397 |
+
}
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
$response['success'] = true;
|
402 |
+
$response['error'] = false;
|
403 |
+
$response['message'] = $this->__('Gift message was added');
|
404 |
+
$response['close'] = true;
|
405 |
+
$this->getResponse()->setBody(Zend_Json::encode($response));
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Get one page checkout model
|
410 |
+
*
|
411 |
+
* @return Mage_Checkout_Model_Type_Onepage
|
412 |
+
*/
|
413 |
+
public function getOnepage()
|
414 |
+
{
|
415 |
+
return Mage::getSingleton('checkout/type_onepage');
|
416 |
+
}
|
417 |
}
|
app/code/community/Sinabs/Directcheckout/controllers/IndexController.php
CHANGED
@@ -56,14 +56,4 @@ class Sinabs_Directcheckout_IndexController extends Mage_Core_Controller_Front_A
|
|
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 |
}
|
56 |
$this->getLayout()->getBlock('head')->setTitle(Mage::getStoreConfig(self::XML_PATH_DIRECTCHECKOUT_GENERAL_PAGE_TITLE));
|
57 |
$this->renderLayout();
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
app/code/community/Sinabs/Directcheckout/etc/config.xml
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Sinabs_Directcheckout>
|
26 |
-
<version>0.
|
27 |
</Sinabs_Directcheckout>
|
28 |
</modules>
|
29 |
<global>
|
@@ -47,11 +47,6 @@
|
|
47 |
<url>Sinabs_Directcheckout_Helper_Url</url>
|
48 |
</rewrite>
|
49 |
</checkout>
|
50 |
-
<customer>
|
51 |
-
<rewrite>
|
52 |
-
<address>Sinabs_Directcheckout_Helper_Address</address>
|
53 |
-
</rewrite>
|
54 |
-
</customer>
|
55 |
</helpers>
|
56 |
</global>
|
57 |
<frontend>
|
@@ -110,12 +105,22 @@
|
|
110 |
</admin>
|
111 |
</resources>
|
112 |
</acl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
</adminhtml>
|
114 |
<default>
|
115 |
<directcheckout>
|
116 |
<general>
|
117 |
<page_title>Directcheckout</page_title>
|
118 |
</general>
|
|
|
|
|
|
|
119 |
</directcheckout>
|
120 |
</default>
|
121 |
</config>
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Sinabs_Directcheckout>
|
26 |
+
<version>0.2.0</version>
|
27 |
</Sinabs_Directcheckout>
|
28 |
</modules>
|
29 |
<global>
|
47 |
<url>Sinabs_Directcheckout_Helper_Url</url>
|
48 |
</rewrite>
|
49 |
</checkout>
|
|
|
|
|
|
|
|
|
|
|
50 |
</helpers>
|
51 |
</global>
|
52 |
<frontend>
|
105 |
</admin>
|
106 |
</resources>
|
107 |
</acl>
|
108 |
+
<layout>
|
109 |
+
<updates>
|
110 |
+
<directcheckout>
|
111 |
+
<file>sinabs_directcheckout.xml</file>
|
112 |
+
</directcheckout>
|
113 |
+
</updates>
|
114 |
+
</layout>
|
115 |
</adminhtml>
|
116 |
<default>
|
117 |
<directcheckout>
|
118 |
<general>
|
119 |
<page_title>Directcheckout</page_title>
|
120 |
</general>
|
121 |
+
<google>
|
122 |
+
<placeholder>14 avenue de Copenhague, 17000 La Rochelle, France</placeholder>
|
123 |
+
</google>
|
124 |
</directcheckout>
|
125 |
</default>
|
126 |
</config>
|
app/code/community/Sinabs/Directcheckout/etc/system.xml
CHANGED
@@ -119,8 +119,90 @@
|
|
119 |
<show_in_website>1</show_in_website>
|
120 |
<show_in_store>1</show_in_store>
|
121 |
</update_qty>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
</fields>
|
123 |
</options>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
</groups>
|
125 |
</directcheckout>
|
126 |
</sections>
|
119 |
<show_in_website>1</show_in_website>
|
120 |
<show_in_store>1</show_in_store>
|
121 |
</update_qty>
|
122 |
+
<update_postcode translate="label">
|
123 |
+
<label>Refresh order summary when postcode change</label>
|
124 |
+
<frontend_type>select</frontend_type>
|
125 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
126 |
+
<sort_order>30</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>1</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
</update_postcode>
|
131 |
+
<icons_color translate="label">
|
132 |
+
<label>Choose icons color</label>
|
133 |
+
<frontend_type>text</frontend_type>
|
134 |
+
<validate>color</validate>
|
135 |
+
<sort_order>40</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>1</show_in_store>
|
139 |
+
</icons_color>
|
140 |
</fields>
|
141 |
</options>
|
142 |
+
<google translate="label">
|
143 |
+
<label>Google Address</label>
|
144 |
+
<frontend_type>text</frontend_type>
|
145 |
+
<sort_order>40</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
<fields>
|
150 |
+
<enabled translate="label">
|
151 |
+
<label>Enabled</label>
|
152 |
+
<frontend_type>select</frontend_type>
|
153 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
154 |
+
<sort_order>10</sort_order>
|
155 |
+
<show_in_default>1</show_in_default>
|
156 |
+
<show_in_website>1</show_in_website>
|
157 |
+
<show_in_store>1</show_in_store>
|
158 |
+
</enabled>
|
159 |
+
<displayform translate="label">
|
160 |
+
<label>Display update adress form</label>
|
161 |
+
<frontend_type>select</frontend_type>
|
162 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
163 |
+
<sort_order>20</sort_order>
|
164 |
+
<show_in_default>1</show_in_default>
|
165 |
+
<show_in_website>1</show_in_website>
|
166 |
+
<show_in_store>1</show_in_store>
|
167 |
+
</displayform>
|
168 |
+
<placeholder translate="label">
|
169 |
+
<label>Address Placeholder</label>
|
170 |
+
<frontend_type>text</frontend_type>
|
171 |
+
<sort_order>30</sort_order>
|
172 |
+
<show_in_default>1</show_in_default>
|
173 |
+
<show_in_website>1</show_in_website>
|
174 |
+
<show_in_store>1</show_in_store>
|
175 |
+
</placeholder>
|
176 |
+
</fields>
|
177 |
+
</google>
|
178 |
+
<checkout_fields translate="label">
|
179 |
+
<label>Field Management</label>
|
180 |
+
<frontend_type>text</frontend_type>
|
181 |
+
<sort_order>50</sort_order>
|
182 |
+
<show_in_default>1</show_in_default>
|
183 |
+
<show_in_website>1</show_in_website>
|
184 |
+
<show_in_store>1</show_in_store>
|
185 |
+
<fields>
|
186 |
+
<enabled_fax translate="label">
|
187 |
+
<label>Enabled Fax Field</label>
|
188 |
+
<frontend_type>select</frontend_type>
|
189 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
190 |
+
<sort_order>10</sort_order>
|
191 |
+
<show_in_default>1</show_in_default>
|
192 |
+
<show_in_website>1</show_in_website>
|
193 |
+
<show_in_store>1</show_in_store>
|
194 |
+
</enabled_fax>
|
195 |
+
<enabled_society translate="label">
|
196 |
+
<label>Enabled Society Field</label>
|
197 |
+
<frontend_type>select</frontend_type>
|
198 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
199 |
+
<sort_order>20</sort_order>
|
200 |
+
<show_in_default>1</show_in_default>
|
201 |
+
<show_in_website>1</show_in_website>
|
202 |
+
<show_in_store>1</show_in_store>
|
203 |
+
</enabled_society>
|
204 |
+
</fields>
|
205 |
+
</checkout_fields>
|
206 |
</groups>
|
207 |
</directcheckout>
|
208 |
</sections>
|
app/design/adminhtml/default/default/layout/sinabs_directcheckout.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<layout version="0.1.0">
|
2 |
+
<adminhtml_system_config_edit>
|
3 |
+
<reference name="head">
|
4 |
+
<action method="addItem"><type>js</type><name>directcheckout/jscolor/jscolor.js</name></action>
|
5 |
+
</reference>
|
6 |
+
</adminhtml_system_config_edit>
|
7 |
+
</layout>
|
app/design/frontend/default/default/layout/directcheckout.xml
CHANGED
@@ -36,6 +36,9 @@
|
|
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>
|
@@ -49,8 +52,8 @@
|
|
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>
|
@@ -68,9 +71,9 @@
|
|
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 |
-
<
|
72 |
-
<block type="
|
73 |
-
</
|
74 |
<directcheckout_ajax_product_view>
|
75 |
<block type="core/template" output="toHtml" name="directcheckout.product" template="directcheckout/product/view.phtml" />
|
76 |
</directcheckout_ajax_product_view>
|
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 |
+
<block type="core/text" name="googleplaces.js" ifconfig="checkout/google/enabled">
|
40 |
+
<action method="setText"><text><![CDATA[<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>]]></text></action>
|
41 |
+
</block>
|
42 |
<action method="addItem"><type>js</type><name>directcheckout/modal.js</name></action>
|
43 |
<action method="addItem"><type>js</type><name>directcheckout/directcheckout.js</name></action>
|
44 |
</reference>
|
52 |
<block type="core/template" name="additional" as="additional" template="directcheckout/checkout/additional.phtml">
|
53 |
<block type="checkout/agreements" name="checkout.agreements" template="directcheckout/checkout/additional/agreements.phtml" ifconfig="checkout/options/enable_agreements" />
|
54 |
<block type="directcheckout/checkout_newsletter" name="checkout.newsletter" template="directcheckout/checkout/additional/newsletter.phtml" />
|
55 |
+
<!--<block type="directcheckout/checkout_gift" name="gift" template="directcheckout/checkout/additional/gift.phtml" />-->
|
56 |
<block type="directcheckout/checkout_coupon" name="coupon" template="directcheckout/checkout/additional/coupon.phtml" />
|
|
|
57 |
</block>
|
58 |
</block>
|
59 |
</reference>
|
71 |
<directcheckout_customer_ajax_forget>
|
72 |
<block type="core/template" output="toHtml" name="customer.forget" template="directcheckout/customer/forget.phtml" />
|
73 |
</directcheckout_customer_ajax_forget>
|
74 |
+
<directcheckout_ajax_gift>
|
75 |
+
<block type="directcheckout/checkout_gift" output="toHtml" name="gift.options" template="directcheckout/checkout/additional/gift/options.phtml" />
|
76 |
+
</directcheckout_ajax_gift>
|
77 |
<directcheckout_ajax_product_view>
|
78 |
<block type="core/template" output="toHtml" name="directcheckout.product" template="directcheckout/product/view.phtml" />
|
79 |
</directcheckout_ajax_product_view>
|
app/design/frontend/default/default/template/directcheckout/checkout.phtml
CHANGED
@@ -23,6 +23,7 @@
|
|
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>
|
@@ -43,13 +44,15 @@
|
|
43 |
</div>
|
44 |
<div class="directcheckout-col2">
|
45 |
<div id="shipping_methods">
|
46 |
-
<
|
|
|
47 |
<div id="shipping_methods_list">
|
48 |
<?php echo $this->getChildHtml('shipping.methods'); ?>
|
49 |
</div>
|
50 |
</div>
|
51 |
<div id="payment_methods">
|
52 |
-
<
|
|
|
53 |
<div id="payment_methods_list">
|
54 |
<?php echo $this->getChildHtml('payment_methods'); ?>
|
55 |
</div>
|
@@ -57,7 +60,8 @@
|
|
57 |
</div>
|
58 |
<div class="directcheckout-col3">
|
59 |
<div id="review-order">
|
60 |
-
<
|
|
|
61 |
<div id="review_order">
|
62 |
<?php echo $this->getChildHtml('summary'); ?>
|
63 |
</div>
|
@@ -86,11 +90,15 @@ var urlSpo = '<?php echo $this->getUrl('directcheckout/ajax/update_spo'); ?>';
|
|
86 |
var urlCoupon = '<?php echo $this->getUrl('directcheckout/ajax/update_coupon'); ?>';
|
87 |
var urlQty = '<?php echo $this->getUrl('directcheckout/ajax/update_qty'); ?>';
|
88 |
var listRegionJson = <?php echo $this->helper('directory')->getRegionJson(); ?>;
|
89 |
-
|
|
|
|
|
90 |
document.observe('dom:loaded', function() {
|
91 |
new Directcheckout();
|
92 |
-
new Directcheckout.Billing({ listRegion: listRegionJson });
|
93 |
-
new Directcheckout.Shipping({ listRegion: listRegionJson });
|
|
|
|
|
94 |
checkUseForShipping(false);
|
95 |
});
|
96 |
</script>
|
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 |
+
$iconsColor = $this->helper('directcheckout')->getIconsColor();
|
27 |
?>
|
28 |
<div id="directcheckout-wrapper">
|
29 |
<h1 class="directcheckout-title"><?php echo $this->__('Checkout'); ?></h1>
|
44 |
</div>
|
45 |
<div class="directcheckout-col2">
|
46 |
<div id="shipping_methods">
|
47 |
+
<div class="step" style="background-color:<?php echo $iconsColor; ?>;"><img src="<?php echo $this->getSkinUrl("directcheckout/images/sinabs-dc-step2.png"); ?>"/></div>
|
48 |
+
<h3 class="step-title"><?php echo $this->__('Shipping Methods'); ?></h3>
|
49 |
<div id="shipping_methods_list">
|
50 |
<?php echo $this->getChildHtml('shipping.methods'); ?>
|
51 |
</div>
|
52 |
</div>
|
53 |
<div id="payment_methods">
|
54 |
+
<div class="step" style="background-color:<?php echo $iconsColor; ?>;"><img src="<?php echo $this->getSkinUrl("directcheckout/images/sinabs-dc-step3.png"); ?>"/></div>
|
55 |
+
<h3 class="step-title"><?php echo $this->__('Payment Methods'); ?></h3>
|
56 |
<div id="payment_methods_list">
|
57 |
<?php echo $this->getChildHtml('payment_methods'); ?>
|
58 |
</div>
|
60 |
</div>
|
61 |
<div class="directcheckout-col3">
|
62 |
<div id="review-order">
|
63 |
+
<div class="step" style="background-color:<?php echo $iconsColor; ?>;"><img src="<?php echo $this->getSkinUrl("directcheckout/images/sinabs-dc-stepfinal.png"); ?>"/></div>
|
64 |
+
<h3 class="step-title"><?php echo $this->__('Order Review'); ?></h3>
|
65 |
<div id="review_order">
|
66 |
<?php echo $this->getChildHtml('summary'); ?>
|
67 |
</div>
|
90 |
var urlCoupon = '<?php echo $this->getUrl('directcheckout/ajax/update_coupon'); ?>';
|
91 |
var urlQty = '<?php echo $this->getUrl('directcheckout/ajax/update_qty'); ?>';
|
92 |
var listRegionJson = <?php echo $this->helper('directory')->getRegionJson(); ?>;
|
93 |
+
var canRefreshOnPostCodeChange = <?php echo Mage::helper('directcheckout')->canRefreshOnPostCodeChange(); ?>;
|
94 |
+
var displayAddress = <?php echo $this->helper('directcheckout')->canDisplayAddressForm(); ?>;
|
95 |
+
var trad = "<?php echo $this->__('I don\'t find my address'); ?>";
|
96 |
document.observe('dom:loaded', function() {
|
97 |
new Directcheckout();
|
98 |
+
new Directcheckout.Billing({ listRegion: listRegionJson, refreshOnPostCodeChange: canRefreshOnPostCodeChange });
|
99 |
+
new Directcheckout.Shipping({ listRegion: listRegionJson, refreshOnPostCodeChange: canRefreshOnPostCodeChange });
|
100 |
+
new Directcheckout.GooglePlacesBilling({ displayAddressForm : displayAddress, translation : trad });
|
101 |
+
new Directcheckout.GooglePlacesShipping({ displayAddressForm : displayAddress, translation : trad });
|
102 |
checkUseForShipping(false);
|
103 |
});
|
104 |
</script>
|
app/design/frontend/default/default/template/directcheckout/checkout/{gift.phtml → additional/gift.phtml}
RENAMED
@@ -31,6 +31,6 @@
|
|
31 |
?>
|
32 |
<?php if ($this->isShow()) : ?>
|
33 |
<ul>
|
34 |
-
<li><a href="<?php echo $this->getUrl('directcheckout/
|
35 |
</ul>
|
36 |
<?php endif; ?>
|
31 |
?>
|
32 |
<?php if ($this->isShow()) : ?>
|
33 |
<ul>
|
34 |
+
<li><a href="<?php echo $this->getUrl('directcheckout/ajax/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/additional/gift/options.phtml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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->allowGiftAll()) : ?>
|
33 |
+
<h4><?php echo $this->__('Do you have any gift items in your order?'); ?></h4>
|
34 |
+
<?php elseif ($this->allowGiftOrder()) : ?>
|
35 |
+
<?php $_message = $this->getMessage(); ?>
|
36 |
+
<h4><?php echo $this->__('Gift Options for the Entire Order.'); ?></h4>
|
37 |
+
<form action="<?php echo $this->getUrl('directcheckout/ajax/giftPost'); ?>" id="gift-order">
|
38 |
+
<input type="hidden" name="giftmessage[<?php echo $this->getQuoteId(); ?>][type]" value="quote" />
|
39 |
+
<ul class="form-list">
|
40 |
+
<li class="fields">
|
41 |
+
<div class="field">
|
42 |
+
<label for="gift-message-whole-from"><?php echo $this->__('From'); ?></label>
|
43 |
+
<div class="input-box">
|
44 |
+
<input type="text" name="giftmessage[<?php echo $this->getQuoteId(); ?>][from]" id="gift-message-whole-from" title="<?php echo $this->__('From'); ?>" value="<?php echo $_message->getSender(); ?>" class="input-text" />
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
<div class="field">
|
48 |
+
<label for="gift-message-whole-to"><?php echo $this->__('To'); ?></label>
|
49 |
+
<div class="input-box">
|
50 |
+
<input type="text" name="giftmessage[<?php echo $this->getQuoteId(); ?>][to]" id="gift-message-whole-to" title="<?php echo $this->__('To'); ?>" value="<?php echo $_message->getRecipient(); ?>" class="input-text" />
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
</li>
|
54 |
+
<li>
|
55 |
+
<label for="gift-message-whole-message"><?php echo $this->__('Message'); ?></label>
|
56 |
+
<div class="input-box">
|
57 |
+
<textarea name="giftmessage[<?php echo $this->getQuoteId(); ?>][message]" title="<?php echo $this->__('Message'); ?>" class="input-text giftmessage-area" rows="5" cols="10"><?php echo $_message->getMessage(); ?></textarea>
|
58 |
+
</div>
|
59 |
+
</li>
|
60 |
+
<button type="submit" class="button"><span><span><?php echo $this->__('Submit'); ?></span></span></button>
|
61 |
+
</ul>
|
62 |
+
</form>
|
63 |
+
<?php endif; ?>
|
app/design/frontend/default/default/template/directcheckout/checkout/billing.phtml
CHANGED
@@ -32,7 +32,8 @@
|
|
32 |
<?php $_isGuestEnabled = $this->helper('directcheckout')->isGuestEnabled(); ?>
|
33 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
34 |
<div class="my-account">
|
35 |
-
<
|
|
|
36 |
<div class="field">
|
37 |
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
38 |
<div class="input-box">
|
@@ -72,7 +73,6 @@
|
|
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">
|
@@ -86,93 +86,106 @@
|
|
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 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
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 |
-
|
128 |
-
|
129 |
-
<div class="
|
130 |
-
|
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 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
</div>
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
155 |
</div>
|
156 |
</div>
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
163 |
</div>
|
164 |
</div>
|
|
|
165 |
</div>
|
166 |
-
|
167 |
<div class="spacer"></div>
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
177 |
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
178 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
@@ -188,29 +201,33 @@
|
|
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 |
-
<
|
|
|
|
|
|
|
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; ?>
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<?php $_isGuestEnabled = $this->helper('directcheckout')->isGuestEnabled(); ?>
|
33 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
34 |
<div class="my-account">
|
35 |
+
<div class="step" style="background-color:<?php echo $this->helper('directcheckout')->getIconsColor(); ?>"><img src="<?php echo $this->getSkinUrl("directcheckout/images/sinabs-dc-step1.png"); ?>"/></div>
|
36 |
+
<h3 class="step-title"><?php echo $this->__('My Account'); ?></h3>
|
37 |
<div class="field">
|
38 |
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
39 |
<div class="input-box">
|
73 |
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
74 |
</div>
|
75 |
<?php endif; ?>
|
|
|
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">
|
86 |
->toHtml()
|
87 |
?>
|
88 |
</div>
|
|
|
89 |
<div class="spacer"></div>
|
90 |
+
<?php if ($this->helper('directcheckout')->isAddressAutocompleteEnabled()) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
<div class="field">
|
92 |
+
<label for="address-autocomplete"><?php echo $this->__('Billing Address'); ?></label>
|
93 |
+
<div class="directcheckout-searchbox input-box">
|
94 |
+
<span class="directcheckout-button span-button" id="billing-button-search" style="display:none;"></span>
|
95 |
+
<input type="text" name="address-autocomplete" id="billing-address-autocomplete" class="input-text" autocomplete="off" placeholder="<?php echo $this->helper('directcheckout')->getAddressPlaceholder(); ?>" />
|
96 |
+
<ul id="billing-place-container" class="place-container" style="display:none;"></ul>
|
97 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
<?php endif; ?>
|
100 |
+
<div id="billing-fields" <?php echo ($this->helper('directcheckout')->isAddressAutocompleteEnabled()) ? 'style="display:none;"' : ''; ?>>
|
101 |
+
<div class="field">
|
102 |
+
<label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
103 |
+
<div class="input-box">
|
104 |
+
<?php echo $this->getCountryHtmlSelect('billing') ?>
|
|
|
|
|
|
|
105 |
</div>
|
106 |
+
</div>
|
107 |
+
<div class="field">
|
108 |
+
<label id="label_region_billing" for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
109 |
+
<div class="input-box">
|
110 |
+
<select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
111 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
112 |
+
</select>
|
113 |
+
<script type="text/javascript">
|
114 |
+
//<![CDATA[
|
115 |
+
$('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
116 |
+
//]]>
|
117 |
+
</script>
|
118 |
+
<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:block;" />
|
119 |
+
</div>
|
120 |
</div>
|
121 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
122 |
+
<label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
123 |
+
<div class="input-box">
|
124 |
+
<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 ?>" />
|
125 |
+
</div>
|
126 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
127 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
128 |
+
<div class="input-box address-line2">
|
129 |
+
<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 ?>" />
|
130 |
+
</div>
|
131 |
+
<?php endfor; ?>
|
132 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
133 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
|
134 |
+
<div class="input-box">
|
135 |
+
<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') ?>" />
|
136 |
</div>
|
137 |
+
<?php endif; ?>
|
138 |
+
<div class="postcode-city">
|
139 |
+
<div class="postcode">
|
140 |
+
<div class="field">
|
141 |
+
<label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
142 |
+
<div class="input-box">
|
143 |
+
<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') ?>" />
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
</div>
|
147 |
+
<div class="city">
|
148 |
+
<div class="field">
|
149 |
+
<label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
150 |
+
<div class="input-box">
|
151 |
+
<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" />
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
</div>
|
155 |
</div>
|
156 |
+
|
157 |
+
<div class="spacer"></div>
|
158 |
+
<?php if ($this->helper('directcheckout')->isEnabledSocietyField()) : ?>
|
159 |
+
<div class="field">
|
160 |
+
<label for="billing:company"><?php echo $this->__('Company') ?></label>
|
161 |
+
<div class="input-box">
|
162 |
+
<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') ?>" />
|
163 |
</div>
|
164 |
</div>
|
165 |
+
<?php endif; ?>
|
166 |
</div>
|
|
|
167 |
<div class="spacer"></div>
|
168 |
+
<div class="phone-fax">
|
169 |
+
<div class="phone">
|
170 |
+
<div class="field">
|
171 |
+
<label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
|
172 |
+
<div class="input-box">
|
173 |
+
<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" />
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
<?php if ($this->helper('directcheckout')->isEnabledFaxField()) : ?>
|
178 |
+
<div class="fax">
|
179 |
+
<div class="field">
|
180 |
+
<label for="billing:fax"><?php echo $this->__('Fax') ?></label>
|
181 |
+
<div class="input-box">
|
182 |
+
<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" />
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
</div>
|
186 |
+
<?php endif; ?>
|
187 |
+
</div>
|
188 |
+
<div class="spacer"></div>
|
189 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
190 |
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
|
191 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
201 |
</div>
|
202 |
<?php endif ?>
|
203 |
<?php endif ?>
|
|
|
204 |
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
|
205 |
<?php if ($_taxvat->isEnabled()): ?>
|
206 |
<?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
207 |
<?php endif ?>
|
208 |
<?php endif; ?>
|
|
|
209 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
210 |
+
<div class="div-save-address">
|
211 |
+
<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" />
|
212 |
+
<label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
|
213 |
+
</div>
|
214 |
<?php else:?>
|
215 |
<input type="hidden" name="billing[save_in_address_book]" value="1" />
|
216 |
<?php endif; ?>
|
|
|
217 |
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
218 |
<?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
|
219 |
</div>
|
|
|
220 |
<div class="different-address">
|
221 |
<?php if ($this->canShip()): ?>
|
222 |
<input type="checkbox" onchange="checkUseForShipping(this.checked)" id="different-address-input" /> <?php echo $this->__('Ship to different address') ?>
|
223 |
<?php endif; ?>
|
224 |
</div>
|
|
|
225 |
<?php if ($this->canShip()): ?>
|
226 |
<input type="hidden" name="billing[use_for_shipping]" id="use_for_shipping" value="1" />
|
227 |
+
<?php endif; ?>
|
228 |
+
|
229 |
+
<script type="text/javascript">
|
230 |
+
//<![CDATA[
|
231 |
+
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
|
232 |
+
//]]>
|
233 |
+
</script>
|
app/design/frontend/default/default/template/directcheckout/checkout/gift/options.phtml
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package 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/shipping.phtml
CHANGED
@@ -40,60 +40,78 @@
|
|
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 |
-
|
56 |
-
|
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 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
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="
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
</div>
|
94 |
</div>
|
95 |
</div>
|
96 |
-
|
97 |
<div class="spacer"></div>
|
98 |
|
99 |
<div class="phone-fax">
|
@@ -128,4 +146,9 @@
|
|
128 |
<?php else:?>
|
129 |
<input type="hidden" name="shipping[save_in_address_book]" value="1" />
|
130 |
<?php endif;?>
|
131 |
-
</div>
|
|
|
|
|
|
|
|
|
|
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 |
|
44 |
+
<div class="spacer"></div>
|
45 |
+
<?php if ($this->helper('directcheckout')->isAddressAutocompleteEnabled()) : ?>
|
|
|
|
|
|
|
|
|
|
|
46 |
<div class="field">
|
47 |
+
<label for="address-autocomplete"><?php echo $this->__('Shipping Address'); ?></label>
|
48 |
+
<div class="directcheckout-searchbox input-box">
|
49 |
+
<span class="directcheckout-button span-button" id="shipping-button-search" style="display:none;"></span>
|
50 |
+
<input type="text" name="address-autocomplete" id="shipping-address-autocomplete" class="input-text" autocomplete="off" placeholder="<?php echo $this->helper('directcheckout')->getAddressPlaceholder(); ?>" />
|
51 |
+
<ul id="shipping-place-container" class="place-container" style="display:none;"></ul>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
<?php endif; ?>
|
55 |
+
<div id="shipping-fields" <?php echo ($this->helper('directcheckout')->isAddressAutocompleteEnabled()) ? 'style="display:none;"' : ''; ?>>
|
56 |
+
<div class="field">
|
57 |
+
<label for="shipping:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
|
58 |
+
<div class="input-box">
|
59 |
+
<?php echo $this->getCountryHtmlSelect('shipping') ?>
|
60 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
</div>
|
62 |
+
<div class="field">
|
63 |
+
<label id="label_region_shipping" for="shipping:region" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
|
64 |
+
<div class="input-box">
|
65 |
+
<select id="shipping:region_id" name="shipping[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
|
66 |
+
<option value=""><?php echo $this->__('Please select region, state or province') ?></option>
|
67 |
+
</select>
|
68 |
+
<script type="text/javascript">
|
69 |
+
//<![CDATA[
|
70 |
+
$('shipping:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
|
71 |
+
//]]>
|
72 |
+
</script>
|
73 |
+
<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;" />
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
|
78 |
+
<label for="shipping:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
|
79 |
+
<div class="input-box">
|
80 |
+
<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 ?>" />
|
81 |
+
</div>
|
82 |
+
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
83 |
+
<?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
|
84 |
+
<div class="input-box address-line2">
|
85 |
+
<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 ?>" />
|
86 |
+
</div>
|
87 |
+
<?php endfor; ?>
|
88 |
+
|
89 |
+
<?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
90 |
+
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
91 |
+
<div class="input-box">
|
92 |
+
<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') ?>" />
|
93 |
+
</div>
|
94 |
+
<?php endif; ?>
|
95 |
+
|
96 |
+
<div class="postcode-city">
|
97 |
+
<div class="postcode">
|
98 |
+
<div class="field">
|
99 |
+
<label for="shipping:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
|
100 |
+
<div class="input-box">
|
101 |
+
<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') ?>" />
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
<div class="city">
|
106 |
+
<div class="field">
|
107 |
+
<label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
|
108 |
+
<div class="input-box">
|
109 |
+
<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" />
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
</div>
|
113 |
</div>
|
114 |
</div>
|
|
|
115 |
<div class="spacer"></div>
|
116 |
|
117 |
<div class="phone-fax">
|
146 |
<?php else:?>
|
147 |
<input type="hidden" name="shipping[save_in_address_book]" value="1" />
|
148 |
<?php endif;?>
|
149 |
+
</div>
|
150 |
+
<script type="text/javascript">
|
151 |
+
//<![CDATA[
|
152 |
+
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
|
153 |
+
//]]>
|
154 |
+
</script>
|
app/design/frontend/default/default/template/directcheckout/checkout/summary.phtml
CHANGED
@@ -51,7 +51,11 @@
|
|
51 |
<?php endif; ?>
|
52 |
</td>
|
53 |
<td class="total">
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
</td>
|
56 |
</tr>
|
57 |
<?php endforeach; ?>
|
51 |
<?php endif; ?>
|
52 |
</td>
|
53 |
<td class="total">
|
54 |
+
<?php if ($this->helper('tax')->displayCartPriceInclTax()): ?>
|
55 |
+
<span class="price"><?php echo $this->helper('checkout')->formatPrice($item->getPriceInclTax()); ?></span>
|
56 |
+
<?php else: ?>
|
57 |
+
<span class="price"><?php echo $this->helper('checkout')->formatPrice($item->getRowTotal()); ?></span>
|
58 |
+
<?php endif; ?>
|
59 |
</td>
|
60 |
</tr>
|
61 |
<?php endforeach; ?>
|
app/design/frontend/default/default/template/directcheckout/customer/widget/name.phtml
CHANGED
@@ -42,24 +42,24 @@
|
|
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 (
|
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
|
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
|
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
|
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 (
|
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
|
63 |
</div>
|
64 |
</div>
|
65 |
<?php if ($this->showSuffix()): ?>
|
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 Mage::helper('Customer')->__('First Name') ?></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 Mage::helper('Customer')->__('First Name') ?>" 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 Mage::helper('Customer')->__('Middle Name') ?></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 Mage::helper('Customer')->__('Middle Name') ?>" 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 Mage::helper('Customer')->__('Last Name') ?></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 Mage::helper('Customer')->__('Last Name') ?>" 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()): ?>
|
app/design/frontend/default/default/template/directcheckout/product/view.phtml
CHANGED
@@ -1,29 +1,3 @@
|
|
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 |
$_product = $this->getProduct();
|
29 |
$_galleryImages = $_product->getMediaGalleryImages();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
$_product = $this->getProduct();
|
3 |
$_galleryImages = $_product->getMediaGalleryImages();
|
app/locale/en_US/Sinabs_Directcheckout.csv
CHANGED
@@ -5,5 +5,10 @@
|
|
5 |
"Error", "Error"
|
6 |
"Enable Newsletter", "Enable Newsletter"
|
7 |
"Enable Coupon Code", "Enable Coupon Code"
|
8 |
-
"
|
9 |
-
"
|
|
|
|
|
|
|
|
|
|
5 |
"Error", "Error"
|
6 |
"Enable Newsletter", "Enable Newsletter"
|
7 |
"Enable Coupon Code", "Enable Coupon Code"
|
8 |
+
"Show Quick View Product", "Show Quick View Product"
|
9 |
+
"Add modalbox product link in order summary table.", "Add modalbox product link in order summary table."
|
10 |
+
"Enable update product qty", "Enable update product qty"
|
11 |
+
"Create an account", "Create an account"
|
12 |
+
"Field Management", "Field Management"
|
13 |
+
"Enabled Fax Field", "Enabled Fax Field"
|
14 |
+
"Enabled Society Field", "Enabled Society Field"
|
app/locale/fr_FR/Sinabs_Directcheckout.csv
CHANGED
@@ -1,9 +1,18 @@
|
|
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
|
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"
|
8 |
-
"
|
9 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 shipping 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"
|
8 |
+
"Show Quick View Product", "Afficher le lien d'aperçu rapide de produit"
|
9 |
+
"Add modalbox product link in order summary table.", "Ajoute un lien modalbox dans le tableau de résumé de commande."
|
10 |
+
"Enable update product qty", "Activer la mise à jour des quantités de produit"
|
11 |
+
"Create an account", "Créer un compte"
|
12 |
+
"Field Management", "Gestion des champs"
|
13 |
+
"Enabled Fax Field", "Activer le champs Fax"
|
14 |
+
"Enabled Society Field", "Activer le champs Société"
|
15 |
+
"Refresh order summary when postcode change", "Rafraichir les informations quand le code postal est modifié"
|
16 |
+
"Display update adress form", "Afficher un formulaire de mise à jour manuelle de l'adresse"
|
17 |
+
"Choose icons color", "Choisissez la couleur des icones"
|
18 |
+
"I don't find my address", "Je ne trouve pas mon adresse"
|
js/directcheckout/directcheckout.js
CHANGED
@@ -51,7 +51,10 @@ Directcheckout.prototype = {
|
|
51 |
if(element.readAttribute('class') == 'modalbox') {
|
52 |
Event.stop(event);
|
53 |
Modalbox.show(element.readAttribute('href'), {
|
54 |
-
title: element.readAttribute('title')
|
|
|
|
|
|
|
55 |
});
|
56 |
}
|
57 |
});
|
@@ -92,6 +95,7 @@ Directcheckout.Billing = Class.create();
|
|
92 |
Directcheckout.Billing.prototype = {
|
93 |
initialize: function(args) {
|
94 |
this.listRegion = args.listRegion;
|
|
|
95 |
this._initBillingRegion();
|
96 |
},
|
97 |
_initBillingRegion: function() {
|
@@ -102,11 +106,23 @@ Directcheckout.Billing.prototype = {
|
|
102 |
updateSpo();
|
103 |
}
|
104 |
}).bind(this));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
},
|
106 |
_updateBillingRegion: function() {
|
107 |
var code = $('billing:country_id').getValue();
|
108 |
|
109 |
-
|
|
|
|
|
|
|
|
|
110 |
|
111 |
if (this.listRegion[code]) {
|
112 |
document.getElementById('billing:region_id').options[document.getElementById('billing:region_id').options.length] = new Option('Please select region, state or province', '');
|
@@ -127,6 +143,7 @@ Directcheckout.Shipping = Class.create();
|
|
127 |
Directcheckout.Shipping.prototype = {
|
128 |
initialize: function(args) {
|
129 |
this.listRegion = args.listRegion;
|
|
|
130 |
this._initShippingRegion();
|
131 |
},
|
132 |
_initShippingRegion: function() {
|
@@ -135,6 +152,12 @@ Directcheckout.Shipping.prototype = {
|
|
135 |
this._updateShippingRegion();
|
136 |
updateSpo();
|
137 |
}).bind(this));
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
},
|
139 |
_changeShippingMethod: function() {
|
140 |
$$('[name="shipping_method"]').each(function(r, i) {
|
@@ -147,8 +170,11 @@ Directcheckout.Shipping.prototype = {
|
|
147 |
},
|
148 |
_updateShippingRegion: function() {
|
149 |
var code = $('shipping:country_id').getValue();
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
152 |
|
153 |
if (this.listRegion[code]) {
|
154 |
document.getElementById('shipping:region_id').options[document.getElementById('shipping:region_id').options.length] = new Option('Please select region, state or province', '');
|
@@ -164,10 +190,106 @@ Directcheckout.Shipping.prototype = {
|
|
164 |
}
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**
|
168 |
* Functions
|
169 |
*/
|
170 |
-
|
171 |
currentPaymentMethod = null;
|
172 |
|
173 |
// Check if "use for shipping" checked
|
@@ -190,6 +312,12 @@ function switchPaymentMethod(method) {
|
|
190 |
}
|
191 |
}
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
|
194 |
// New address selected
|
195 |
function newAddress(adType, value) {
|
@@ -342,4 +470,228 @@ function updateQty(itemId, qty) {
|
|
342 |
}
|
343 |
}
|
344 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
}
|
51 |
if(element.readAttribute('class') == 'modalbox') {
|
52 |
Event.stop(event);
|
53 |
Modalbox.show(element.readAttribute('href'), {
|
54 |
+
title: element.readAttribute('title'),
|
55 |
+
afterLoad: function() {
|
56 |
+
Modalbox.resizeToContent();
|
57 |
+
}
|
58 |
});
|
59 |
}
|
60 |
});
|
95 |
Directcheckout.Billing.prototype = {
|
96 |
initialize: function(args) {
|
97 |
this.listRegion = args.listRegion;
|
98 |
+
this.refreshOnPostCodeChange = args.refreshOnPostCodeChange;
|
99 |
this._initBillingRegion();
|
100 |
},
|
101 |
_initBillingRegion: function() {
|
106 |
updateSpo();
|
107 |
}
|
108 |
}).bind(this));
|
109 |
+
|
110 |
+
if (this.refreshOnPostCodeChange == 1) {
|
111 |
+
$('billing:postcode').observe('change', (function(e) {
|
112 |
+
if ($('use_for_shipping').value == 1) {
|
113 |
+
updateSpo();
|
114 |
+
}
|
115 |
+
}).bind(this));
|
116 |
+
}
|
117 |
},
|
118 |
_updateBillingRegion: function() {
|
119 |
var code = $('billing:country_id').getValue();
|
120 |
|
121 |
+
/*$('billing:region_id').select('option').each(function(o) {
|
122 |
+
o.remove();
|
123 |
+
});*/
|
124 |
+
|
125 |
+
$('billing:region_id').innerHTML = '';
|
126 |
|
127 |
if (this.listRegion[code]) {
|
128 |
document.getElementById('billing:region_id').options[document.getElementById('billing:region_id').options.length] = new Option('Please select region, state or province', '');
|
143 |
Directcheckout.Shipping.prototype = {
|
144 |
initialize: function(args) {
|
145 |
this.listRegion = args.listRegion;
|
146 |
+
this.refreshOnPostCodeChange = args.refreshOnPostCodeChange;
|
147 |
this._initShippingRegion();
|
148 |
},
|
149 |
_initShippingRegion: function() {
|
152 |
this._updateShippingRegion();
|
153 |
updateSpo();
|
154 |
}).bind(this));
|
155 |
+
|
156 |
+
if (this.refreshOnPostCodeChange == 1) {
|
157 |
+
$('shipping:postcode').observe('change', (function(e) {
|
158 |
+
updateSpo();
|
159 |
+
}).bind(this));
|
160 |
+
}
|
161 |
},
|
162 |
_changeShippingMethod: function() {
|
163 |
$$('[name="shipping_method"]').each(function(r, i) {
|
170 |
},
|
171 |
_updateShippingRegion: function() {
|
172 |
var code = $('shipping:country_id').getValue();
|
173 |
+
|
174 |
+
/*$('shipping:region_id').select('option').each(function(o) {
|
175 |
+
o.remove();
|
176 |
+
});*/
|
177 |
+
$('shipping:region_id').innerHTML = '';
|
178 |
|
179 |
if (this.listRegion[code]) {
|
180 |
document.getElementById('shipping:region_id').options[document.getElementById('shipping:region_id').options.length] = new Option('Please select region, state or province', '');
|
190 |
}
|
191 |
}
|
192 |
|
193 |
+
// Google Places
|
194 |
+
Directcheckout.GooglePlacesBilling = Class.create();
|
195 |
+
Directcheckout.GooglePlacesBilling.prototype = {
|
196 |
+
initialize: function(args) {
|
197 |
+
displayAddressForm = args.displayAddressForm;
|
198 |
+
this.service = new google.maps.places.AutocompleteService();
|
199 |
+
this._initAutocompleteField();
|
200 |
+
this.trad = args.translation;
|
201 |
+
},
|
202 |
+
_initAutocompleteField: function() {
|
203 |
+
var el = $('billing-address-autocomplete');
|
204 |
+
var container = $('billing-place-container');
|
205 |
+
if (el) {
|
206 |
+
el.observe('keyup', (function(e) {
|
207 |
+
var value = el.value;
|
208 |
+
if (value != '') {
|
209 |
+
container.setStyle({ display: 'block' });
|
210 |
+
this.service.getPlacePredictions({
|
211 |
+
input: value,
|
212 |
+
type: 'geocode'
|
213 |
+
}, this.displayResult);
|
214 |
+
} else {
|
215 |
+
container.setStyle({ display: 'none' });
|
216 |
+
}
|
217 |
+
}).bind(this));
|
218 |
+
}
|
219 |
+
},
|
220 |
+
displayResult: function(p, s) {
|
221 |
+
if (s == 'OK') {
|
222 |
+
var container = $('billing-place-container');
|
223 |
+
container.update('').innerHTML;
|
224 |
+
p.each(function(r, i) {
|
225 |
+
var el = new Element('li', { 'class': 'address-result', 'data-place': Object.toJSON(r)}).update(r.description);
|
226 |
+
el.observe('click', (function(e) {
|
227 |
+
geoAddress($(Event.element(e)).readAttribute('data-place').evalJSON(), displayAddressForm, false);
|
228 |
+
}).bind(this));
|
229 |
+
container.insert(el).innerHTML;
|
230 |
+
});
|
231 |
+
var address_not_found = new Element('li', {'class': 'address-not-found'}).update(this.trad);
|
232 |
+
container.insert(address_not_found).innerHTML;
|
233 |
+
address_not_found.observe('click', (function(e) {
|
234 |
+
displayFormAddress('billing');
|
235 |
+
}));
|
236 |
+
}
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
var displayAddressForm;
|
241 |
+
|
242 |
+
// Google Places
|
243 |
+
Directcheckout.GooglePlacesShipping = Class.create();
|
244 |
+
Directcheckout.GooglePlacesShipping.prototype = {
|
245 |
+
initialize: function(args) {
|
246 |
+
displayAddressForm = args.displayAddressForm;
|
247 |
+
this.service = new google.maps.places.AutocompleteService();
|
248 |
+
this._initAutocompleteField();
|
249 |
+
this.trad = args.translation;
|
250 |
+
},
|
251 |
+
_initAutocompleteField: function() {
|
252 |
+
var el = $('shipping-address-autocomplete');
|
253 |
+
var container = $('shipping-place-container');
|
254 |
+
if (el) {
|
255 |
+
el.observe('keyup', (function(e) {
|
256 |
+
var value = el.value;
|
257 |
+
if (value != '') {
|
258 |
+
container.setStyle({ display: 'block' });
|
259 |
+
this.service.getPlacePredictions({
|
260 |
+
input: value,
|
261 |
+
type: 'geocode'
|
262 |
+
}, this.displayResult);
|
263 |
+
} else {
|
264 |
+
container.setStyle({ display: 'none' });
|
265 |
+
}
|
266 |
+
}).bind(this));
|
267 |
+
}
|
268 |
+
},
|
269 |
+
displayResult: function(p, s) {
|
270 |
+
if (s == 'OK') {
|
271 |
+
var container = $('shipping-place-container');
|
272 |
+
container.update('').innerHTML;
|
273 |
+
p.each(function(r, i) {
|
274 |
+
var el = new Element('li', { 'class': 'address-result', 'data-place': Object.toJSON(r)}).update(r.description);
|
275 |
+
el.observe('click', (function(e) {
|
276 |
+
geoAddress($(Event.element(e)).readAttribute('data-place').evalJSON(), displayAddressForm, true);
|
277 |
+
}).bind(this));
|
278 |
+
container.insert(el).innerHTML;
|
279 |
+
});
|
280 |
+
var address_not_found = new Element('li', {'class': 'address-not-found'}).update(this.trad);
|
281 |
+
container.insert(address_not_found).innerHTML;
|
282 |
+
address_not_found.observe('click', (function(e) {
|
283 |
+
displayFormAddress('shipping');
|
284 |
+
}));
|
285 |
+
}
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
/**
|
290 |
* Functions
|
291 |
*/
|
292 |
+
// Current payment method selected
|
293 |
currentPaymentMethod = null;
|
294 |
|
295 |
// Check if "use for shipping" checked
|
312 |
}
|
313 |
}
|
314 |
|
315 |
+
function displayFormAddress(address_type) {
|
316 |
+
$(address_type + '-place-container').setStyle({ display: 'none' });
|
317 |
+
$(address_type + '-address-autocomplete').clear();
|
318 |
+
$(address_type + '-address-autocomplete').up('div').up('div').setStyle({ display: 'none' });
|
319 |
+
$(address_type + '-fields').setStyle({ display: 'block' });
|
320 |
+
}
|
321 |
|
322 |
// New address selected
|
323 |
function newAddress(adType, value) {
|
470 |
}
|
471 |
}
|
472 |
});
|
473 |
+
}
|
474 |
+
|
475 |
+
// Google address geolocation
|
476 |
+
function geoAddress(a, displayAddressForm, shipping) {
|
477 |
+
var service = new google.maps.places.PlacesService(document.createElement('div'));
|
478 |
+
service.getDetails({
|
479 |
+
reference: a.reference
|
480 |
+
}, function(d, s) {
|
481 |
+
if (s == 'OK') {
|
482 |
+
var address = {
|
483 |
+
street_number: null,
|
484 |
+
route: '',
|
485 |
+
country: {
|
486 |
+
short_name: null,
|
487 |
+
long_name: null
|
488 |
+
},
|
489 |
+
state: {
|
490 |
+
area1: {
|
491 |
+
short_name: null,
|
492 |
+
long_name: null
|
493 |
+
},
|
494 |
+
area2: {
|
495 |
+
short_name: null,
|
496 |
+
long_name: null
|
497 |
+
}
|
498 |
+
},
|
499 |
+
postal_code: null,
|
500 |
+
locality: null
|
501 |
+
};
|
502 |
+
address.formatted_address = d.formatted_address;
|
503 |
+
d.address_components.each(function(r, i) {
|
504 |
+
r.types.each(function(type) {
|
505 |
+
switch (type) {
|
506 |
+
case 'street_number':
|
507 |
+
address.street_number = r.long_name;
|
508 |
+
break;
|
509 |
+
case 'route':
|
510 |
+
address.route = r.long_name;
|
511 |
+
break;
|
512 |
+
case 'country':
|
513 |
+
address.country.short_name = r.short_name;
|
514 |
+
address.country.long_name = r.long_name;
|
515 |
+
break;
|
516 |
+
case 'administrative_area_level_1':
|
517 |
+
address.state.area1.short_name = r.short_name;
|
518 |
+
address.state.area1.long_name = r.long_name;
|
519 |
+
break;
|
520 |
+
case 'administrative_area_level_2':
|
521 |
+
address.state.area2.short_name = r.short_name;
|
522 |
+
address.state.area2.long_name = r.long_name;
|
523 |
+
break;
|
524 |
+
case 'postal_code':
|
525 |
+
address.postal_code = r.short_name;
|
526 |
+
break;
|
527 |
+
case 'locality':
|
528 |
+
address.locality = r.long_name;
|
529 |
+
break;
|
530 |
+
}
|
531 |
+
});
|
532 |
+
});
|
533 |
+
|
534 |
+
var formattedAddress = (address.formatted_address.length >= 35)
|
535 |
+
? address.formatted_address.substring(0, 35) + '...'
|
536 |
+
: address.formatted_address;
|
537 |
+
if (shipping) {
|
538 |
+
$('shipping-place-container').setStyle({ display: 'none' });
|
539 |
+
$('shipping-button-search').setStyle({
|
540 |
+
display: 'block'
|
541 |
+
}).update(formattedAddress + '<span class="remove-address" onclick="removeShippingAddress();">X</span>').innerHTML;
|
542 |
+
$('shipping-address-autocomplete').setStyle({ display: 'none' });
|
543 |
+
|
544 |
+
if (displayAddressForm == 1) {
|
545 |
+
$('shipping-fields').setStyle({ display: 'block' });
|
546 |
+
}
|
547 |
+
|
548 |
+
setShippingFields(address);
|
549 |
+
} else {
|
550 |
+
$('billing-place-container').setStyle({ display: 'none' });
|
551 |
+
$('billing-button-search').setStyle({
|
552 |
+
display: 'block'
|
553 |
+
}).update(formattedAddress + '<span class="remove-address" onclick="removeBillingAddress();">X</span>').innerHTML;
|
554 |
+
$('billing-address-autocomplete').setStyle({ display: 'none' });
|
555 |
+
|
556 |
+
if (displayAddressForm == 1) {
|
557 |
+
$('billing-fields').setStyle({ display: 'block' });
|
558 |
+
}
|
559 |
+
|
560 |
+
setBillingFields(address);
|
561 |
+
}
|
562 |
+
|
563 |
+
}
|
564 |
+
});
|
565 |
+
}
|
566 |
+
|
567 |
+
// Set Billing Fields
|
568 |
+
function setBillingFields(address) {
|
569 |
+
if (address.country && address.country.short_name != 'undefined') {
|
570 |
+
|
571 |
+
document.getElementById('billing:country_id').value = address.country.short_name;
|
572 |
+
new Directcheckout.Billing({listRegion: listRegionJson});
|
573 |
+
/*var sCountry = $('billing:country_id').select('option[value="' + address.country.short_name + '"]');
|
574 |
+
if (sCountry && sCountry.length > 0) {
|
575 |
+
sCountry[0].selected = true;
|
576 |
+
new Directcheckout.Billing({listRegion: listRegionJson});
|
577 |
+
}*/
|
578 |
+
}
|
579 |
+
|
580 |
+
if (address.state && address.state != 'undefined') {
|
581 |
+
if ($('billing:region_id').getStyle('display') != 'none') {
|
582 |
+
var currentState = listRegionJson[address.country.short_name];
|
583 |
+
var setRegionId = false;
|
584 |
+
for(var i = 0 in currentState) {
|
585 |
+
if (currentState[i].code == address.state.area1.short_name
|
586 |
+
|| currentState[i].code == address.state.area2.short_name
|
587 |
+
|| normalizeString(currentState[i].name) == normalizeString(address.state.area1.long_name)
|
588 |
+
|| normalizeString(currentState[i].name) == normalizeString(address.state.area2.long_name)) {
|
589 |
+
$('billing:region_id').value = i;
|
590 |
+
setRegionId = true;
|
591 |
+
$break;
|
592 |
+
}
|
593 |
+
}
|
594 |
+
}
|
595 |
+
|
596 |
+
if($('billin:region') != 'undefined' && $('billing:region').getStyle('display') != 'none') {
|
597 |
+
$('billing:region').value = address.state.area1.long_name;
|
598 |
+
}
|
599 |
+
}
|
600 |
+
|
601 |
+
var street = (address.street_number && address.street_number != 'undefined') ? address.street_number + ' ' : '';
|
602 |
+
street += (address.route && address.route != 'undefined') ? address.route : '';
|
603 |
+
$('billing:street1').value = street;
|
604 |
+
$('billing:postcode').value = (address.postal_code && address.postal_code != 'undefined') ? address.postal_code : '';
|
605 |
+
$('billing:city').value = (address.locality && address.locality != 'undefined') ? address.locality : '';
|
606 |
+
updateSpo();
|
607 |
+
}
|
608 |
+
|
609 |
+
// Set Shipping Fields
|
610 |
+
function setShippingFields(address) {
|
611 |
+
if (address.country && address.country.short_name != 'undefined') {
|
612 |
+
|
613 |
+
document.getElementById('shipping:country_id').value = address.country.short_name;
|
614 |
+
new Directcheckout.Shipping({listRegion: listRegionJson});
|
615 |
+
|
616 |
+
/*var sCountry = $('shipping:country_id').select('option[value="' + address.country.short_name + '"]');
|
617 |
+
if (sCountry && sCountry.length > 0) {
|
618 |
+
sCountry[0].selected = true;
|
619 |
+
new Directcheckout.Shipping({listRegion: listRegionJson});
|
620 |
+
}*/
|
621 |
+
}
|
622 |
+
|
623 |
+
if (address.state && address.state != 'undefined') {
|
624 |
+
if ($('shipping:region_id').getStyle('display') != 'none') {
|
625 |
+
var currentState = listRegionJson[address.country.short_name];
|
626 |
+
var setRegionId = false;
|
627 |
+
for(var i = 0 in currentState) {
|
628 |
+
if (currentState[i].code == address.state.area1.short_name
|
629 |
+
|| currentState[i].code == address.state.area2.short_name
|
630 |
+
|| normalizeString(currentState[i].name) == normalizeString(address.state.area1.long_name)
|
631 |
+
|| normalizeString(currentState[i].name) == normalizeString(address.state.area2.long_name)) {
|
632 |
+
$('shipping:region_id').value = i;
|
633 |
+
setRegionId = true;
|
634 |
+
$break;
|
635 |
+
}
|
636 |
+
}
|
637 |
+
}
|
638 |
+
|
639 |
+
if($('shipping:region') != 'undefined' && $('shipping:region').getStyle('display') != 'none') {
|
640 |
+
$('shipping:region').value = address.state.area1.long_name;
|
641 |
+
}
|
642 |
+
}
|
643 |
+
|
644 |
+
var street = (address.street_number && address.street_number != 'undefined') ? address.street_number + ' ' : '';
|
645 |
+
street += (address.route && address.route != 'undefined') ? address.route : '';
|
646 |
+
$('shipping:street1').value = street;
|
647 |
+
$('shipping:postcode').value = (address.postal_code && address.postal_code != 'undefined') ? address.postal_code : '';
|
648 |
+
$('shipping:city').value = (address.locality && address.locality != 'undefined') ? address.locality : '';
|
649 |
+
updateSpo();
|
650 |
+
}
|
651 |
+
|
652 |
+
// Remove Billing Address Form
|
653 |
+
function removeBillingAddress() {
|
654 |
+
emptyAddressFields('billing');
|
655 |
+
$('billing-address-autocomplete').setStyle({ display: 'block' }).value = '';
|
656 |
+
$('billing-button-search').setStyle({ display: 'none' });
|
657 |
+
$('billing-fields').setStyle({ display: 'none' });
|
658 |
+
}
|
659 |
+
|
660 |
+
// Remove Shipping Address Form
|
661 |
+
function removeShippingAddress() {
|
662 |
+
emptyAddressFields('shipping');
|
663 |
+
$('shipping-address-autocomplete').setStyle({ display: 'block' }).value = '';
|
664 |
+
$('shipping-button-search').setStyle({ display: 'none' });
|
665 |
+
$('shipping-fields').setStyle({ display: 'none' });
|
666 |
+
}
|
667 |
+
|
668 |
+
function emptyAddressFields(address) {
|
669 |
+
$(address + ':country_id').clear();
|
670 |
+
$(address + ':region_id').clear();
|
671 |
+
$(address + ':region').clear();
|
672 |
+
$(address + ':street1').clear();
|
673 |
+
$(address + ':postcode').clear();
|
674 |
+
$(address + ':city').clear();
|
675 |
+
}
|
676 |
+
|
677 |
+
// Normalize String
|
678 |
+
function normalizeString(s) {
|
679 |
+
if (s) {
|
680 |
+
var r = s.toLowerCase();
|
681 |
+
r = r.replace(new RegExp("\\s", 'g'),"");
|
682 |
+
r = r.replace(new RegExp("[àáâãäå]", 'g'),"a");
|
683 |
+
r = r.replace(new RegExp("æ", 'g'),"ae");
|
684 |
+
r = r.replace(new RegExp("ç", 'g'),"c");
|
685 |
+
r = r.replace(new RegExp("[èéêë]", 'g'),"e");
|
686 |
+
r = r.replace(new RegExp("[ìíîï]", 'g'),"i");
|
687 |
+
r = r.replace(new RegExp("ñ", 'g'),"n");
|
688 |
+
r = r.replace(new RegExp("[òóôõö]", 'g'),"o");
|
689 |
+
r = r.replace(new RegExp("œ", 'g'),"oe");
|
690 |
+
r = r.replace(new RegExp("[ùúûü]", 'g'),"u");
|
691 |
+
r = r.replace(new RegExp("[ýÿ]", 'g'),"y");
|
692 |
+
r = r.replace(new RegExp("\\W", 'g'),"");
|
693 |
+
return r;
|
694 |
+
} else {
|
695 |
+
return '';
|
696 |
+
}
|
697 |
}
|
js/directcheckout/jscolor/arrow.gif
ADDED
Binary file
|
js/directcheckout/jscolor/cross.gif
ADDED
Binary file
|
js/directcheckout/jscolor/demo.html
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<title>jscolor demo</title>
|
4 |
+
</head>
|
5 |
+
<body>
|
6 |
+
|
7 |
+
<script type="text/javascript" src="jscolor.js"></script>
|
8 |
+
|
9 |
+
Click here: <input class="color" value="66ff00">
|
10 |
+
|
11 |
+
</body>
|
12 |
+
</html>
|
js/directcheckout/jscolor/hs.png
ADDED
Binary file
|
js/directcheckout/jscolor/hv.png
ADDED
Binary file
|
js/directcheckout/jscolor/jscolor.js
ADDED
@@ -0,0 +1,997 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jscolor, JavaScript Color Picker
|
3 |
+
*
|
4 |
+
* @version 1.4.2
|
5 |
+
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
6 |
+
* @author Jan Odvarko, http://odvarko.cz
|
7 |
+
* @created 2008-06-15
|
8 |
+
* @updated 2013-11-25
|
9 |
+
* @link http://jscolor.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
var jscolor = {
|
14 |
+
|
15 |
+
|
16 |
+
dir : '', // location of jscolor directory (leave empty to autodetect)
|
17 |
+
bindClass : 'color', // class name
|
18 |
+
binding : true, // automatic binding via <input class="...">
|
19 |
+
preloading : true, // use image preloading?
|
20 |
+
|
21 |
+
|
22 |
+
install : function() {
|
23 |
+
jscolor.addEvent(window, 'load', jscolor.init);
|
24 |
+
},
|
25 |
+
|
26 |
+
|
27 |
+
init : function() {
|
28 |
+
if(jscolor.binding) {
|
29 |
+
jscolor.bind();
|
30 |
+
}
|
31 |
+
if(jscolor.preloading) {
|
32 |
+
jscolor.preload();
|
33 |
+
}
|
34 |
+
},
|
35 |
+
|
36 |
+
|
37 |
+
getDir : function() {
|
38 |
+
if(!jscolor.dir) {
|
39 |
+
var detected = jscolor.detectDir();
|
40 |
+
jscolor.dir = detected!==false ? detected : 'jscolor/';
|
41 |
+
}
|
42 |
+
return jscolor.dir;
|
43 |
+
},
|
44 |
+
|
45 |
+
|
46 |
+
detectDir : function() {
|
47 |
+
var base = location.href;
|
48 |
+
|
49 |
+
var e = document.getElementsByTagName('base');
|
50 |
+
for(var i=0; i<e.length; i+=1) {
|
51 |
+
if(e[i].href) { base = e[i].href; }
|
52 |
+
}
|
53 |
+
|
54 |
+
var e = document.getElementsByTagName('script');
|
55 |
+
for(var i=0; i<e.length; i+=1) {
|
56 |
+
if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
|
57 |
+
var src = new jscolor.URI(e[i].src);
|
58 |
+
var srcAbs = src.toAbsolute(base);
|
59 |
+
srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
|
60 |
+
srcAbs.query = null;
|
61 |
+
srcAbs.fragment = null;
|
62 |
+
return srcAbs.toString();
|
63 |
+
}
|
64 |
+
}
|
65 |
+
return false;
|
66 |
+
},
|
67 |
+
|
68 |
+
|
69 |
+
bind : function() {
|
70 |
+
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
|
71 |
+
var e = document.getElementsByTagName('input');
|
72 |
+
for(var i=0; i<e.length; i+=1) {
|
73 |
+
var m;
|
74 |
+
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
|
75 |
+
var prop = {};
|
76 |
+
if(m[3]) {
|
77 |
+
try {
|
78 |
+
prop = (new Function ('return (' + m[3] + ')'))();
|
79 |
+
} catch(eInvalidProp) {}
|
80 |
+
}
|
81 |
+
e[i].color = new jscolor.color(e[i], prop);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
},
|
85 |
+
|
86 |
+
|
87 |
+
preload : function() {
|
88 |
+
for(var fn in jscolor.imgRequire) {
|
89 |
+
if(jscolor.imgRequire.hasOwnProperty(fn)) {
|
90 |
+
jscolor.loadImage(fn);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
},
|
94 |
+
|
95 |
+
|
96 |
+
images : {
|
97 |
+
pad : [ 181, 101 ],
|
98 |
+
sld : [ 16, 101 ],
|
99 |
+
cross : [ 15, 15 ],
|
100 |
+
arrow : [ 7, 11 ]
|
101 |
+
},
|
102 |
+
|
103 |
+
|
104 |
+
imgRequire : {},
|
105 |
+
imgLoaded : {},
|
106 |
+
|
107 |
+
|
108 |
+
requireImage : function(filename) {
|
109 |
+
jscolor.imgRequire[filename] = true;
|
110 |
+
},
|
111 |
+
|
112 |
+
|
113 |
+
loadImage : function(filename) {
|
114 |
+
if(!jscolor.imgLoaded[filename]) {
|
115 |
+
jscolor.imgLoaded[filename] = new Image();
|
116 |
+
jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
|
117 |
+
}
|
118 |
+
},
|
119 |
+
|
120 |
+
|
121 |
+
fetchElement : function(mixed) {
|
122 |
+
return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
|
123 |
+
},
|
124 |
+
|
125 |
+
|
126 |
+
addEvent : function(el, evnt, func) {
|
127 |
+
if(el.addEventListener) {
|
128 |
+
el.addEventListener(evnt, func, false);
|
129 |
+
} else if(el.attachEvent) {
|
130 |
+
el.attachEvent('on'+evnt, func);
|
131 |
+
}
|
132 |
+
},
|
133 |
+
|
134 |
+
|
135 |
+
fireEvent : function(el, evnt) {
|
136 |
+
if(!el) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
if(document.createEvent) {
|
140 |
+
var ev = document.createEvent('HTMLEvents');
|
141 |
+
ev.initEvent(evnt, true, true);
|
142 |
+
el.dispatchEvent(ev);
|
143 |
+
} else if(document.createEventObject) {
|
144 |
+
var ev = document.createEventObject();
|
145 |
+
el.fireEvent('on'+evnt, ev);
|
146 |
+
} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
|
147 |
+
el['on'+evnt]();
|
148 |
+
}
|
149 |
+
},
|
150 |
+
|
151 |
+
|
152 |
+
getElementPos : function(e) {
|
153 |
+
var e1=e, e2=e;
|
154 |
+
var x=0, y=0;
|
155 |
+
if(e1.offsetParent) {
|
156 |
+
do {
|
157 |
+
x += e1.offsetLeft;
|
158 |
+
y += e1.offsetTop;
|
159 |
+
} while(e1 = e1.offsetParent);
|
160 |
+
}
|
161 |
+
while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
|
162 |
+
x -= e2.scrollLeft;
|
163 |
+
y -= e2.scrollTop;
|
164 |
+
}
|
165 |
+
return [x, y];
|
166 |
+
},
|
167 |
+
|
168 |
+
|
169 |
+
getElementSize : function(e) {
|
170 |
+
return [e.offsetWidth, e.offsetHeight];
|
171 |
+
},
|
172 |
+
|
173 |
+
|
174 |
+
getRelMousePos : function(e) {
|
175 |
+
var x = 0, y = 0;
|
176 |
+
if (!e) { e = window.event; }
|
177 |
+
if (typeof e.offsetX === 'number') {
|
178 |
+
x = e.offsetX;
|
179 |
+
y = e.offsetY;
|
180 |
+
} else if (typeof e.layerX === 'number') {
|
181 |
+
x = e.layerX;
|
182 |
+
y = e.layerY;
|
183 |
+
}
|
184 |
+
return { x: x, y: y };
|
185 |
+
},
|
186 |
+
|
187 |
+
|
188 |
+
getViewPos : function() {
|
189 |
+
if(typeof window.pageYOffset === 'number') {
|
190 |
+
return [window.pageXOffset, window.pageYOffset];
|
191 |
+
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
192 |
+
return [document.body.scrollLeft, document.body.scrollTop];
|
193 |
+
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
|
194 |
+
return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
|
195 |
+
} else {
|
196 |
+
return [0, 0];
|
197 |
+
}
|
198 |
+
},
|
199 |
+
|
200 |
+
|
201 |
+
getViewSize : function() {
|
202 |
+
if(typeof window.innerWidth === 'number') {
|
203 |
+
return [window.innerWidth, window.innerHeight];
|
204 |
+
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
205 |
+
return [document.body.clientWidth, document.body.clientHeight];
|
206 |
+
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
207 |
+
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
|
208 |
+
} else {
|
209 |
+
return [0, 0];
|
210 |
+
}
|
211 |
+
},
|
212 |
+
|
213 |
+
|
214 |
+
URI : function(uri) { // See RFC3986
|
215 |
+
|
216 |
+
this.scheme = null;
|
217 |
+
this.authority = null;
|
218 |
+
this.path = '';
|
219 |
+
this.query = null;
|
220 |
+
this.fragment = null;
|
221 |
+
|
222 |
+
this.parse = function(uri) {
|
223 |
+
var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
|
224 |
+
this.scheme = m[3] ? m[2] : null;
|
225 |
+
this.authority = m[5] ? m[6] : null;
|
226 |
+
this.path = m[7];
|
227 |
+
this.query = m[9] ? m[10] : null;
|
228 |
+
this.fragment = m[12] ? m[13] : null;
|
229 |
+
return this;
|
230 |
+
};
|
231 |
+
|
232 |
+
this.toString = function() {
|
233 |
+
var result = '';
|
234 |
+
if(this.scheme !== null) { result = result + this.scheme + ':'; }
|
235 |
+
if(this.authority !== null) { result = result + '//' + this.authority; }
|
236 |
+
if(this.path !== null) { result = result + this.path; }
|
237 |
+
if(this.query !== null) { result = result + '?' + this.query; }
|
238 |
+
if(this.fragment !== null) { result = result + '#' + this.fragment; }
|
239 |
+
return result;
|
240 |
+
};
|
241 |
+
|
242 |
+
this.toAbsolute = function(base) {
|
243 |
+
var base = new jscolor.URI(base);
|
244 |
+
var r = this;
|
245 |
+
var t = new jscolor.URI;
|
246 |
+
|
247 |
+
if(base.scheme === null) { return false; }
|
248 |
+
|
249 |
+
if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
|
250 |
+
r.scheme = null;
|
251 |
+
}
|
252 |
+
|
253 |
+
if(r.scheme !== null) {
|
254 |
+
t.scheme = r.scheme;
|
255 |
+
t.authority = r.authority;
|
256 |
+
t.path = removeDotSegments(r.path);
|
257 |
+
t.query = r.query;
|
258 |
+
} else {
|
259 |
+
if(r.authority !== null) {
|
260 |
+
t.authority = r.authority;
|
261 |
+
t.path = removeDotSegments(r.path);
|
262 |
+
t.query = r.query;
|
263 |
+
} else {
|
264 |
+
if(r.path === '') {
|
265 |
+
t.path = base.path;
|
266 |
+
if(r.query !== null) {
|
267 |
+
t.query = r.query;
|
268 |
+
} else {
|
269 |
+
t.query = base.query;
|
270 |
+
}
|
271 |
+
} else {
|
272 |
+
if(r.path.substr(0,1) === '/') {
|
273 |
+
t.path = removeDotSegments(r.path);
|
274 |
+
} else {
|
275 |
+
if(base.authority !== null && base.path === '') {
|
276 |
+
t.path = '/'+r.path;
|
277 |
+
} else {
|
278 |
+
t.path = base.path.replace(/[^\/]+$/,'')+r.path;
|
279 |
+
}
|
280 |
+
t.path = removeDotSegments(t.path);
|
281 |
+
}
|
282 |
+
t.query = r.query;
|
283 |
+
}
|
284 |
+
t.authority = base.authority;
|
285 |
+
}
|
286 |
+
t.scheme = base.scheme;
|
287 |
+
}
|
288 |
+
t.fragment = r.fragment;
|
289 |
+
|
290 |
+
return t;
|
291 |
+
};
|
292 |
+
|
293 |
+
function removeDotSegments(path) {
|
294 |
+
var out = '';
|
295 |
+
while(path) {
|
296 |
+
if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
|
297 |
+
path = path.replace(/^\.+/,'').substr(1);
|
298 |
+
} else if(path.substr(0,3)==='/./' || path==='/.') {
|
299 |
+
path = '/'+path.substr(3);
|
300 |
+
} else if(path.substr(0,4)==='/../' || path==='/..') {
|
301 |
+
path = '/'+path.substr(4);
|
302 |
+
out = out.replace(/\/?[^\/]*$/, '');
|
303 |
+
} else if(path==='.' || path==='..') {
|
304 |
+
path = '';
|
305 |
+
} else {
|
306 |
+
var rm = path.match(/^\/?[^\/]*/)[0];
|
307 |
+
path = path.substr(rm.length);
|
308 |
+
out = out + rm;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
return out;
|
312 |
+
}
|
313 |
+
|
314 |
+
if(uri) {
|
315 |
+
this.parse(uri);
|
316 |
+
}
|
317 |
+
|
318 |
+
},
|
319 |
+
|
320 |
+
|
321 |
+
//
|
322 |
+
// Usage example:
|
323 |
+
// var myColor = new jscolor.color(myInputElement)
|
324 |
+
//
|
325 |
+
|
326 |
+
color : function(target, prop) {
|
327 |
+
|
328 |
+
|
329 |
+
this.required = true; // refuse empty values?
|
330 |
+
this.adjust = true; // adjust value to uniform notation?
|
331 |
+
this.hash = false; // prefix color with # symbol?
|
332 |
+
this.caps = true; // uppercase?
|
333 |
+
this.slider = true; // show the value/saturation slider?
|
334 |
+
this.valueElement = target; // value holder
|
335 |
+
this.styleElement = target; // where to reflect current color
|
336 |
+
this.onImmediateChange = null; // onchange callback (can be either string or function)
|
337 |
+
this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
|
338 |
+
this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
|
339 |
+
this.minH = 0; // read-only 0-6
|
340 |
+
this.maxH = 6; // read-only 0-6
|
341 |
+
this.minS = 0; // read-only 0-1
|
342 |
+
this.maxS = 1; // read-only 0-1
|
343 |
+
this.minV = 0; // read-only 0-1
|
344 |
+
this.maxV = 1; // read-only 0-1
|
345 |
+
|
346 |
+
this.pickerOnfocus = true; // display picker on focus?
|
347 |
+
this.pickerMode = 'HSV'; // HSV | HVS
|
348 |
+
this.pickerPosition = 'bottom'; // left | right | top | bottom
|
349 |
+
this.pickerSmartPosition = true; // automatically adjust picker position when necessary
|
350 |
+
this.pickerButtonHeight = 20; // px
|
351 |
+
this.pickerClosable = false;
|
352 |
+
this.pickerCloseText = 'Close';
|
353 |
+
this.pickerButtonColor = 'ButtonText'; // px
|
354 |
+
this.pickerFace = 10; // px
|
355 |
+
this.pickerFaceColor = 'ThreeDFace'; // CSS color
|
356 |
+
this.pickerBorder = 1; // px
|
357 |
+
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
|
358 |
+
this.pickerInset = 1; // px
|
359 |
+
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
|
360 |
+
this.pickerZIndex = 10000;
|
361 |
+
|
362 |
+
|
363 |
+
for(var p in prop) {
|
364 |
+
if(prop.hasOwnProperty(p)) {
|
365 |
+
this[p] = prop[p];
|
366 |
+
}
|
367 |
+
}
|
368 |
+
|
369 |
+
|
370 |
+
this.hidePicker = function() {
|
371 |
+
if(isPickerOwner()) {
|
372 |
+
removePicker();
|
373 |
+
}
|
374 |
+
};
|
375 |
+
|
376 |
+
|
377 |
+
this.showPicker = function() {
|
378 |
+
if(!isPickerOwner()) {
|
379 |
+
var tp = jscolor.getElementPos(target); // target pos
|
380 |
+
var ts = jscolor.getElementSize(target); // target size
|
381 |
+
var vp = jscolor.getViewPos(); // view pos
|
382 |
+
var vs = jscolor.getViewSize(); // view size
|
383 |
+
var ps = getPickerDims(this); // picker size
|
384 |
+
var a, b, c;
|
385 |
+
switch(this.pickerPosition.toLowerCase()) {
|
386 |
+
case 'left': a=1; b=0; c=-1; break;
|
387 |
+
case 'right':a=1; b=0; c=1; break;
|
388 |
+
case 'top': a=0; b=1; c=-1; break;
|
389 |
+
default: a=0; b=1; c=1; break;
|
390 |
+
}
|
391 |
+
var l = (ts[b]+ps[b])/2;
|
392 |
+
|
393 |
+
// picker pos
|
394 |
+
if (!this.pickerSmartPosition) {
|
395 |
+
var pp = [
|
396 |
+
tp[a],
|
397 |
+
tp[b]+ts[b]-l+l*c
|
398 |
+
];
|
399 |
+
} else {
|
400 |
+
var pp = [
|
401 |
+
-vp[a]+tp[a]+ps[a] > vs[a] ?
|
402 |
+
(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
|
403 |
+
tp[a],
|
404 |
+
-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
|
405 |
+
(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
|
406 |
+
(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
|
407 |
+
];
|
408 |
+
}
|
409 |
+
drawPicker(pp[a], pp[b]);
|
410 |
+
}
|
411 |
+
};
|
412 |
+
|
413 |
+
|
414 |
+
this.importColor = function() {
|
415 |
+
if(!valueElement) {
|
416 |
+
this.exportColor();
|
417 |
+
} else {
|
418 |
+
if(!this.adjust) {
|
419 |
+
if(!this.fromString(valueElement.value, leaveValue)) {
|
420 |
+
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
|
421 |
+
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
422 |
+
styleElement.style.color = styleElement.jscStyle.color;
|
423 |
+
this.exportColor(leaveValue | leaveStyle);
|
424 |
+
}
|
425 |
+
} else if(!this.required && /^\s*$/.test(valueElement.value)) {
|
426 |
+
valueElement.value = '';
|
427 |
+
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
|
428 |
+
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
429 |
+
styleElement.style.color = styleElement.jscStyle.color;
|
430 |
+
this.exportColor(leaveValue | leaveStyle);
|
431 |
+
|
432 |
+
} else if(this.fromString(valueElement.value)) {
|
433 |
+
// OK
|
434 |
+
} else {
|
435 |
+
this.exportColor();
|
436 |
+
}
|
437 |
+
}
|
438 |
+
};
|
439 |
+
|
440 |
+
|
441 |
+
this.exportColor = function(flags) {
|
442 |
+
if(!(flags & leaveValue) && valueElement) {
|
443 |
+
var value = this.toString();
|
444 |
+
if(this.caps) { value = value.toUpperCase(); }
|
445 |
+
if(this.hash) { value = '#'+value; }
|
446 |
+
valueElement.value = value;
|
447 |
+
}
|
448 |
+
if(!(flags & leaveStyle) && styleElement) {
|
449 |
+
styleElement.style.backgroundImage = "none";
|
450 |
+
styleElement.style.backgroundColor =
|
451 |
+
'#'+this.toString();
|
452 |
+
styleElement.style.color =
|
453 |
+
0.213 * this.rgb[0] +
|
454 |
+
0.715 * this.rgb[1] +
|
455 |
+
0.072 * this.rgb[2]
|
456 |
+
< 0.5 ? '#FFF' : '#000';
|
457 |
+
}
|
458 |
+
if(!(flags & leavePad) && isPickerOwner()) {
|
459 |
+
redrawPad();
|
460 |
+
}
|
461 |
+
if(!(flags & leaveSld) && isPickerOwner()) {
|
462 |
+
redrawSld();
|
463 |
+
}
|
464 |
+
};
|
465 |
+
|
466 |
+
|
467 |
+
this.fromHSV = function(h, s, v, flags) { // null = don't change
|
468 |
+
if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
|
469 |
+
if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
|
470 |
+
if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
|
471 |
+
|
472 |
+
this.rgb = HSV_RGB(
|
473 |
+
h===null ? this.hsv[0] : (this.hsv[0]=h),
|
474 |
+
s===null ? this.hsv[1] : (this.hsv[1]=s),
|
475 |
+
v===null ? this.hsv[2] : (this.hsv[2]=v)
|
476 |
+
);
|
477 |
+
|
478 |
+
this.exportColor(flags);
|
479 |
+
};
|
480 |
+
|
481 |
+
|
482 |
+
this.fromRGB = function(r, g, b, flags) { // null = don't change
|
483 |
+
if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
|
484 |
+
if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
|
485 |
+
if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
|
486 |
+
|
487 |
+
var hsv = RGB_HSV(
|
488 |
+
r===null ? this.rgb[0] : r,
|
489 |
+
g===null ? this.rgb[1] : g,
|
490 |
+
b===null ? this.rgb[2] : b
|
491 |
+
);
|
492 |
+
if(hsv[0] !== null) {
|
493 |
+
this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
|
494 |
+
}
|
495 |
+
if(hsv[2] !== 0) {
|
496 |
+
this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
|
497 |
+
}
|
498 |
+
this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
|
499 |
+
|
500 |
+
// update RGB according to final HSV, as some values might be trimmed
|
501 |
+
var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
|
502 |
+
this.rgb[0] = rgb[0];
|
503 |
+
this.rgb[1] = rgb[1];
|
504 |
+
this.rgb[2] = rgb[2];
|
505 |
+
|
506 |
+
this.exportColor(flags);
|
507 |
+
};
|
508 |
+
|
509 |
+
|
510 |
+
this.fromString = function(hex, flags) {
|
511 |
+
var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
|
512 |
+
if(!m) {
|
513 |
+
return false;
|
514 |
+
} else {
|
515 |
+
if(m[1].length === 6) { // 6-char notation
|
516 |
+
this.fromRGB(
|
517 |
+
parseInt(m[1].substr(0,2),16) / 255,
|
518 |
+
parseInt(m[1].substr(2,2),16) / 255,
|
519 |
+
parseInt(m[1].substr(4,2),16) / 255,
|
520 |
+
flags
|
521 |
+
);
|
522 |
+
} else { // 3-char notation
|
523 |
+
this.fromRGB(
|
524 |
+
parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
|
525 |
+
parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
|
526 |
+
parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
|
527 |
+
flags
|
528 |
+
);
|
529 |
+
}
|
530 |
+
return true;
|
531 |
+
}
|
532 |
+
};
|
533 |
+
|
534 |
+
|
535 |
+
this.toString = function() {
|
536 |
+
return (
|
537 |
+
(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
|
538 |
+
(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
|
539 |
+
(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
|
540 |
+
);
|
541 |
+
};
|
542 |
+
|
543 |
+
|
544 |
+
function RGB_HSV(r, g, b) {
|
545 |
+
var n = Math.min(Math.min(r,g),b);
|
546 |
+
var v = Math.max(Math.max(r,g),b);
|
547 |
+
var m = v - n;
|
548 |
+
if(m === 0) { return [ null, 0, v ]; }
|
549 |
+
var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
|
550 |
+
return [ h===6?0:h, m/v, v ];
|
551 |
+
}
|
552 |
+
|
553 |
+
|
554 |
+
function HSV_RGB(h, s, v) {
|
555 |
+
if(h === null) { return [ v, v, v ]; }
|
556 |
+
var i = Math.floor(h);
|
557 |
+
var f = i%2 ? h-i : 1-(h-i);
|
558 |
+
var m = v * (1 - s);
|
559 |
+
var n = v * (1 - s*f);
|
560 |
+
switch(i) {
|
561 |
+
case 6:
|
562 |
+
case 0: return [v,n,m];
|
563 |
+
case 1: return [n,v,m];
|
564 |
+
case 2: return [m,v,n];
|
565 |
+
case 3: return [m,n,v];
|
566 |
+
case 4: return [n,m,v];
|
567 |
+
case 5: return [v,m,n];
|
568 |
+
}
|
569 |
+
}
|
570 |
+
|
571 |
+
|
572 |
+
function removePicker() {
|
573 |
+
delete jscolor.picker.owner;
|
574 |
+
document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
|
575 |
+
}
|
576 |
+
|
577 |
+
|
578 |
+
function drawPicker(x, y) {
|
579 |
+
if(!jscolor.picker) {
|
580 |
+
jscolor.picker = {
|
581 |
+
box : document.createElement('div'),
|
582 |
+
boxB : document.createElement('div'),
|
583 |
+
pad : document.createElement('div'),
|
584 |
+
padB : document.createElement('div'),
|
585 |
+
padM : document.createElement('div'),
|
586 |
+
sld : document.createElement('div'),
|
587 |
+
sldB : document.createElement('div'),
|
588 |
+
sldM : document.createElement('div'),
|
589 |
+
btn : document.createElement('div'),
|
590 |
+
btnS : document.createElement('span'),
|
591 |
+
btnT : document.createTextNode(THIS.pickerCloseText)
|
592 |
+
};
|
593 |
+
for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
|
594 |
+
var seg = document.createElement('div');
|
595 |
+
seg.style.height = segSize+'px';
|
596 |
+
seg.style.fontSize = '1px';
|
597 |
+
seg.style.lineHeight = '0';
|
598 |
+
jscolor.picker.sld.appendChild(seg);
|
599 |
+
}
|
600 |
+
jscolor.picker.sldB.appendChild(jscolor.picker.sld);
|
601 |
+
jscolor.picker.box.appendChild(jscolor.picker.sldB);
|
602 |
+
jscolor.picker.box.appendChild(jscolor.picker.sldM);
|
603 |
+
jscolor.picker.padB.appendChild(jscolor.picker.pad);
|
604 |
+
jscolor.picker.box.appendChild(jscolor.picker.padB);
|
605 |
+
jscolor.picker.box.appendChild(jscolor.picker.padM);
|
606 |
+
jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
|
607 |
+
jscolor.picker.btn.appendChild(jscolor.picker.btnS);
|
608 |
+
jscolor.picker.box.appendChild(jscolor.picker.btn);
|
609 |
+
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
610 |
+
}
|
611 |
+
|
612 |
+
var p = jscolor.picker;
|
613 |
+
|
614 |
+
// controls interaction
|
615 |
+
p.box.onmouseup =
|
616 |
+
p.box.onmouseout = function() { target.focus(); };
|
617 |
+
p.box.onmousedown = function() { abortBlur=true; };
|
618 |
+
p.box.onmousemove = function(e) {
|
619 |
+
if (holdPad || holdSld) {
|
620 |
+
holdPad && setPad(e);
|
621 |
+
holdSld && setSld(e);
|
622 |
+
if (document.selection) {
|
623 |
+
document.selection.empty();
|
624 |
+
} else if (window.getSelection) {
|
625 |
+
window.getSelection().removeAllRanges();
|
626 |
+
}
|
627 |
+
dispatchImmediateChange();
|
628 |
+
}
|
629 |
+
};
|
630 |
+
if('ontouchstart' in window) { // if touch device
|
631 |
+
var handle_touchmove = function(e) {
|
632 |
+
var event={
|
633 |
+
'offsetX': e.touches[0].pageX-touchOffset.X,
|
634 |
+
'offsetY': e.touches[0].pageY-touchOffset.Y
|
635 |
+
};
|
636 |
+
if (holdPad || holdSld) {
|
637 |
+
holdPad && setPad(event);
|
638 |
+
holdSld && setSld(event);
|
639 |
+
dispatchImmediateChange();
|
640 |
+
}
|
641 |
+
e.stopPropagation(); // prevent move "view" on broswer
|
642 |
+
e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
|
643 |
+
};
|
644 |
+
p.box.removeEventListener('touchmove', handle_touchmove, false)
|
645 |
+
p.box.addEventListener('touchmove', handle_touchmove, false)
|
646 |
+
}
|
647 |
+
p.padM.onmouseup =
|
648 |
+
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
|
649 |
+
p.padM.onmousedown = function(e) {
|
650 |
+
// if the slider is at the bottom, move it up
|
651 |
+
switch(modeID) {
|
652 |
+
case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
|
653 |
+
case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
|
654 |
+
}
|
655 |
+
holdSld=false;
|
656 |
+
holdPad=true;
|
657 |
+
setPad(e);
|
658 |
+
dispatchImmediateChange();
|
659 |
+
};
|
660 |
+
if('ontouchstart' in window) {
|
661 |
+
p.padM.addEventListener('touchstart', function(e) {
|
662 |
+
touchOffset={
|
663 |
+
'X': e.target.offsetParent.offsetLeft,
|
664 |
+
'Y': e.target.offsetParent.offsetTop
|
665 |
+
};
|
666 |
+
this.onmousedown({
|
667 |
+
'offsetX':e.touches[0].pageX-touchOffset.X,
|
668 |
+
'offsetY':e.touches[0].pageY-touchOffset.Y
|
669 |
+
});
|
670 |
+
});
|
671 |
+
}
|
672 |
+
p.sldM.onmouseup =
|
673 |
+
p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
|
674 |
+
p.sldM.onmousedown = function(e) {
|
675 |
+
holdPad=false;
|
676 |
+
holdSld=true;
|
677 |
+
setSld(e);
|
678 |
+
dispatchImmediateChange();
|
679 |
+
};
|
680 |
+
if('ontouchstart' in window) {
|
681 |
+
p.sldM.addEventListener('touchstart', function(e) {
|
682 |
+
touchOffset={
|
683 |
+
'X': e.target.offsetParent.offsetLeft,
|
684 |
+
'Y': e.target.offsetParent.offsetTop
|
685 |
+
};
|
686 |
+
this.onmousedown({
|
687 |
+
'offsetX':e.touches[0].pageX-touchOffset.X,
|
688 |
+
'offsetY':e.touches[0].pageY-touchOffset.Y
|
689 |
+
});
|
690 |
+
});
|
691 |
+
}
|
692 |
+
|
693 |
+
// picker
|
694 |
+
var dims = getPickerDims(THIS);
|
695 |
+
p.box.style.width = dims[0] + 'px';
|
696 |
+
p.box.style.height = dims[1] + 'px';
|
697 |
+
|
698 |
+
// picker border
|
699 |
+
p.boxB.style.position = 'absolute';
|
700 |
+
p.boxB.style.clear = 'both';
|
701 |
+
p.boxB.style.left = x+'px';
|
702 |
+
p.boxB.style.top = y+'px';
|
703 |
+
p.boxB.style.zIndex = THIS.pickerZIndex;
|
704 |
+
p.boxB.style.border = THIS.pickerBorder+'px solid';
|
705 |
+
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
706 |
+
p.boxB.style.background = THIS.pickerFaceColor;
|
707 |
+
|
708 |
+
// pad image
|
709 |
+
p.pad.style.width = jscolor.images.pad[0]+'px';
|
710 |
+
p.pad.style.height = jscolor.images.pad[1]+'px';
|
711 |
+
|
712 |
+
// pad border
|
713 |
+
p.padB.style.position = 'absolute';
|
714 |
+
p.padB.style.left = THIS.pickerFace+'px';
|
715 |
+
p.padB.style.top = THIS.pickerFace+'px';
|
716 |
+
p.padB.style.border = THIS.pickerInset+'px solid';
|
717 |
+
p.padB.style.borderColor = THIS.pickerInsetColor;
|
718 |
+
|
719 |
+
// pad mouse area
|
720 |
+
p.padM.style.position = 'absolute';
|
721 |
+
p.padM.style.left = '0';
|
722 |
+
p.padM.style.top = '0';
|
723 |
+
p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
|
724 |
+
p.padM.style.height = p.box.style.height;
|
725 |
+
p.padM.style.cursor = 'crosshair';
|
726 |
+
|
727 |
+
// slider image
|
728 |
+
p.sld.style.overflow = 'hidden';
|
729 |
+
p.sld.style.width = jscolor.images.sld[0]+'px';
|
730 |
+
p.sld.style.height = jscolor.images.sld[1]+'px';
|
731 |
+
|
732 |
+
// slider border
|
733 |
+
p.sldB.style.display = THIS.slider ? 'block' : 'none';
|
734 |
+
p.sldB.style.position = 'absolute';
|
735 |
+
p.sldB.style.right = THIS.pickerFace+'px';
|
736 |
+
p.sldB.style.top = THIS.pickerFace+'px';
|
737 |
+
p.sldB.style.border = THIS.pickerInset+'px solid';
|
738 |
+
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
739 |
+
|
740 |
+
// slider mouse area
|
741 |
+
p.sldM.style.display = THIS.slider ? 'block' : 'none';
|
742 |
+
p.sldM.style.position = 'absolute';
|
743 |
+
p.sldM.style.right = '0';
|
744 |
+
p.sldM.style.top = '0';
|
745 |
+
p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
|
746 |
+
p.sldM.style.height = p.box.style.height;
|
747 |
+
try {
|
748 |
+
p.sldM.style.cursor = 'pointer';
|
749 |
+
} catch(eOldIE) {
|
750 |
+
p.sldM.style.cursor = 'hand';
|
751 |
+
}
|
752 |
+
|
753 |
+
// "close" button
|
754 |
+
function setBtnBorder() {
|
755 |
+
var insetColors = THIS.pickerInsetColor.split(/\s+/);
|
756 |
+
var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
|
757 |
+
p.btn.style.borderColor = pickerOutsetColor;
|
758 |
+
}
|
759 |
+
p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
|
760 |
+
p.btn.style.position = 'absolute';
|
761 |
+
p.btn.style.left = THIS.pickerFace + 'px';
|
762 |
+
p.btn.style.bottom = THIS.pickerFace + 'px';
|
763 |
+
p.btn.style.padding = '0 15px';
|
764 |
+
p.btn.style.height = '18px';
|
765 |
+
p.btn.style.border = THIS.pickerInset + 'px solid';
|
766 |
+
setBtnBorder();
|
767 |
+
p.btn.style.color = THIS.pickerButtonColor;
|
768 |
+
p.btn.style.font = '12px sans-serif';
|
769 |
+
p.btn.style.textAlign = 'center';
|
770 |
+
try {
|
771 |
+
p.btn.style.cursor = 'pointer';
|
772 |
+
} catch(eOldIE) {
|
773 |
+
p.btn.style.cursor = 'hand';
|
774 |
+
}
|
775 |
+
p.btn.onmousedown = function () {
|
776 |
+
THIS.hidePicker();
|
777 |
+
};
|
778 |
+
p.btnS.style.lineHeight = p.btn.style.height;
|
779 |
+
|
780 |
+
// load images in optimal order
|
781 |
+
switch(modeID) {
|
782 |
+
case 0: var padImg = 'hs.png'; break;
|
783 |
+
case 1: var padImg = 'hv.png'; break;
|
784 |
+
}
|
785 |
+
p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
|
786 |
+
p.padM.style.backgroundRepeat = "no-repeat";
|
787 |
+
p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
|
788 |
+
p.sldM.style.backgroundRepeat = "no-repeat";
|
789 |
+
p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
|
790 |
+
p.pad.style.backgroundRepeat = "no-repeat";
|
791 |
+
p.pad.style.backgroundPosition = "0 0";
|
792 |
+
|
793 |
+
// place pointers
|
794 |
+
redrawPad();
|
795 |
+
redrawSld();
|
796 |
+
|
797 |
+
jscolor.picker.owner = THIS;
|
798 |
+
document.getElementsByTagName('body')[0].appendChild(p.boxB);
|
799 |
+
}
|
800 |
+
|
801 |
+
|
802 |
+
function getPickerDims(o) {
|
803 |
+
var dims = [
|
804 |
+
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
|
805 |
+
(o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
|
806 |
+
o.pickerClosable ?
|
807 |
+
4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
|
808 |
+
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
|
809 |
+
];
|
810 |
+
return dims;
|
811 |
+
}
|
812 |
+
|
813 |
+
|
814 |
+
function redrawPad() {
|
815 |
+
// redraw the pad pointer
|
816 |
+
switch(modeID) {
|
817 |
+
case 0: var yComponent = 1; break;
|
818 |
+
case 1: var yComponent = 2; break;
|
819 |
+
}
|
820 |
+
var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
|
821 |
+
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
|
822 |
+
jscolor.picker.padM.style.backgroundPosition =
|
823 |
+
(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
|
824 |
+
(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
|
825 |
+
|
826 |
+
// redraw the slider image
|
827 |
+
var seg = jscolor.picker.sld.childNodes;
|
828 |
+
|
829 |
+
switch(modeID) {
|
830 |
+
case 0:
|
831 |
+
var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
|
832 |
+
for(var i=0; i<seg.length; i+=1) {
|
833 |
+
seg[i].style.backgroundColor = 'rgb('+
|
834 |
+
(rgb[0]*(1-i/seg.length)*100)+'%,'+
|
835 |
+
(rgb[1]*(1-i/seg.length)*100)+'%,'+
|
836 |
+
(rgb[2]*(1-i/seg.length)*100)+'%)';
|
837 |
+
}
|
838 |
+
break;
|
839 |
+
case 1:
|
840 |
+
var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
|
841 |
+
var i = Math.floor(THIS.hsv[0]);
|
842 |
+
var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
|
843 |
+
switch(i) {
|
844 |
+
case 6:
|
845 |
+
case 0: rgb=[0,1,2]; break;
|
846 |
+
case 1: rgb=[1,0,2]; break;
|
847 |
+
case 2: rgb=[2,0,1]; break;
|
848 |
+
case 3: rgb=[2,1,0]; break;
|
849 |
+
case 4: rgb=[1,2,0]; break;
|
850 |
+
case 5: rgb=[0,2,1]; break;
|
851 |
+
}
|
852 |
+
for(var i=0; i<seg.length; i+=1) {
|
853 |
+
s = 1 - 1/(seg.length-1)*i;
|
854 |
+
c[1] = c[0] * (1 - s*f);
|
855 |
+
c[2] = c[0] * (1 - s);
|
856 |
+
seg[i].style.backgroundColor = 'rgb('+
|
857 |
+
(c[rgb[0]]*100)+'%,'+
|
858 |
+
(c[rgb[1]]*100)+'%,'+
|
859 |
+
(c[rgb[2]]*100)+'%)';
|
860 |
+
}
|
861 |
+
break;
|
862 |
+
}
|
863 |
+
}
|
864 |
+
|
865 |
+
|
866 |
+
function redrawSld() {
|
867 |
+
// redraw the slider pointer
|
868 |
+
switch(modeID) {
|
869 |
+
case 0: var yComponent = 2; break;
|
870 |
+
case 1: var yComponent = 1; break;
|
871 |
+
}
|
872 |
+
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
|
873 |
+
jscolor.picker.sldM.style.backgroundPosition =
|
874 |
+
'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
|
875 |
+
}
|
876 |
+
|
877 |
+
|
878 |
+
function isPickerOwner() {
|
879 |
+
return jscolor.picker && jscolor.picker.owner === THIS;
|
880 |
+
}
|
881 |
+
|
882 |
+
|
883 |
+
function blurTarget() {
|
884 |
+
if(valueElement === target) {
|
885 |
+
THIS.importColor();
|
886 |
+
}
|
887 |
+
if(THIS.pickerOnfocus) {
|
888 |
+
THIS.hidePicker();
|
889 |
+
}
|
890 |
+
}
|
891 |
+
|
892 |
+
|
893 |
+
function blurValue() {
|
894 |
+
if(valueElement !== target) {
|
895 |
+
THIS.importColor();
|
896 |
+
}
|
897 |
+
}
|
898 |
+
|
899 |
+
|
900 |
+
function setPad(e) {
|
901 |
+
var mpos = jscolor.getRelMousePos(e);
|
902 |
+
var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
|
903 |
+
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
|
904 |
+
switch(modeID) {
|
905 |
+
case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
|
906 |
+
case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
|
907 |
+
}
|
908 |
+
}
|
909 |
+
|
910 |
+
|
911 |
+
function setSld(e) {
|
912 |
+
var mpos = jscolor.getRelMousePos(e);
|
913 |
+
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
|
914 |
+
switch(modeID) {
|
915 |
+
case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
|
916 |
+
case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
|
917 |
+
}
|
918 |
+
}
|
919 |
+
|
920 |
+
|
921 |
+
function dispatchImmediateChange() {
|
922 |
+
if (THIS.onImmediateChange) {
|
923 |
+
var callback;
|
924 |
+
if (typeof THIS.onImmediateChange === 'string') {
|
925 |
+
callback = new Function (THIS.onImmediateChange);
|
926 |
+
} else {
|
927 |
+
callback = THIS.onImmediateChange;
|
928 |
+
}
|
929 |
+
callback.call(THIS);
|
930 |
+
}
|
931 |
+
}
|
932 |
+
|
933 |
+
|
934 |
+
var THIS = this;
|
935 |
+
var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
|
936 |
+
var abortBlur = false;
|
937 |
+
var
|
938 |
+
valueElement = jscolor.fetchElement(this.valueElement),
|
939 |
+
styleElement = jscolor.fetchElement(this.styleElement);
|
940 |
+
var
|
941 |
+
holdPad = false,
|
942 |
+
holdSld = false,
|
943 |
+
touchOffset = {};
|
944 |
+
var
|
945 |
+
leaveValue = 1<<0,
|
946 |
+
leaveStyle = 1<<1,
|
947 |
+
leavePad = 1<<2,
|
948 |
+
leaveSld = 1<<3;
|
949 |
+
|
950 |
+
// target
|
951 |
+
jscolor.addEvent(target, 'focus', function() {
|
952 |
+
if(THIS.pickerOnfocus) { THIS.showPicker(); }
|
953 |
+
});
|
954 |
+
jscolor.addEvent(target, 'blur', function() {
|
955 |
+
if(!abortBlur) {
|
956 |
+
window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
|
957 |
+
} else {
|
958 |
+
abortBlur = false;
|
959 |
+
}
|
960 |
+
});
|
961 |
+
|
962 |
+
// valueElement
|
963 |
+
if(valueElement) {
|
964 |
+
var updateField = function() {
|
965 |
+
THIS.fromString(valueElement.value, leaveValue);
|
966 |
+
dispatchImmediateChange();
|
967 |
+
};
|
968 |
+
jscolor.addEvent(valueElement, 'keyup', updateField);
|
969 |
+
jscolor.addEvent(valueElement, 'input', updateField);
|
970 |
+
jscolor.addEvent(valueElement, 'blur', blurValue);
|
971 |
+
valueElement.setAttribute('autocomplete', 'off');
|
972 |
+
}
|
973 |
+
|
974 |
+
// styleElement
|
975 |
+
if(styleElement) {
|
976 |
+
styleElement.jscStyle = {
|
977 |
+
backgroundImage : styleElement.style.backgroundImage,
|
978 |
+
backgroundColor : styleElement.style.backgroundColor,
|
979 |
+
color : styleElement.style.color
|
980 |
+
};
|
981 |
+
}
|
982 |
+
|
983 |
+
// require images
|
984 |
+
switch(modeID) {
|
985 |
+
case 0: jscolor.requireImage('hs.png'); break;
|
986 |
+
case 1: jscolor.requireImage('hv.png'); break;
|
987 |
+
}
|
988 |
+
jscolor.requireImage('cross.gif');
|
989 |
+
jscolor.requireImage('arrow.gif');
|
990 |
+
|
991 |
+
this.importColor();
|
992 |
+
}
|
993 |
+
|
994 |
+
};
|
995 |
+
|
996 |
+
|
997 |
+
jscolor.install();
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sinabs_Directcheckout</name>
|
4 |
-
<version>0.
|
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.
|
10 |
<description>Increase your conversion rate through our one step checkout module.</description>
|
11 |
-
<notes>Release 0.
|
12 |
<authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="Directcheckout"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Link.php" hash="e2c99a8ad1b2ff0c0e46779e8e781a38"/></dir><file name="Billing.php" hash="3566196fe02cfd6b6302a7c55dc0f4cb"/><file name="Coupon.php" hash="c3ece6a9e8c798034a964e06f021692c"/><file name="Gift.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sinabs_Directcheckout</name>
|
4 |
+
<version>0.2.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.2.0</summary>
|
10 |
<description>Increase your conversion rate through our one step checkout module.</description>
|
11 |
+
<notes>Release 0.2.0</notes>
|
12 |
<authors><author><name>Sinabs</name><user>auto-converted</user><email>tech@sinabs.fr</email></author></authors>
|
13 |
+
<date>2014-07-08</date>
|
14 |
+
<time>09:15:33</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Sinabs"><dir name="Directcheckout"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><file name="Link.php" hash="e2c99a8ad1b2ff0c0e46779e8e781a38"/></dir><file name="Billing.php" hash="3566196fe02cfd6b6302a7c55dc0f4cb"/><file name="Coupon.php" hash="c3ece6a9e8c798034a964e06f021692c"/><file name="Gift.php" hash="193dfb1f6b44663468304353471dcd6b"/><file name="Links.php" hash="0e3348a234cccd82d04f33741b7914f3"/><file name="Newsletter.php" hash="ff4f476b8a62459ada10ada97b072876"/><file name="Shipping.php" hash="222ab5cb49fb254b0b798de4a69b9044"/></dir><dir name="Product"><file name="View.php" hash="0b4aa3a055111cd04cf114990844a0f1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="3422436a33070566271f2a04d5e849ef"/><file name="Url.php" hash="d7f4da682505d1eed6c06d63458bdb24"/></dir><dir name="controllers"><dir name="Customer"><file name="AjaxController.php" hash="a29445ad4907034af82dbfc736991b0a"/></dir><file name="AjaxController.php" hash="133af9af54a59a7c2cbcf45461b341a1"/><file name="IndexController.php" hash="d5cf6b12790d223e427c5a878a285d95"/></dir><dir name="etc"><file name="config.xml" hash="7527330416760ac49630468bb4b46d63"/><file name="system.xml" hash="8c4bbc65b58468b4a1a3701024abe431"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="directcheckout"><dir name="checkout"><dir name="additional"><dir name="gift"><file name="options.phtml" hash="813200c301bbd82fc3abc3bec1f40df9"/></dir><file name="agreements.phtml" hash="d4a63588cb46492263fb1dc934b8b2aa"/><file name="coupon.phtml" hash="708dffbebd44559974e089674dfad28d"/><file name="gift.phtml" hash="32e8ccab51fb030823821f0861cf328f"/><file name="newsletter.phtml" hash="909a0084e07a83827df47ae04f531ab6"/></dir><dir name="payment"><file name="methods.phtml" hash="a764824070152cbfd8965f54de04fbef"/></dir><file name="additional.phtml" hash="0a99c4ce5270b4ec6b0991eb833e93dc"/><file name="billing.phtml" hash="bed43dd7d753a07c516726a3ed0d0d13"/><file name="review.phtml" hash="b834c89a12e1ee5353f5286db796ef55"/><file name="shipping.phtml" hash="d2fd7fb79940c926f0a2e58358996ad2"/><file name="shipping_method.phtml" hash="333b3a89be3454746fe0343f3eafea94"/><file name="spo.phtml" hash="8c17c38c710394e6378926ba8107bb22"/><file name="summary.phtml" hash="dc7e216f97a09745b43c4d6237b87b21"/></dir><dir name="customer"><dir name="widget"><file name="name.phtml" hash="3a873fd64b5794442482a4bd7dc2f3ff"/></dir><file name="forget.phtml" hash="a437f709a6e711668a2a2564be96a0ab"/><file name="login.phtml" hash="3585445d31384c5c88f65849ae4219c4"/></dir><dir name="product"><file name="view.phtml" hash="30cd9ea747586db3123101c44f032a79"/></dir><file name="checkout.phtml" hash="f21c5a0b1bc21b02192241667c651ac2"/></dir></dir><dir name="layout"><file name="directcheckout.xml" hash="7ac9318dafdf1afe04525e93dee42f44"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sinabs_directcheckout.xml" hash="723b268e3dad8923e61df5dea3c3f286"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="directcheckout"><dir name="css"><file name="modal.css" hash="ff14481d15d473063ccbc1158867cf43"/><file name="styles.css" hash="c632d061241f84815f1d20d741a8c660"/></dir><dir name="images"><dir name="icon"><file name="accept.png" hash="8bfed48756f192ed7afe6eaa4799aae4"/></dir><file name="button-loader.gif" hash="9a9cfbeae93874aa92295baf21ace29c"/><file name="directcheckout-autocomplete-marker.png" hash="90f6a52d9db9166d00cb5de860bf6b04"/><file name="directcheckout-qty-add.gif" hash="7914e57701ca26f5c8bf23c6bc3e1f25"/><file name="directcheckout-step1.png" hash="fee760a1d5f3b0ea2b92afb78027a750"/><file name="directcheckout-step2.png" hash="b78af68848930f1be94ef4ed7afd9c9b"/><file name="directcheckout-step3.png" hash="59d0cdcad1de0cdf0141bcd2275f0bc8"/><file name="directcheckout-step4.png" hash="48060ab23605daa5dadd34be3eb35ae6"/><file name="directcheckout-stepfinal.png" hash="b03cf8ea88e987ceb42d966b234d7a1c"/><file name="line-gradient.gif" hash="bef9df2d426124dbe3d496407219190b"/><file name="sinabs-dc-step1.png" hash="98eadf15c37c4863c80c4f4aa6cbfa55"/><file name="sinabs-dc-step2.png" hash="d5693c14a040db352232b715b082a515"/><file name="sinabs-dc-step3.png" hash="1f0ac49961ca8803101f1b317af21fae"/><file name="sinabs-dc-stepfinal.png" hash="445449c05281611c49e1d448af21afb6"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="directcheckout"><dir name="jscolor"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="demo.html" hash="edf71251cb2be20322d2efb00aee86a6"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="e95071b013a8de26669d31a5fa3d9081"/></dir><file name="directcheckout.js" hash="a8563ce53bf2ce6805b58bce8df4a132"/><file name="modal.js" hash="c3b77dc52bba63e273e21414df4f0f77"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Sinabs_Directcheckout.csv" hash="950d6b2d9e7a086166714714c608e0ad"/></dir><dir name="fr_FR"><file name="Sinabs_Directcheckout.csv" hash="523bc6037b3dced4813a826476f8600d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Sinabs_Directcheckout.xml" hash="8dfc7b08d0b331930caf63b6963f0356"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
skin/frontend/default/default/directcheckout/css/styles.css
CHANGED
@@ -6,6 +6,15 @@
|
|
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; }
|
@@ -54,7 +63,7 @@
|
|
54 |
#button-loading { background: url(../images/button-loader.gif) no-repeat; float: right; width: 16px; height: 16px; display: none; margin: 2px 5px; }
|
55 |
|
56 |
/* Forms */
|
57 |
-
.directcheckout-input { border: 1px solid #ececec; width:
|
58 |
.directcheckout-input input { border: none; height: 18px; width: 80%; }
|
59 |
|
60 |
/* Product view */
|
@@ -63,12 +72,14 @@
|
|
63 |
.directcheckout-product-medias .more-views li a { float: left; margin-right: 5px; border: 2px solid #ddd; widht: 56px; height: 56px; overflow: hidden; }
|
64 |
.directcheckout-product-description {float:right; width: 260px; }
|
65 |
|
66 |
-
/*
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
72 |
|
73 |
/* Direct checkout Button */
|
74 |
.directcheckout-button { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9)); background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0); background-color:#f9f9f9; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; border:1px solid #dcdcdc; display:inline-block; cursor:pointer; color:#666666; font-family:arial; font-size:11px; font-weight:bold; padding:1px 6px; text-decoration:none; text-shadow:0px 1px 0px #ffffff; height: 20px; }
|
@@ -118,4 +129,9 @@ table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span
|
|
118 |
.table-hover tbody tr.success:hover td{background-color:#d0e9c6;}
|
119 |
.table-hover tbody tr.error:hover td{background-color:#ebcccc;}
|
120 |
.table-hover tbody tr.warning:hover td{background-color:#faf2cc;}
|
121 |
-
.table-hover tbody tr.info:hover td{background-color:#c4e3f3;}
|
|
|
|
|
|
|
|
|
|
6 |
/* Forget Password */
|
7 |
#customer-forget-password { padding: 10px; text-align: left; }
|
8 |
|
9 |
+
/* Steps */
|
10 |
+
/*h3.step1 { height: 35px; background: url('../images/directcheckout-step1.png') no-repeat; padding-left: 29px; }
|
11 |
+
h3.step2 { height: 35px; background: url('../images/directcheckout-step2.png') no-repeat; padding-left: 29px; }
|
12 |
+
h3.step3 { height: 35px; background: url('../images/directcheckout-step3.png') no-repeat; padding-left: 29px; }
|
13 |
+
h3.step4 { height: 35px; background: url('../images/directcheckout-step4.png') no-repeat; padding-left: 29px; }
|
14 |
+
h3.stepfinal { height: 35px; background: url('../images/directcheckout-stepfinal.png') no-repeat; padding-left: 29px; }*/
|
15 |
+
.step { width:24px; height:24px; margin-right:5px; float:left; border-radius:2px; }
|
16 |
+
.step-title { height:35px; padding-top:1px; }
|
17 |
+
|
18 |
/* Columns */
|
19 |
#directcheckout-columns-wrapper { border-top: 1px solid #DEDEDE; min-height: 30em; overflow: hidden; margin-top: 10px; }
|
20 |
.directcheckout-col1 { width: 33%; float: left; margin-right: 15px; padding-top: 15px; background: url('../images/line-gradient.gif') no-repeat scroll right top; }
|
63 |
#button-loading { background: url(../images/button-loader.gif) no-repeat; float: right; width: 16px; height: 16px; display: none; margin: 2px 5px; }
|
64 |
|
65 |
/* Forms */
|
66 |
+
.directcheckout-input { border: 1px solid #ececec; width: 80%; background: #fff; height: 22px; padding: 2px; border-radius: 5px; }
|
67 |
.directcheckout-input input { border: none; height: 18px; width: 80%; }
|
68 |
|
69 |
/* Product view */
|
72 |
.directcheckout-product-medias .more-views li a { float: left; margin-right: 5px; border: 2px solid #ddd; widht: 56px; height: 56px; overflow: hidden; }
|
73 |
.directcheckout-product-description {float:right; width: 260px; }
|
74 |
|
75 |
+
/* Address Autocomplete */
|
76 |
+
.place-container { width: 90%; padding: 2px; border-right: 1px solid #b6b6b6; border-bottom: 1px solid #b6b6b6; border-left: 1px solid #b6b6b6;}
|
77 |
+
.place-container li.address-result { padding: 5px 0px 5px 20px; font-size: 11px; background: url(../images/directcheckout-autocomplete-marker.png) no-repeat left; }
|
78 |
+
.place-container li:hover {cursor: pointer;}
|
79 |
+
.place-container li.address-result:not(:last-child) {border-bottom: 1px solid #ececec;}
|
80 |
+
.place-container li.address-not-found {text-align: center; background: #ececec; padding: 8px 0 8px 0px; font-weight: bold; }
|
81 |
+
.span-button { width: 90%; height: 18px; padding: 3px; overflow: hidden; position: relative; padding:4px 6px 0 !important; }
|
82 |
+
.remove-address {position: absolute; right: 10px; /*width: 5px; height: 5px;*/ top: 4px; }
|
83 |
|
84 |
/* Direct checkout Button */
|
85 |
.directcheckout-button { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9)); background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%); background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0); background-color:#f9f9f9; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; border:1px solid #dcdcdc; display:inline-block; cursor:pointer; color:#666666; font-family:arial; font-size:11px; font-weight:bold; padding:1px 6px; text-decoration:none; text-shadow:0px 1px 0px #ffffff; height: 20px; }
|
129 |
.table-hover tbody tr.success:hover td{background-color:#d0e9c6;}
|
130 |
.table-hover tbody tr.error:hover td{background-color:#ebcccc;}
|
131 |
.table-hover tbody tr.warning:hover td{background-color:#faf2cc;}
|
132 |
+
.table-hover tbody tr.info:hover td{background-color:#c4e3f3;}
|
133 |
+
|
134 |
+
.div-save-address { margin-top:5px; margin-left:2px;}
|
135 |
+
#customer-register { margin-left:2px; }
|
136 |
+
|
137 |
+
#payment_methods { margin-top:30px; }
|
skin/frontend/default/default/directcheckout/images/directcheckout-autocomplete-marker.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/directcheckout-qty-add.gif
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/icon/accept.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/sinabs-dc-step1.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/sinabs-dc-step2.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/sinabs-dc-step3.png
ADDED
Binary file
|
skin/frontend/default/default/directcheckout/images/sinabs-dc-stepfinal.png
ADDED
Binary file
|