Kartparadigm_Giftcard - Version 1.5.2.0

Version Notes

Giftcard Extension Tested in 1.8 and Working Fine

Download this release

Release Info

Developer Kartparadigm
Extension Kartparadigm_Giftcard
Version 1.5.2.0
Comparing to
See all releases


Code changes from version 1.5.1.0 to 1.5.2.0

Files changed (51) hide show
  1. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend.php +1 -1
  2. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit.php +2 -2
  3. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Form.php +73 -20
  4. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Form.php~ +0 -101
  5. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Tabs.php~ +0 -34
  6. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Registries.php +1 -1
  7. app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Templates/Edit/Form.php +2 -0
  8. app/code/community/Kartparadigm/Giftcard/Helper/Data.php~ +0 -29
  9. app/code/community/Kartparadigm/Giftcard/Helper/Payment.php~ +0 -17
  10. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcard.php~ +0 -9
  11. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcard/Collection.php~ +0 -10
  12. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtemplate.php~ +0 -9
  13. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtemplate/Collection.php~ +0 -10
  14. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtrans.php~ +0 -9
  15. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtrans/Collection.php~ +0 -10
  16. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Template.php~ +0 -9
  17. app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Templates.php~ +0 -9
  18. app/code/community/Kartparadigm/Giftcard/Model/Observer.php +4 -4
  19. app/code/community/Kartparadigm/Giftcard/Model/Observer.php~ +0 -601
  20. app/code/community/Kartparadigm/Giftcard/Model/Product/Type.php~ +0 -28
  21. app/code/community/Kartparadigm/Giftcard/Model/Quote/Payment.php~ +0 -16
  22. app/code/community/Kartparadigm/Giftcard/Model/Quote/Total.php~ +0 -71
  23. app/code/community/Kartparadigm/Giftcard/Model/Resource/Setup.php~ +0 -5
  24. app/code/community/Kartparadigm/Giftcard/controllers/Adminhtml/GiftcardController.php +90 -10
  25. app/code/community/Kartparadigm/Giftcard/controllers/Adminhtml/TemplateController.php +3 -3
  26. app/code/community/Kartparadigm/Giftcard/etc/adminhtml.xml +1 -1
  27. app/code/community/Kartparadigm/Giftcard/etc/adminhtml.xml~ +0 -72
  28. app/code/community/Kartparadigm/Giftcard/etc/config.xml~ +0 -245
  29. app/code/community/Kartparadigm/Giftcard/etc/system.xml +6 -6
  30. app/code/community/Kartparadigm/Giftcard/etc/system.xml~ +0 -181
  31. app/code/community/Kartparadigm/Theme/Block/Adminhtml/System/Config/Form/Field/Font.php +0 -69
  32. app/code/community/Kartparadigm/Theme/Helper/Data.php +0 -6
  33. app/code/community/Kartparadigm/Theme/Model/Config/Font.php +0 -28
  34. app/code/community/Kartparadigm/Theme/Model/Config/Header.php +0 -27
  35. app/code/community/Kartparadigm/Theme/etc/config.xml +0 -78
  36. app/code/community/Kartparadigm/Theme/etc/system.xml +0 -358
  37. app/code/community/Kartparadigm/Theme/sql/theme_setup/mysql4-install-0.1.0.php +0 -149
  38. app/design/adminhtml/{default → base}/default/template/kartparadigm/giftcard/view.phtml +60 -38
  39. app/design/adminhtml/default/default/template/kartparadigm/giftcard/view.phtml~ +0 -115
  40. app/design/adminhtml/default/kartparadigm/template/catalog/form/renderer/fieldset/element.phtml +1 -1
  41. app/design/adminhtml/default/kartparadigm/template/catalog/form/renderer/fieldset/element.phtml~ +1 -1
  42. app/design/frontend/base/default/layout/kartparadigm/giftcard.xml +0 -1
  43. app/design/frontend/base/default/template/kartparadigm/giftcard/product/media.phtml +48 -35
  44. app/design/frontend/base/default/template/kartparadigm/giftcard/product/media.phtml~ +245 -0
  45. app/design/frontend/base/default/template/kartparadigm/giftcard/product/type.phtml +4 -1
  46. app/locale/en_US/template/email/giftcard/custom_email_template1.html +4 -4
  47. media/giftcard/clos.png +0 -0
  48. media/giftcard/greet.jpg +0 -0
  49. package.xml +4 -4
  50. skin/frontend/base/default/js/giftcard/blurbox.js +1 -1
  51. skin/frontend/base/default/js/giftcard/blurbox1.js +306 -0
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend.php CHANGED
@@ -4,7 +4,7 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Groupsend extends Mage_Adminhtml_Blo
4
  public function __construct(){
5
  $this->_controller = 'adminhtml_groupsend';
6
  $this->_blockGroup = 'kartparadigm_giftcard';
7
- $this->_headerText = Mage::helper('kartparadigm_giftcard')->__('Giftcard Sending To Group');
8
  $this->_addButtonLabel = Mage::helper('kartparadigm_giftcard')->__('Add New Giftcard');
9
  parent::__construct();
10
  $this->_removeButton('add');//to remove add new button
4
  public function __construct(){
5
  $this->_controller = 'adminhtml_groupsend';
6
  $this->_blockGroup = 'kartparadigm_giftcard';
7
+ $this->_headerText = Mage::helper('kartparadigm_giftcard')->__('Send Giftcard');
8
  $this->_addButtonLabel = Mage::helper('kartparadigm_giftcard')->__('Add New Giftcard');
9
  parent::__construct();
10
  $this->_removeButton('add');//to remove add new button
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit.php CHANGED
@@ -9,7 +9,7 @@ $this->_controller = 'adminhtml_groupsend';
9
  $this->_blockGroup = 'kartparadigm_giftcard';
10
 
11
  $this->_mode = 'edit';
12
- $this->_updateButton('save', 'label', Mage::helper('kartparadigm_giftcard')->__('Send Giftcard To Group'));
13
  $this->_updateButton('delete', 'label', Mage::helper('kartparadigm_giftcard')->__('Delete Giftcard'));
14
 
15
 
@@ -18,7 +18,7 @@ $this->_updateButton('delete', 'label', Mage::helper('kartparadigm_giftcard')->_
18
  {
19
  if(Mage::registry('registry_data') && Mage::registry('registry_data')->getId())
20
  return Mage::helper('kartparadigm_giftcard')->__("Edit Giftcard '%s'", $this->htmlEscape(Mage::registry('registry_data')->getGiftcardName()));
21
- return Mage::helper('kartparadigm_giftcard')->__('Send Giftcard To Group');
22
  }
23
  }
24
 
9
  $this->_blockGroup = 'kartparadigm_giftcard';
10
 
11
  $this->_mode = 'edit';
12
+ $this->_updateButton('save', 'label', Mage::helper('kartparadigm_giftcard')->__('Send Giftcard'));
13
  $this->_updateButton('delete', 'label', Mage::helper('kartparadigm_giftcard')->__('Delete Giftcard'));
14
 
15
 
18
  {
19
  if(Mage::registry('registry_data') && Mage::registry('registry_data')->getId())
20
  return Mage::helper('kartparadigm_giftcard')->__("Edit Giftcard '%s'", $this->htmlEscape(Mage::registry('registry_data')->getGiftcardName()));
21
+ return Mage::helper('kartparadigm_giftcard')->__('Send Giftcard');
22
  }
23
  }
24
 
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Form.php CHANGED
@@ -30,12 +30,30 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Groupsend_Edit_Form extends Mage_Adm
30
  'name' => 'giftcard_name',
31
  ));
32
  $fieldset->addField('giftcard_val', 'text', array(
33
- 'label' => Mage::helper('kartparadigm_giftcard')->__('Giftcard Amount') ,
34
  'class' => 'required-entry',
35
  'required' => true,
36
  'name' => 'giftcard_val',
37
  ));
38
- $customerGroupModel = new Mage_Customer_Model_Group();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  $customerGroups = array();
40
  $allCustomerGroups = $customerGroupModel->getCollection()->addFieldToFilter('customer_group_id', array(
41
  'nin' => array(
@@ -47,9 +65,53 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Groupsend_Edit_Form extends Mage_Adm
47
  'label' => Mage::helper('kartparadigm_giftcard')->__('Customer Group') ,
48
  'class' => 'required-entry',
49
  'required' => true,
 
50
  'options' => $allCustomerGroups,
 
51
  ));
52
- $fieldset->addField('giftcard_status', 'select', array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  'name' => 'giftcard_status',
54
  'label' => Mage::helper('kartparadigm_giftcard')->__('Giftcard Status') ,
55
  'class' => 'required-entry',
@@ -59,14 +121,7 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Groupsend_Edit_Form extends Mage_Adm
59
  1 => Mage::helper('kartparadigm_giftcard')->__('Active') ,
60
  ) ,
61
  ));
62
- $fieldset->addField('store_id', 'select', array( //can use multiselect
63
- 'name' => 'store_id[]',
64
- 'label' => Mage::helper('cms')->__('Store View') ,
65
- 'title' => Mage::helper('cms')->__('Store View') ,
66
- 'required' => true,
67
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true) ,
68
- ));
69
- $fieldset->addField('giftcard_currency', 'select', array(
70
  'name' => 'giftcard_currency',
71
  'label' => Mage::helper('kartparadigm_giftcard')->__('Currency') ,
72
  'class' => 'required-entry',
@@ -74,15 +129,13 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Groupsend_Edit_Form extends Mage_Adm
74
  'values' => Mage::getSingleton('adminhtml/system_config_source_currency')->toOptionArray(false) ,
75
  'value' => Mage::app()->getStore()->getDefaultCurrency()->getCurrencyCode() ,
76
  ));
77
- // date field
78
- $fieldset->addField('giftcard_msg', 'textarea', array(
79
- 'label'=> Mage::helper('kartparadigm_giftcard')->__('Giftcard Message'),
80
- 'class'=> 'required-entry',
81
- 'required' => true,
82
- 'name'=> 'giftcard_msg',
83
- ));
84
-
85
-
86
  $arr = array(
87
  'name' => 'expiry_date',
88
  'label' => Mage::helper('kartparadigm_giftcard')->__('Expiry Date') ,
30
  'name' => 'giftcard_name',
31
  ));
32
  $fieldset->addField('giftcard_val', 'text', array(
33
+ 'label' => Mage::helper('kartparadigm_giftcard')->__('Giftcard Value') ,
34
  'class' => 'required-entry',
35
  'required' => true,
36
  'name' => 'giftcard_val',
37
  ));
38
+
39
+
40
+ $fieldset->addField('send_check', 'checkbox', array(
41
+ 'label' => Mage::helper('kartparadigm_giftcard')->__('Send To Group'),
42
+ 'name' => 'send_check',
43
+ 'onclick' => "",
44
+ 'onchange' => "if(document.getElementById('send_check').checked){
45
+ document.getElementById('receiver_name').setAttribute('disabled', true);
46
+ document.getElementById('receiver_mail').setAttribute('disabled', true);
47
+ document.getElementById('customer_groups').removeAttribute('disabled');
48
+ }else{
49
+ document.getElementById('receiver_name').removeAttribute('disabled');
50
+ document.getElementById('receiver_mail').removeAttribute('disabled');
51
+ document.getElementById('customer_groups').setAttribute('disabled', true);
52
+
53
+ }",
54
+ 'disabled' => false,
55
+ ));
56
+ $customerGroupModel = new Mage_Customer_Model_Group();
57
  $customerGroups = array();
58
  $allCustomerGroups = $customerGroupModel->getCollection()->addFieldToFilter('customer_group_id', array(
59
  'nin' => array(
65
  'label' => Mage::helper('kartparadigm_giftcard')->__('Customer Group') ,
66
  'class' => 'required-entry',
67
  'required' => true,
68
+ 'disabled' => true,
69
  'options' => $allCustomerGroups,
70
+ 'after_element_html' => '<br/><center>(or)</center>',
71
  ));
72
+
73
+ $fieldset->addField('par', 'checkbox', array(
74
+ 'label' => Mage::helper('kartparadigm_giftcard')->__('Send To A Customer'),
75
+ 'name' => 'par',
76
+ 'style' => "display:none;",
77
+ ));
78
+
79
+ $fieldset->addField('receiver_name', 'text', array(
80
+ 'label'=> Mage::helper('kartparadigm_giftcard')->__('Receiver Name'),
81
+ 'class'=> 'required-entry',
82
+ 'required' => true,
83
+ 'name'=> 'receiver_name',
84
+ 'disabled' => false,
85
+
86
+
87
+ ));
88
+ $fieldset->addField('receiver_mail', 'text', array(
89
+ 'label'=> Mage::helper('kartparadigm_giftcard')->__('Receiver Email'),
90
+ 'class'=> 'required-entry',
91
+ 'required' => true,
92
+ 'name'=> 'receiver_mail',
93
+ 'disabled' => false,
94
+ ));
95
+
96
+
97
+ $fieldset->addField('giftcard_msg', 'textarea', array(
98
+ 'label'=> Mage::helper('kartparadigm_giftcard')->__('Giftcard Message'),
99
+ 'class'=> 'required-entry',
100
+ 'required' => true,
101
+ 'name'=> 'giftcard_msg',
102
+ 'style'=>"height: 6em;",
103
+ ));
104
+
105
+ $finderLink1 = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'giftcard/preview.png';
106
+
107
+ $fieldset->addField('imagelab', 'label', array(
108
+ 'label' => Mage::helper('kartparadigm_giftcard')->__('Giftcard Template') ,
109
+ 'name' => 'image',
110
+ 'value' => $finderLink1,
111
+ 'required' => true,
112
+ 'after_element_html' => '<img src="' . $finderLink1 . '" alt="Template" height="200" width="280" />',
113
+ ));
114
+ $fieldset->addField('giftcard_status', 'select', array(
115
  'name' => 'giftcard_status',
116
  'label' => Mage::helper('kartparadigm_giftcard')->__('Giftcard Status') ,
117
  'class' => 'required-entry',
121
  1 => Mage::helper('kartparadigm_giftcard')->__('Active') ,
122
  ) ,
123
  ));
124
+ $fieldset->addField('giftcard_currency', 'select', array(
 
 
 
 
 
 
 
125
  'name' => 'giftcard_currency',
126
  'label' => Mage::helper('kartparadigm_giftcard')->__('Currency') ,
127
  'class' => 'required-entry',
129
  'values' => Mage::getSingleton('adminhtml/system_config_source_currency')->toOptionArray(false) ,
130
  'value' => Mage::app()->getStore()->getDefaultCurrency()->getCurrencyCode() ,
131
  ));
132
+ $fieldset->addField('store_id', 'select', array( //can use multiselect
133
+ 'name' => 'store_id[]',
134
+ 'label' => Mage::helper('cms')->__('Store View') ,
135
+ 'title' => Mage::helper('cms')->__('Store View') ,
136
+ 'required' => true,
137
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true) ,
138
+ ));
 
 
139
  $arr = array(
140
  'name' => 'expiry_date',
141
  'label' => Mage::helper('kartparadigm_giftcard')->__('Expiry Date') ,
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Form.php~ DELETED
@@ -1,101 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Block_Adminhtml_Groupsend_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
-
4
- {
5
- protected function _prepareForm()
6
- {
7
- Mage::log('Prepare Form');
8
- $form = new Varien_Data_Form(array(
9
- 'id' => 'edit_form',
10
- 'action' => $this->getUrl('*/*/send', array(
11
- 'id' => $this->getRequest()->getParam('id')
12
- )) ,
13
- 'method' => 'post',
14
- 'enctype' => 'multipart/form-data'
15
- ));
16
- $form->setUseContainer(true);
17
- $this->setForm($form);
18
- if (Mage::getSingleton('adminhtml/session')->getFormData()) {
19
- $data = Mage::getSingleton('adminhtml/session')->getFormData();
20
- Mage::getSingleton('adminhtml/session')->setFormData(null);
21
- }
22
- elseif (Mage::registry('registry_data')) $data = Mage::registry('registry_data')->getData();
23
- $fieldset = $form->addFieldset('registry_form', array(
24
- 'legend' => Mage::helper('tele_giftcard')->__('Gift Card information')
25
- ));
26
- $fieldset->addField('giftcard_name', 'text', array(
27
- 'label' => Mage::helper('tele_giftcard')->__('Giftcard Name') ,
28
- 'class' => 'required-entry',
29
- 'required' => true,
30
- 'name' => 'giftcard_name',
31
- ));
32
- $fieldset->addField('giftcard_val', 'text', array(
33
- 'label' => Mage::helper('tele_giftcard')->__('Giftcard Amount') ,
34
- 'class' => 'required-entry',
35
- 'required' => true,
36
- 'name' => 'giftcard_val',
37
- ));
38
- $customerGroupModel = new Mage_Customer_Model_Group();
39
- $customerGroups = array();
40
- $allCustomerGroups = $customerGroupModel->getCollection()->addFieldToFilter('customer_group_id', array(
41
- 'nin' => array(
42
- 0
43
- )
44
- ))->toOptionHash();
45
- $fieldset->addField('customer_groups', 'select', array(
46
- 'name' => 'customer_groups',
47
- 'label' => Mage::helper('tele_giftcard')->__('Customer Group') ,
48
- 'class' => 'required-entry',
49
- 'required' => true,
50
- 'options' => $allCustomerGroups,
51
- ));
52
- $fieldset->addField('giftcard_status', 'select', array(
53
- 'name' => 'giftcard_status',
54
- 'label' => Mage::helper('tele_giftcard')->__('Giftcard Status') ,
55
- 'class' => 'required-entry',
56
- 'required' => true,
57
- 'options' => array(
58
- 0 => Mage::helper('tele_giftcard')->__('Inactive') ,
59
- 1 => Mage::helper('tele_giftcard')->__('Active') ,
60
- ) ,
61
- ));
62
- $fieldset->addField('store_id', 'select', array( //can use multiselect
63
- 'name' => 'store_id[]',
64
- 'label' => Mage::helper('cms')->__('Store View') ,
65
- 'title' => Mage::helper('cms')->__('Store View') ,
66
- 'required' => true,
67
- 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true) ,
68
- ));
69
- $fieldset->addField('giftcard_currency', 'select', array(
70
- 'name' => 'giftcard_currency',
71
- 'label' => Mage::helper('tele_giftcard')->__('Currency') ,
72
- 'class' => 'required-entry',
73
- 'required' => true,
74
- 'values' => Mage::getSingleton('adminhtml/system_config_source_currency')->toOptionArray(false) ,
75
- 'value' => Mage::app()->getStore()->getDefaultCurrency()->getCurrencyCode() ,
76
- ));
77
- // date field
78
- $fieldset->addField('giftcard_msg', 'textarea', array(
79
- 'label'=> Mage::helper('tele_giftcard')->__('Giftcard Message'),
80
- 'class'=> 'required-entry',
81
- 'required' => true,
82
- 'name'=> 'giftcard_msg',
83
- ));
84
-
85
-
86
- $arr = array(
87
- 'name' => 'expiry_date',
88
- 'label' => Mage::helper('tele_giftcard')->__('Expiry Date') ,
89
- 'required' => true,
90
- 'image' => $this->getSkinUrl('images/grid-cal.gif') ,
91
- 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) ,
92
- );
93
- if (version_compare(Mage::getVersion() , '1.1.8', '>=')) {
94
- $arr['input_format'] = Varien_Date::DATE_INTERNAL_FORMAT;
95
- }
96
- $expireAt = $fieldset->addField('expiry_date', 'date', $arr);
97
- $form->setValues($data);
98
- return parent::_prepareForm();
99
- }
100
- }
101
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Groupsend/Edit/Tabs.php~ DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- class Solvingmagento_AffiliateProduct_Block_Adminhtml_Registries_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('giftregistries_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('solvingmagento_affiliateproduct')->__('Manage Gift Cards'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('solvingmagento_affiliateproduct')->__('Gift Certificate Information'),
18
- 'title' => Mage::helper('solvingmagento_affiliateproduct')->__('Gift Certificate Information'),
19
- 'content' => $this->getLayout()->createBlock('solvingmagento_affiliateproduct/adminhtml_registries_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- if ($id = Mage::app()->getRequest()->getParam('id')) {
23
- $this->addTab('history', array(
24
- 'label' => Mage::helper('solvingmagento_affiliateproduct')->__('Transaction History'),
25
- 'title' => Mage::helper('solvingmagento_affiliateproduct')->__('Transaction History'),
26
- 'content' => $this->getLayout()->createBlock('solvingmagento_affiliateproduct/adminhtml_registries_edit_tab_history')
27
- ->setCertId($id)
28
- ->toHtml(),
29
- ));
30
- }
31
-
32
- return parent::_beforeToHtml();
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Registries.php CHANGED
@@ -7,7 +7,7 @@ $this->_blockGroup = 'kartparadigm_giftcard';
7
  $this->_headerText = Mage::helper('kartparadigm_giftcard')->__('Gift Card Manager');
8
  $this->_addButtonLabel = Mage::helper('kartparadigm_giftcard')->__('Add New Giftcard');
9
  parent::__construct();
10
- //$this->_removeButton('add');//to remove add new button
11
  }
12
  }
13
  ?>
7
  $this->_headerText = Mage::helper('kartparadigm_giftcard')->__('Gift Card Manager');
8
  $this->_addButtonLabel = Mage::helper('kartparadigm_giftcard')->__('Add New Giftcard');
9
  parent::__construct();
10
+ $this->_removeButton('add');//to remove add new button
11
  }
12
  }
13
  ?>
app/code/community/Kartparadigm/Giftcard/Block/Adminhtml/Templates/Edit/Form.php CHANGED
@@ -104,6 +104,8 @@ class Kartparadigm_Giftcard_Block_Adminhtml_Templates_Edit_Form extends Mage_Adm
104
  'class' => 'required-entry',
105
  'required' => true,
106
  'name' => 'giftcard_note',
 
 
107
  ));
108
  /* $fieldset->addField('template_status', 'select', array(
109
  'name' => 'template_status',
104
  'class' => 'required-entry',
105
  'required' => true,
106
  'name' => 'giftcard_note',
107
+ 'value' => 'Please note that: Converting to cash is not allowed. You can use the Gift card code to pay for your order',
108
+ 'style'=>"height: 6em;",
109
  ));
110
  /* $fieldset->addField('template_status', 'select', array(
111
  'name' => 'template_status',
app/code/community/Kartparadigm/Giftcard/Helper/Data.php~ DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- class Kartparadigm_Giftcard_Helper_Data extends Mage_Core_Helper_Abstract
3
- {
4
-
5
- public function getStatusarray(){
6
- $arr=array();
7
- $arr[0]="Inactive";
8
- $arr[1]="Active";
9
- $arr[2]="Processing";
10
- $arr[3]="Redeemed";
11
- $arr[4]="Expired";
12
- $arr[5]="Cancelled";
13
- return $arr;
14
- }
15
- public function getCodeMasked($cc=0)
16
- {
17
- // Get the cc Length
18
- $cc_length = strlen($cc);
19
- $i=0;
20
- // Replace all characters of credit card except the last four and dashes
21
- for($i=$cc_length; $i>9; $i--){
22
- if((isset($cc[$i])) && ($cc[$i] == '-')){continue;}
23
- $cc[$i] = 'X';
24
- }
25
- // Return the masked Credit Card #
26
- return $cc;
27
- }
28
-
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Helper/Payment.php~ DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- class Kartparadigm_Giftcard_Helper_Payment extends Mage_Payment_Helper_Data
4
- {
5
-
6
- public function getStoreMethods($store=null, $quote=null)
7
- {
8
-
9
- $fullyPaidByGiftcard = (($quote->getGrandTotal()==$quote->getGiftcardBalused())&&($quote->getGiftcardCode()!=''));
10
-
11
-
12
- if ($fullyPaidByGiftcard) {
13
- return array(Mage::getModel(Mage::getStoreConfig(self::XML_PATH_PAYMENT_METHODS.'/kartparadigm_giftcard/model', $store)));
14
- }
15
- return parent::getStoreMethods($store, $quote);
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcard.php~ DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcard extends
3
- Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcard', 'giftcard_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcard/Collection.php~ DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcard_Collection extends
3
- Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcard');
8
- parent::_construct();
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtemplate.php~ DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcardtemplate extends
3
- Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcardtemplate', 'giftcardtemplate_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtemplate/Collection.php~ DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcardtemplate_Collection extends
3
- Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcardtemplate');
8
- parent::_construct();
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtrans.php~ DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcardtrans extends
3
- Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcardtrans', 'giftcardtrans_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Giftcardtrans/Collection.php~ DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Giftcardtrans_Collection extends
3
- Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/giftcardtrans');
8
- parent::_construct();
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Template.php~ DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Template extends
3
- Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/template', 'template_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Mysql4/Templates.php~ DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Tele_Giftcard_Model_Mysql4_Template extends
3
- Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- $this->_init('tele_giftcard/template', 'template_id');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Observer.php CHANGED
@@ -302,15 +302,15 @@ class Kartparadigm_Giftcard_Model_Observer
302
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
303
  $imgpath="";
304
  if (strpos($mediapath, 'localhost') !== false) {
305
- $row['theme_color'] = "FF0000";
306
- $row['text_color'] = "00AA00";
307
  $imgpath = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
308
  }
309
  else if ($row['template_img'] != '')
310
  $imgpath = $mediapath . $row['template_img'];
311
  else {
312
- $row['theme_color'] = "FF0000";
313
- $row['text_color'] = "00AA00";
314
  $product = Mage::getModel('catalog/product')->load($col['gcpro_id']);
315
  try{
316
  $full_path_url = Mage::helper('catalog/image')->init($product, 'thumbnail');
302
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
303
  $imgpath="";
304
  if (strpos($mediapath, 'localhost') !== false) {
305
+ $row['theme_color'] = "32943F";
306
+ $row['text_color'] = "BF0D0D";
307
  $imgpath = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
308
  }
309
  else if ($row['template_img'] != '')
310
  $imgpath = $mediapath . $row['template_img'];
311
  else {
312
+ $row['theme_color'] = "32943F";
313
+ $row['text_color'] = "BF0D0D";
314
  $product = Mage::getModel('catalog/product')->load($col['gcpro_id']);
315
  try{
316
  $full_path_url = Mage::helper('catalog/image')->init($product, 'thumbnail');
app/code/community/Kartparadigm/Giftcard/Model/Observer.php~ DELETED
@@ -1,601 +0,0 @@
1
- <?php
2
- class Kartparadigm_Giftcard_Model_Observer
3
-
4
- {
5
- // ------------------------------ Adding Custom Price To Cart --------------------------------------
6
- public function changingPrice(Varien_Event_Observer $observer)
7
-
8
- {
9
- $event = $observer->getEvent();
10
- $quote_item = $event->getQuoteItem();
11
- if ($quote_item->getProduct()->getTypeId() === 'giftcard') {
12
- $new_price = Mage::app()->getRequest()->getPost('customp');
13
- $data = Mage::app()->getRequest()->getPost();
14
- if (!is_null($new_price)) {
15
- $quote_item->setCustomPrice($new_price);
16
- $quote_item->setOriginalCustomPrice($new_price);
17
- $quote_item->getProduct()->setIsSuperMode(true);
18
- }
19
- else if (($quote_item->getProduct()->getPrice() != $quote_item->getProduct()->getGiftcardValue()) && ($quote_item->getProduct()->getGiftcardValue() != 0)) {
20
- $quote_item->setCustomPrice($quote_item->getProduct()->getGiftcardValue());
21
- $quote_item->setOriginalCustomPrice($quote_item->getProduct()->getPrice());
22
- $quote_item->getProduct()->setIsSuperMode(true);
23
- }
24
- }
25
- }
26
- // ------------------------------ load product after --------------------------------------
27
- public function catalogProductLoadAfter(Varien_Event_Observer $observer)
28
-
29
- {
30
- // set the additional options on the product
31
- $action = Mage::app()->getFrontController()->getAction();
32
- if ($action->getFullActionName() == 'checkout_cart_add') {
33
- // posting our custom form values in an array called extra_options
34
- if ($options = $action->getRequest()->getParams()) {
35
- $product = $observer->getProduct();
36
- // add to the additional options array
37
- $additionalOptions = array();
38
- if ($additionalOption = $product->getCustomOption('additional_options')) {
39
- $additionalOptions = (array)unserialize($additionalOption->getValue());
40
- }
41
- foreach($options as $key => $value) {
42
- if (($key == 'DeliveryDate' || $key == 'Template' || $key == 'SenderName' || $key == 'ReciptentName' || $key == 'RecipientEmail' || $key == 'Address' || $key == 'CustomMessage') && ($value != '')) {
43
- /*if($key == 'Template')
44
- {
45
- continue;
46
- }*/
47
- $additionalOptions[] = array(
48
- 'label' => $key,
49
- 'value' => $value,
50
- );
51
- }
52
- }
53
- $observer->getProduct()->addCustomOption('additional_options', serialize($additionalOptions));
54
- }
55
- }
56
- }
57
- // ------------------------ Persisting Custom Options in order and invoice--------------------------
58
- public function salesConvertQuoteItemToOrderItem(Varien_Event_Observer $observer)
59
-
60
- {
61
- $quoteItem = $observer->getItem();
62
- $codelengh = Mage::getStoreConfig('giftcard/giftcard/txt_clength', Mage::app()->getStore()->getStoreId());
63
- $dashafter = Mage::getStoreConfig('giftcard/giftcard/txt_dashafter', Mage::app()->getStore()->getStoreId());
64
- // ---------------------------Generating Giftcard Codes and updating in database-------------------------
65
- if ($quoteItem->getProduct()->getTypeId() === 'giftcard') {
66
- $itemcount = $quoteItem->getQty();
67
- $codes = '';
68
- for ($i = 0; $i < $itemcount; $i++) {
69
- $code = Mage::getModel('kartparadigm_giftcard/custommethods')->generateUniqueId($codelengh);
70
- $code = join('-', str_split($code, $dashafter)); // adding hypen after every 4 letters
71
- if ($i == 0) $codes = $code;
72
- else $codes = $codes . ',' . $code;
73
- }
74
- $orderItem = $observer->getOrderItem();
75
- if ($additionalOptions = $quoteItem->getOptionByCode('additional_options')) {
76
- $quoteitemid = $quoteItem->getItemId();
77
- $options = $orderItem->getProductOptions();
78
- $options['additional_options'] = unserialize($additionalOptions->getValue());
79
- $options['additional_options'][] = array(
80
- 'label' => 'Giftcard Code(s)',
81
- 'value' => $codes,
82
- );
83
- $orderItem->setProductOptions($options);
84
- }
85
- else {
86
- $options['additional_options'][] = array(
87
- 'label' => 'Giftcard Code(s)',
88
- 'value' => $codes,
89
- );
90
- $orderItem->setProductOptions($options);
91
- }
92
- Mage::register($quoteitemid, $codes);
93
- }
94
- }
95
- // ----------------------- applying giftcard redeem amount to cartitems subtotal -----------------------
96
- public function collectTotals(Varien_Event_Observer $observer)
97
-
98
- {
99
- $quote = $observer->getEvent()->getQuote();
100
- $quoteid = $quote->getId();
101
- $damt = $quote->getGiftcardBalused();
102
- $damtarr = explode(",", $damt);
103
- $disamt = array_sum(explode(",", $damt));
104
- $gbal = $quote->getGiftcardBal();
105
- $gbalarr = explode(",", $gbal);
106
- $gcbal = array_sum(explode(",", $gbal));
107
- $gccode = $quote->getGiftcardCode();
108
- $discountAmount = $gcbal;
109
- $disamt = end($damtarr);
110
- $gcbal = end($gbalarr);
111
-
112
- if (Mage::getStoreConfig('giftcard/giftcard/suborgrand_select', Mage::app()->getStore()->getStoreId())) {
113
- $total = $quote->getGrandTotal(); //apply gc to grandtotal
114
- if($quote->getShippingAddress()->getShippingAmount()>0){
115
- if(($gcbal-$disamt)!=0)
116
- $disamt= $gcbal;
117
- }
118
- }
119
- else $total = $quote->getSubtotal(); //apply gc to subtotal
120
-
121
- array_pop($damtarr);
122
- $damt1 = implode(",", $damtarr);
123
- array_pop($gbalarr);
124
- $gbal1 = implode(",", $gbalarr);
125
- $total = $total - array_sum($damtarr);
126
- if (isset($gcbal)) {
127
- $gcnewbal = 0;
128
- if ($total > $disamt) {
129
- $discountAmount = $disamt;
130
- $gcnewbal = $gcbal - $disamt;
131
- }
132
- else {
133
- $discountAmount = $total;
134
- $gcnewbal = $gcbal - $total;
135
- }
136
- if ($damt1 != '') {
137
- $damt = $damt1 . "," . $discountAmount;
138
- $gbal = $gbal1 . "," . $gcnewbal;
139
- }
140
- else {
141
- $damt = $discountAmount;
142
- $gbal = $gcnewbal;
143
- }
144
-
145
- $quote->setGiftcardBalused($damt);
146
- $discountAmount = array_sum(explode(",", $damt));
147
- }
148
- if ($quoteid && $discountAmount > 0) {
149
- if ($discountAmount > 0) {
150
- $total = $quote->getBaseSubtotal();
151
- $quote->setSubtotal(0);
152
- $quote->setBaseSubtotal(0);
153
- $quote->setSubtotalWithDiscount(0);
154
- $quote->setBaseSubtotalWithDiscount(0);
155
- $quote->setGrandTotal(0);
156
- $quote->setBaseGrandTotal(0);
157
- $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');
158
- foreach($quote->getAllAddresses() as $address) {
159
- $address->setSubtotal(0);
160
- $address->setBaseSubtotal(0);
161
- $address->setGrandTotal(0);
162
- $address->setBaseGrandTotal(0);
163
- $address->collectTotals();
164
- $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());
165
- $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());
166
- $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());
167
- $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());
168
- $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());
169
- $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());
170
- $quote->save();
171
- $quote->setSubtotalWithDiscount($quote->getBaseSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $discountAmount)->save();
172
- if ($address->getAddressType() == $canAddItems) {
173
- $address->setSubtotalWithDiscount((float)$address->getSubtotalWithDiscount() - $discountAmount);
174
- $address->setGrandTotal((float)$address->getGrandTotal() - $discountAmount);
175
- $address->setBaseSubtotalWithDiscount((float)$address->getBaseSubtotalWithDiscount() - $discountAmount);
176
- $address->setBaseGrandTotal((float)$address->getBaseGrandTotal() - $discountAmount);
177
- if ($address->getDiscountDescription()) {
178
- $address->setDiscountAmount(-($address->getDiscountAmount() - $discountAmount));
179
- $address->setDiscountDescription($address->getDiscountDescription() . ', Giftcard Discount');
180
- $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount() - $discountAmount));
181
- }
182
- else {
183
- $address->setDiscountAmount(-($discountAmount));
184
- $address->setDiscountDescription('Giftcard ' . $gccode);
185
- $address->setBaseDiscountAmount(-($discountAmount));
186
- }
187
- $address->save();
188
- }
189
- }
190
- foreach($quote->getAllItems() as $item) {
191
- // We apply discount amount based on the ratio between the GrandTotal and the RowTotal
192
- $rat = $item->getPriceInclTax() / $total;
193
- $ratdisc = $discountAmount * $rat;
194
- $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());
195
- $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc) * $item->getQty())->save();
196
- }
197
- }
198
- }
199
- }
200
- // -------------------------- Changing giftcard status at invoice generation----------------------------
201
- // --------------------------- sales_order_invoice_save_after --------------------------------------------
202
- public function changingStatus(Varien_Event_Observer $observer)
203
-
204
- {
205
- $invoice = $observer->getEvent()->getInvoice();
206
- $order = $invoice->getOrder();
207
- $orderid = $order->getIncrementId();
208
- $ordered_items = $order->getAllItems();
209
- $disamt = $order->getDiscountAmount();
210
- $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
211
- $date = $date->toString('Y-M-d H:m:s');
212
- // ---------------changing giftcard status while redeeming giftcard in order placement------------------
213
- if (-($disamt) > 0) {
214
- $collec = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->getCollection()->addFieldToFilter('order_id', $order->getIncrementId());
215
- foreach($collec as $coll) {
216
- if ($coll != null) {
217
- $balused = $coll->getGiftcardBalused();
218
- $gcbal = $coll->getGiftcardBal();
219
- if ($gcbal > 0) {
220
- $status = 1;
221
- $message = 'Admin Processed Invoice and giftcard reactivated';
222
- }
223
- else {
224
- $status = 3;
225
- $message = 'Admin Processed Invoice and giftcard expired';
226
- }
227
- $transdata = array(
228
- 'giftcard_val' => $coll->getGiftcardVal() ,
229
- 'giftcard_id' => $coll->getGiftcardId() ,
230
- 'order_id' => $orderid,
231
- 'giftcard_bal' => $gcbal,
232
- 'giftcard_balused' => 0,
233
- 'giftcard_currency' => $coll->getGiftcardCurrency() ,
234
- 'giftcard_code' => $coll->getGiftcardCode() ,
235
- 'customer_name' => $coll->getCustomerName() ,
236
- 'customer_mail' => $coll->getCustomerMail() ,
237
- 'giftcard_name' => $coll->getGiftcardName() ,
238
- 'created_date' => $coll->getCreatedDate() ,
239
- 'expiry_date' => $coll->getExpiryDate() ,
240
- 'transac_date' => $date,
241
- 'giftcard_status' => $status,
242
- 'comment' => $message
243
- );
244
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
245
- try {
246
- $insertId = $trasmodel->save();
247
- }
248
- catch(Exception $e) {
249
- }
250
- $gc = Mage::getModel('kartparadigm_giftcard/giftcard')->load($coll->getGiftcardCode() , 'giftcard_code');
251
- $gcid = Mage::getModel('kartparadigm_giftcard/giftcard')->load($gc->getGiftcardId());
252
-
253
- $gcid->setGiftcardStatus($status);
254
- $gcid->save();
255
- }
256
- }
257
- }
258
- // --------------------------- activating giftcards present in order-------------------------------
259
- foreach($ordered_items as $item) { //order item detail
260
- if ($item->getProduct()->getTypeId() === 'giftcard') {
261
- $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
262
- $coll = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('gcpro_id', $item->getProduct()->getId())->addFieldToFilter('order_id', $orderid);
263
- $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
264
- $date = $date->toString('Y-M-d H:m:s');
265
- foreach($coll as $col) {
266
- $transdata = array(
267
- 'giftcard_val' => $col['giftcard_val'],
268
- 'giftcard_id' => $col['giftcard_id'],
269
- 'order_id' => $col['order_id'],
270
- 'giftcard_bal' => $col['giftcard_bal'],
271
- 'giftcard_balused' => 0,
272
- 'giftcard_currency' => $col['giftcard_currency'],
273
- 'giftcard_code' => $col['giftcard_code'],
274
- 'customer_name' => $col['receiver_name'],
275
- 'customer_mail' => $col['receiver_mail'],
276
- 'giftcard_name' => $col['giftcard_name'],
277
- 'created_date' => $col['created_date'],
278
- 'expiry_date' => $col['expiry_date'],
279
- 'transac_date' => $date,
280
- 'giftcard_status' => 1, //active
281
- 'comment' => 'Generated Invoice And Giftcard Activated'
282
- );
283
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
284
- $insertId = $trasmodel->save();
285
- if (Mage::getModel('catalog/product')->load($col['gcpro_id'])->getAttributeText('giftcard_type') != 'Physical Giftcard') {
286
- // Sending Giftcard Activated Mail to Customer
287
- $not = 0;
288
- $today = date('Y-m-d');
289
- $not = 1;
290
- $templateid = Mage::getStoreConfig('giftcard/giftcard/custom_email_template1', Mage::app()->getStore()->getStoreId());
291
- $emailTemplate = Mage::getModel('core/email_template');
292
- if (!is_numeric($templateid)) {
293
- $emailTemplate->loadDefault('custom_email_template1');
294
- $emailTemplate->setTemplateSubject("Giftcard Receiverd From " . $col['customer_name']);
295
- }
296
- else {
297
- $emailTemplate->load($templateid);
298
- }
299
- $type = Mage::getStoreConfig('giftcard/giftcard/giftcard_sender_email', Mage::app()->getStore()->getStoreId());
300
- // Create an array of variables to assign to template
301
- $row = Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name', $col['template_name'])->getFirstItem();
302
- $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
303
- $imgpath="";
304
- if (strpos($mediapath, 'localhost') !== false) {
305
- $row['theme_color'] = "FF0000";
306
- $row['text_color'] = "00AA00";
307
- $imgpath = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
308
- }
309
- else if ($row['template_img'] != '')
310
- $imgpath = $mediapath . $row['template_img'];
311
- else {
312
- $row['theme_color'] = "FF0000";
313
- $row['text_color'] = "00AA00";
314
- $product = Mage::getModel('catalog/product')->load($col['gcpro_id']);
315
- try{
316
- $full_path_url = Mage::helper('catalog/image')->init($product, 'thumbnail');
317
- }
318
- catch(Exception $e) {
319
- $full_path_url = $mediapath."giftcard/greet.jpg";
320
- }
321
- $imgpath = $full_path_url;
322
- }
323
- $emailTemplateVariables['customername'] = $col['customer_name'];
324
- $emailTemplateVariables['giftcardname'] = $col['giftcard_name'];
325
- $emailTemplateVariables['giftcardval'] = Mage::helper('core')->currency($col['giftcard_val']);
326
- $emailTemplateVariables['giftcardcode'] = $col['giftcard_code'];
327
- $emailTemplateVariables['templateimg'] = $imgpath;
328
- $emailTemplateVariables['themecolor'] = "#" . $row['theme_color'];
329
- $emailTemplateVariables['textcolor'] = "#" . $row['text_color'];
330
- $emailTemplateVariables['receivername'] = $col['receiver_name'];
331
- $emailTemplateVariables['gcnote'] = $row['giftcard_note'];
332
- $emailTemplateVariables['custommsg'] = $col['giftcard_msg'];
333
- $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
334
- $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $type . '/email'));
335
- $emailTemplate->send($col['receiver_mail'], $col['receiver_name'], $emailTemplateVariables);
336
- $writeConnection->query("Update kartparadigm_giftcard_giftcard set giftcard_status=1, is_notified=1 where giftcard_id=" . $col['giftcard_id']);
337
- $writeConnection->commit();
338
- }
339
- }
340
- }
341
- }
342
- }
343
- // --------------------------------------cancel invoice----------------------------------------------------------
344
- // ----------------------------------sales_order_payment_cancel--------------------------------------------
345
- public function kartparadigmCancel(Varien_Event_Observer $observer)
346
-
347
- {
348
- $order = $observer->getPayment()->getOrder();
349
- $orderid = $order->getIncrementId();
350
- $ordered_items = $order->getAllItems();
351
- $disamt = $order->getDiscountAmount();
352
- $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
353
- $date = $date->toString('Y-M-d H:m:s');
354
- // -----------------changing giftcard status while redeeming giftcard in order placement---------------
355
- if (-($disamt) > 0) {
356
- $collec = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->getCollection()->addFieldToFilter('order_id', $order->getIncrementId());
357
- foreach($collec as $coll) {
358
- if ($coll != null) {
359
- $balused = $coll->getGiftcardBalused();
360
- $gcbal = $coll->getGiftcardBal();
361
- $updatebal = $gcbal + $balused; // update balance in trans
362
- if ($updatebal > 0) {
363
- $status = 1; //active
364
- $message = 'Admin Canceled Invoice and added amount to giftcard';
365
- }
366
- else {
367
- $status = 3; //redeemed
368
- $message = 'Admin Canceled Invoice and giftcard expired';
369
- }
370
- $transdata = array(
371
- 'giftcard_val' => $coll->getGiftcardVal() ,
372
- 'giftcard_id' => $coll->getGiftcardId() ,
373
- 'order_id' => $orderid,
374
- 'giftcard_bal' => $updatebal,
375
- 'giftcard_balused' => 0,
376
- 'giftcard_currency' => $coll->getGiftcardCurrency() ,
377
- 'giftcard_code' => $coll->getGiftcardCode() ,
378
- 'customer_name' => $coll->getCustomerName() ,
379
- 'customer_mail' => $coll->getCustomerMail() ,
380
- 'giftcard_name' => $coll->getGiftcardName() ,
381
- 'created_date' => $coll->getCreatedDate() ,
382
- 'expiry_date' => $coll->getExpiryDate() ,
383
- 'transac_date' => $date,
384
- 'giftcard_status' => $status,
385
- 'comment' => $message
386
- );
387
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
388
- try {
389
- $insertId = $trasmodel->save();
390
- }
391
- catch(Exception $e) {
392
- }
393
- $gc = Mage::getModel('kartparadigm_giftcard/giftcard')->load($coll->getGiftcardCode() , 'giftcard_code');
394
- $gcid = Mage::getModel('kartparadigm_giftcard/giftcard')->load($gc->getGiftcardId());
395
- $gcid->setGiftcardBal($updatebal);
396
- $gcid->setGiftcardStatus($status);
397
- $gcid->save();
398
- }
399
- }
400
- }
401
- // ------------------------------- updating giftcard status to canceled---------------------------
402
- foreach($ordered_items as $item) { //order item detail
403
- if ($item->getProduct()->getTypeId() === 'giftcard') {
404
- $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
405
- $writeConnection->query("Update kartparadigm_giftcard_giftcard set giftcard_status=5 where
406
- order_id=" . $order->getIncrementId());
407
- $writeConnection->commit();
408
- $coll = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('order_id', $order->getIncrementId());
409
- $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
410
- $date = $date->toString('Y-M-d H:m:s');
411
- foreach($coll as $col) {
412
- $transdata = array(
413
- 'giftcard_val' => $col['giftcard_val'],
414
- 'giftcard_id' => $col['giftcard_id'],
415
- 'order_id' => $col['order_id'],
416
- 'giftcard_bal' => $col['giftcard_bal'],
417
- 'giftcard_balused' => 0,
418
- 'giftcard_currency' => $col['giftcard_currency'],
419
- 'giftcard_code' => $col['giftcard_code'],
420
- 'customer_name' => $col['customer_name'],
421
- 'customer_mail' => $col['customer_mail'],
422
- 'giftcard_name' => $col['giftcard_name'],
423
- 'created_date' => $col['created_date'],
424
- 'expiry_date' => $col['expiry_date'],
425
- 'transac_date' => $date,
426
- 'giftcard_status' => 5, //canceled
427
- 'comment' => 'Invoice Canceled And Giftcard Expired'
428
- );
429
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
430
- $insertId = $trasmodel->save();
431
- }
432
- }
433
- }
434
- }
435
- // ------------------------------- generating giftcard code when buying giftcards-----------------------------
436
- // -------------------------------sales_model_service_quote_submit_success--------------------------------------
437
- public function generatecode(Varien_Event_Observer $observer)
438
-
439
- {
440
- $order = $observer->getEvent()->getOrder();
441
- $session = Mage::getSingleton('checkout/session');
442
- $ordered_items = $session->getQuote()->getAllItems();
443
- $quote = $session->getQuote();
444
- $orderid = $order->getIncrementId();
445
- $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
446
- $date = $date->toString('Y-M-d H:m:s');
447
- $todate = new Zend_Date(Mage::getModel('core/date')->timestamp());
448
- $expireafter = Mage::getStoreConfig('giftcard/giftcard/txt_expiry', Mage::app()->getStore()->getStoreId());
449
- $exdate = $todate->addDay($expireafter)->toString('Y-M-d H:m:s');
450
- $gccodes = $quote->getGiftcardCode();
451
- $codearr = explode(",", $gccodes);
452
- $gcbal = $quote->getGiftcardBal();
453
- $balarr = explode(",", $gcbal);
454
- $balused = $quote->getGiftcardBalused();
455
- $balusedarr = explode(",", $balused);
456
- $x = 0;
457
- foreach($codearr as $gccode) {
458
- $row = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('giftcard_code', $gccode)->addFieldToFilter('giftcard_status', 1)->getFirstItem();
459
- $status = 2; //processing
460
- $balgc=$balarr[$x] - $balusedarr[$x];
461
- $cod = $row['giftcard_code'];
462
- // -----------------------Redeeming Giftcard and updating the tables -----------------------------------
463
- if ($cod != "") {
464
- $transdata = array(
465
- 'giftcard_val' => $row['giftcard_val'],
466
- 'order_id' => $orderid,
467
- 'giftcard_id' => $row['giftcard_id'],
468
- 'giftcard_bal' =>$balgc,
469
- 'giftcard_balused' => $balusedarr[$x],
470
- 'giftcard_code' => $row['giftcard_code'],
471
- 'giftcard_currency' => $row['giftcard_currency'],
472
- 'customer_name' => $row['customer_name'],
473
- 'customer_mail' => $row['customer_mail'],
474
- 'giftcard_name' => $row['giftcard_name'],
475
- 'created_date' => $row['created_date'],
476
- 'expiry_date' => $row['expiry_date'],
477
- 'transac_date' => $date,
478
- 'giftcard_status' => $status,
479
- 'comment' => 'Giftcard used for purchase in store'
480
- );
481
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
482
- try {
483
- $insertId = $trasmodel->save()->getId();
484
- }
485
- catch(Exception $e) {
486
- }
487
- $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
488
- $writeConnection->query("Update kartparadigm_giftcard_giftcard set
489
- giftcard_status=$status,giftcard_bal =$balgc, where giftcard_code='" . $cod . "'");
490
- $writeConnection->commit();
491
- $x++;
492
- }
493
- }
494
- $codelengh = Mage::getStoreConfig('giftcard/giftcard/txt_clength', Mage::app()->getStore()->getStoreId());
495
- $dashafter = Mage::getStoreConfig('giftcard/giftcard/txt_dashafter', Mage::app()->getStore()->getStoreId());
496
- // ---------------------------Generating Giftcard Codes and updating in database-------------------------
497
- foreach($ordered_items as $item) { //item detail
498
- if ($item->getProduct()->getTypeId() === 'giftcard') {
499
- $recipientname = '';
500
- $recipientmail = '';
501
- $address = '';
502
- $deliverydate = '';
503
- $message = '';
504
- $sendermail = '';
505
- $sendername = '';
506
- if ($additionalOptions = $item->getOptionByCode('additional_options')) {
507
- $options = $item->getProductOptions();
508
- $options['additional_options'] = unserialize($additionalOptions->getValue());
509
- if (count($options['additional_options'] > 0)) {
510
- if ($options['additional_options'][1]['value'] != '') {
511
- $i = 0;
512
- if ($options['additional_options'][0]['label'] == 'Template') $template = $options['additional_options'][$i++]['value'];
513
- $sendername = $options['additional_options'][$i++]['value'];
514
- $recipientname = $options['additional_options'][$i++]['value'];
515
- $recipientmail = $options['additional_options'][$i++]['value'];
516
- $message = $options['additional_options'][$i++]['value'];
517
- $deliverydate = $options['additional_options'][$i++]['value'];
518
- if ($options['additional_options'][$i++]['value'] != "") $address = $options['additional_options'][$i++]['value'];
519
- $exdate = date('M-d-Y', strtotime($deliverydate . " +$expireafter days"));
520
- }
521
- }
522
- }
523
- $sendermail = $order->getCustomerEmail();
524
- if (empty($recipientname)) {
525
- $deliverydate = $date;
526
- $sendername = $order->getCustomerName();
527
- $template = $options['additional_options'][0]['value'];
528
- $recipientname = $sendername;
529
- $recipientmail = $sendermail;
530
- }
531
- $itemcount = $item->getQty();
532
- $codes = Mage::registry($item->getId());
533
- Mage::unregister($item->getId());
534
- $codes = explode(",", $codes);
535
- for ($i = 0; $i < $itemcount; $i++) {
536
- $currencycode = Mage::app()->getStore()->getCurrentCurrencyCode();
537
- $code = $codes[$i];
538
- $amount = $item->getPrice(); // discount amount
539
- // getting giftcard value
540
- $gcvalue = Mage::getModel('catalog/product')->load($item->getProductId())->getGiftcardValue();
541
- if ($gcvalue > $amount) $bal = $gcvalue;
542
- else $bal = $amount;
543
- $proid = $item->getProductId();
544
- $itemname = $item->getName();
545
- $comment = 'Giftcard Order Placed By ' . $order->getCustomerName();
546
- $customername = $order->getCustomerName();
547
- $data = array(
548
- 'giftcard_val' => $bal,
549
- 'order_id' => $orderid,
550
- 'giftcard_bal' => $bal,
551
- 'giftcard_code' => $code,
552
- 'giftcard_currency' => $currencycode,
553
- 'customer_name' => $sendername,
554
- 'customer_mail' => $sendermail,
555
- 'gcpro_id' => $proid,
556
- 'giftcard_name' => $item->getName() ,
557
- 'created_date' => $date,
558
- 'expiry_date' => $exdate,
559
- 'giftcard_status' => 0,
560
- 'store_id' => Mage::app()->getStore()->getStoreId() ,
561
- 'added_by' => $customername,
562
- 'receiver_name' => $recipientname,
563
- 'receiver_mail' => $recipientmail,
564
- 'giftcard_address' => $address,
565
- 'giftcard_msg' => $message,
566
- 'delivery_date' => $deliverydate,
567
- 'is_notified' => 0,
568
- 'template_name' => $template
569
- );
570
- $model = Mage::getModel('kartparadigm_giftcard/giftcard')->setData($data);
571
- try {
572
- $insertId = $model->save()->getId();
573
- // inserting in to trans table
574
- $transdata = array(
575
- 'giftcard_val' => $bal,
576
- 'giftcard_id' => $insertId,
577
- 'order_id' => $orderid,
578
- 'giftcard_bal' => $bal,
579
- 'giftcard_balused' => 0,
580
- 'giftcard_code' => $code,
581
- 'giftcard_currency' => $currencycode,
582
- 'customer_name' => $recipientname,
583
- 'customer_mail' => $recipientmail,
584
- 'giftcard_name' => $item->getName() ,
585
- 'created_date' => $date,
586
- 'expiry_date' => $exdate,
587
- 'transac_date' => $date,
588
- 'giftcard_status' => 0,
589
- 'comment' => $comment
590
- );
591
- $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
592
- $trasmodel->save();
593
- }
594
- catch(Exception $e) {
595
- }
596
- }
597
- }
598
- }
599
- }
600
- }
601
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Product/Type.php~ DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- class Kartparadigm_Giftcard_Model_Product_Type
4
- extends Mage_Catalog_Model_Product_Type_Abstract
5
- {
6
-
7
- public function isVirtual($product = null)
8
- {
9
- if (is_null($product)) {
10
- $product = $this->getProduct();
11
- }
12
- $item = Mage::getModel('checkout/session')->getQuote()->getItemByProduct($product);
13
- if (!$item) {
14
- return false;
15
- }
16
-
17
- $_product = Mage::getModel('catalog/product')->load($item->getProductId());
18
- $attributeValue = $_product->getAttributeText('giftcard_type');
19
-
20
- if($item->getProductType()=='giftcard' && ($attributeValue=='Physical Giftcard' || $attributeValue=='Mixed Giftcard'))
21
- return false;
22
- else
23
- return true;
24
- }
25
-
26
-
27
- }
28
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Quote/Payment.php~ DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- class Kartparadigm_Giftcard_Model_Quote_Payment extends Mage_Payment_Model_Method_Abstract
4
- {
5
- protected $_code = 'kartparadigm_giftcard';
6
- protected $_formBlockType = 'kartparadigm_giftcard/payment_form';
7
- protected $_infoBlockType = 'kartparadigm_giftcard/payment_info';
8
- protected $_canUseInternal = false;
9
-
10
- public function isAvailable($quote=null)
11
- {
12
-
13
- return $quote->getGiftcardCode()&&($quote->getGrandTotal()==$quote->getGiftcardBalused());
14
-
15
- }
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Quote/Total.php~ DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- class Kartparadigm_Giftcard_Model_Quote_Total extends Mage_Sales_Model_Quote_Address_Total_Abstract
4
- {
5
- public function __construct()
6
- {
7
- $this->setCode('giftcard');
8
- }
9
- public function collect(Mage_Sales_Model_Quote_Address $address)
10
- {
11
- parent::collect($address);
12
- $address->setGiftcertAmount(0);
13
- $address->setBaseGiftcertAmount(0);
14
- $quote = $address->getQuote();
15
- $cardCode = $quote->getGiftcardCode();
16
- if($cardCode != "")
17
- {
18
-
19
- $card = Mage::getModel('kartparadigm_giftcard/giftcard')->load($cardCode, 'giftcard_code');
20
-
21
-
22
- $totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
23
- $baseTotal = $totals["subtotal"]->getValue();
24
- $totalBaseAmount=0;
25
- $address->setGiftcertAmount($card->getGiftcardBal());
26
- $address->setBaseGiftcertAmount($card->getGiftcardBal());
27
- Mage::log($card->getGiftcardBal().','.$card->getGiftcardVal().','.$baseTotal);
28
- if($baseTotal >$card->getGiftcardBal())
29
- $bal=0;
30
- $baseAmount = min($card->getGiftcardBal(), $baseTotal);
31
- $totalBaseAmount += $baseAmount;
32
- $baseTotal -= $baseAmount;
33
-
34
- $cart_amount = $totals["subtotal"]->getValue();
35
- $gcbal = $card->getGiftcardBal();
36
- if($gcbal>$cart_amount)
37
- {
38
- $balance = $gcbal - $cart_amount;
39
- $gcbal=$balance;
40
- }
41
- else
42
- {
43
- $balance = $cart_amount-$gcbal;
44
- $gcbal=0;
45
- }
46
-
47
- Mage::log($address->getGiftcertAmount());
48
- $address->setBaseGrandTotal($baseTotal);
49
- $address->setGrandTotal($baseTotal);
50
-
51
- }
52
- return $this;
53
- }
54
-
55
- public function fetch(Mage_Sales_Model_Quote_Address $address)
56
- {
57
- $amount = $address->getGiftcardAmount();
58
- if ($amount!=0) {
59
- $quote = $address->getQuote();
60
- $address->addTotal(array(
61
- 'code' => $this->getCode(),
62
- 'title' => 'Gift Cards',
63
- 'value' => $amount,
64
- 'giftcert_code' => $quote->getGiftcardCode(),
65
- 'base_balances' => 100,
66
- 'balances' =>100,
67
- ));
68
- }
69
- return $this;
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/Model/Resource/Setup.php~ DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- class Kartparadigm_Giftcard_Model_Resource_Setup extends
3
- Mage_Core_Model_Resource_Setup
4
- {
5
- }
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/controllers/Adminhtml/GiftcardController.php CHANGED
@@ -19,7 +19,7 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
19
  $col = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('giftcard_id', $id)->getFirstItem();
20
  $row = Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name', $col['template_name'])->getFirstItem();
21
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
22
- Mage::log("Pro Id : ".$col['gcpro_id']);
23
  if ($row['template_img'] != '')
24
  $imgpath = $mediapath . $row['template_img'];
25
  else if($col['gcpro_id']!=''){
@@ -30,13 +30,13 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
30
  catch(Exception $e) {
31
  $imgpath = $mediapath."giftcard/greet.jpg";
32
  }
33
- $row['theme_color'] = "00AF00";
34
- $row['text_color'] = "FF0000";
35
  }
36
  else {
37
  $imgpath = $mediapath."giftcard/greet.jpg";
38
- $row['theme_color'] = "00AF00";
39
- $row['text_color'] = "FF0000";
40
  }
41
  $barcode = $mediapath . "giftcard/bar.gif";
42
  $arr['customername'] = $col['customer_name'];
@@ -66,7 +66,9 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
66
  public function sendAction()
67
 
68
  {
 
69
  $data = $this->getRequest()->getParams();
 
70
  $templateid = Mage::getStoreConfig('affiliateproduct/giftcard/admin_giftcard_template');
71
  $emailTemplate = Mage::getModel('core/email_template');
72
  if (!is_numeric($templateid)) {
@@ -77,10 +79,13 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
77
  $emailTemplate->load($templateid);
78
  }
79
  $type = Mage::getStoreConfig('giftcard/giftcard/giftcard_sender_email');
80
- $customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('group_id', $data['customer_groups']);
81
  $lastorderid = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('added_by', 'Admin')->getLastItem()->getOrderId();
82
  if ($lastorderid) $orderid = $lastorderid + 1; //admin orderid
83
  else $orderid = 100;
 
 
 
84
  foreach($customers as $customer) {
85
  $customermail = $customer->getEmail();
86
  $customername = $customer->getName();
@@ -146,14 +151,89 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
146
  $emailTemplateVariables['templateimg'] = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
147
  else
148
  $emailTemplateVariables['templateimg'] = $mediapath . "giftcard/greet.jpg";
149
- $emailTemplateVariables['themecolor'] = "red";
150
- $emailTemplateVariables['textcolor'] = "green";
151
  $emailTemplateVariables['receivername'] = $customername;
152
  $emailTemplateVariables['custommsg'] = $msg;
153
  $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
154
  $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $type . '/email'));
155
  $emailTemplate->send($customermail, $customername, $emailTemplateVariables);
156
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Giftcards Sent Successfully.'));
158
  $this->loadLayout();
159
  $this->renderLayout();
@@ -271,8 +351,8 @@ class Kartparadigm_Giftcard_Adminhtml_GiftcardController extends Mage_Adminhtml_
271
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
272
  if (strpos($mediapath, 'localhost') !== false) $emailTemplateVariables['templateimg'] = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
273
  else $emailTemplateVariables['templateimg'] = $mediapath . "giftcard/greet.jpg";
274
- $emailTemplateVariables['themecolor'] = "red";
275
- $emailTemplateVariables['textcolor'] = "green";
276
  $emailTemplateVariables['receivername'] = $data['receiver_name'];
277
  $emailTemplateVariables['custommsg'] = $data['giftcard_msg'];
278
  $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
19
  $col = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('giftcard_id', $id)->getFirstItem();
20
  $row = Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name', $col['template_name'])->getFirstItem();
21
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
22
+
23
  if ($row['template_img'] != '')
24
  $imgpath = $mediapath . $row['template_img'];
25
  else if($col['gcpro_id']!=''){
30
  catch(Exception $e) {
31
  $imgpath = $mediapath."giftcard/greet.jpg";
32
  }
33
+ $row['theme_color'] = "32943F";
34
+ $row['text_color'] = "BF0D0D";
35
  }
36
  else {
37
  $imgpath = $mediapath."giftcard/greet.jpg";
38
+ $row['theme_color'] = "32943F";
39
+ $row['text_color'] = "BF0D0D";
40
  }
41
  $barcode = $mediapath . "giftcard/bar.gif";
42
  $arr['customername'] = $col['customer_name'];
66
  public function sendAction()
67
 
68
  {
69
+
70
  $data = $this->getRequest()->getParams();
71
+
72
  $templateid = Mage::getStoreConfig('affiliateproduct/giftcard/admin_giftcard_template');
73
  $emailTemplate = Mage::getModel('core/email_template');
74
  if (!is_numeric($templateid)) {
79
  $emailTemplate->load($templateid);
80
  }
81
  $type = Mage::getStoreConfig('giftcard/giftcard/giftcard_sender_email');
82
+
83
  $lastorderid = Mage::getModel('kartparadigm_giftcard/giftcard')->getCollection()->addFieldToFilter('added_by', 'Admin')->getLastItem()->getOrderId();
84
  if ($lastorderid) $orderid = $lastorderid + 1; //admin orderid
85
  else $orderid = 100;
86
+ if($data['customer_groups']){
87
+ $customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')
88
+ ->addFieldToFilter('group_id', $data['customer_groups']);
89
  foreach($customers as $customer) {
90
  $customermail = $customer->getEmail();
91
  $customername = $customer->getName();
151
  $emailTemplateVariables['templateimg'] = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
152
  else
153
  $emailTemplateVariables['templateimg'] = $mediapath . "giftcard/greet.jpg";
154
+ $emailTemplateVariables['themecolor'] = "#32943F";
155
+ $emailTemplateVariables['textcolor'] = "#BF0D0D";
156
  $emailTemplateVariables['receivername'] = $customername;
157
  $emailTemplateVariables['custommsg'] = $msg;
158
  $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
159
  $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $type . '/email'));
160
  $emailTemplate->send($customermail, $customername, $emailTemplateVariables);
161
  }
162
+ }
163
+ else{
164
+ $customermail = $data['receiver_mail'];
165
+ $customername = $data['receiver_name'];
166
+ $msg = $data['giftcard_msg'];
167
+ $date = new Zend_Date(Mage::getModel('core/date')->timestamp());
168
+ $date = $date->toString('Y-M-d H:m:s');
169
+ $exdate = $data['expiry_date'];
170
+ $codelengh = Mage::getStoreConfig('giftcard/giftcard/txt_clength');
171
+ $dashafter = Mage::getStoreConfig('giftcard/giftcard/txt_dashafter');
172
+ $code = Mage::getModel('kartparadigm_giftcard/custommethods')->generateUniqueId($codelengh - 1);
173
+ $code = $code . "A"; //admin giftcade
174
+ $code = join('-', str_split($code, $dashafter));
175
+ $data = array(
176
+ 'giftcard_val' => $data['giftcard_val'],
177
+ 'giftcard_bal' => $data['giftcard_val'],
178
+ 'giftcard_code' => $code,
179
+ 'order_id' => $orderid,
180
+ 'giftcard_currency' => $data['giftcard_currency'],
181
+ 'customer_name' => $customername,
182
+ 'customer_mail' => $customermail,
183
+ 'receiver_name' => $customername,
184
+ 'receiver_mail' => $customermail,
185
+ 'giftcard_name' => $data['giftcard_name'],
186
+ 'giftcard_msg' => $data['giftcard_msg'],
187
+ 'created_date' => $date,
188
+ 'store_id' => $data['store_id'],
189
+ 'expiry_date' => $exdate,
190
+ 'giftcard_status' => $data['giftcard_status'],
191
+ 'added_by' => 'Admin',
192
+ 'is_notified' => 1,
193
+ );
194
+ $model = Mage::getModel('kartparadigm_giftcard/giftcard')->setData($data);
195
+ $insertId = $model->save()->getId();
196
+ // inserting in to trans table
197
+ $transdata = array(
198
+ 'giftcard_val' => $data['giftcard_val'],
199
+ 'giftcard_id' => $insertId,
200
+ 'order_id' => $orderid, //
201
+ 'giftcard_bal' => $data['giftcard_val'],
202
+ 'giftcard_balused' => 0,
203
+ 'giftcard_code' => $code,
204
+ 'giftcard_currency' => $data['giftcard_currency'],
205
+ 'customer_name' => $data['receiver_name'],
206
+ 'customer_mail' => $data['receiver_mail'],
207
+ 'giftcard_name' => $data['giftcard_name'],
208
+ 'created_date' => $date,
209
+ 'transac_date' => $date,
210
+ 'store_id' => $data['store_id'],
211
+ 'expiry_date' => $exdate,
212
+ 'giftcard_status' => $data['giftcard_status'],
213
+ 'comment' => "Added By Admin"
214
+ );
215
+ $trasmodel = Mage::getModel('kartparadigm_giftcard/giftcardtrans')->setData($transdata);
216
+ $trasmodel->save();
217
+
218
+ $orderid++;
219
+ $emailTemplateVariables['customername'] = "Admin";
220
+ $emailTemplateVariables['giftcardname'] = $data['giftcard_name'];
221
+ $emailTemplateVariables['giftcardval'] = Mage::app()->getLocale()->currency($data['giftcard_currency'])->getSymbol()." ".$data['giftcard_val'];
222
+ $emailTemplateVariables['giftcardcode'] = $code;
223
+ $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
224
+ if (strpos($mediapath, 'localhost') !== false)
225
+ $emailTemplateVariables['templateimg'] = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
226
+ else
227
+ $emailTemplateVariables['templateimg'] = $mediapath . "giftcard/greet.jpg";
228
+ $emailTemplateVariables['themecolor'] = "#32943F";
229
+ $emailTemplateVariables['textcolor'] = "#BF0D0D";
230
+ $emailTemplateVariables['receivername'] = $customername;
231
+ $emailTemplateVariables['custommsg'] = $msg;
232
+ $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
233
+ $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $type . '/email'));
234
+ $emailTemplate->send($customermail, $customername, $emailTemplateVariables);
235
+
236
+ }
237
  Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Giftcards Sent Successfully.'));
238
  $this->loadLayout();
239
  $this->renderLayout();
351
  $mediapath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
352
  if (strpos($mediapath, 'localhost') !== false) $emailTemplateVariables['templateimg'] = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
353
  else $emailTemplateVariables['templateimg'] = $mediapath . "giftcard/greet.jpg";
354
+ $emailTemplateVariables['themecolor'] = "#32943F";
355
+ $emailTemplateVariables['textcolor'] = "#BF0D0D";
356
  $emailTemplateVariables['receivername'] = $data['receiver_name'];
357
  $emailTemplateVariables['custommsg'] = $data['giftcard_msg'];
358
  $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_' . $type . '/name'));
app/code/community/Kartparadigm/Giftcard/controllers/Adminhtml/TemplateController.php CHANGED
@@ -23,14 +23,14 @@ class Kartparadigm_Giftcard_Adminhtml_TemplateController extends Mage_Adminhtml_
23
  $imgpath = $mediapath . $row['template_img'];
24
  else $imgpath = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
25
  $barcode = $mediapath . "giftcard/bar.gif";
26
- $arr['customername'] = "From Name";
27
  $arr['giftcardname'] = "Giftcard Name";
28
- $arr['giftcardval'] = "$ 500";
29
  $arr['giftcardcode'] = "XXXX-XXXX-XXXX";
30
  $arr['templateimg'] = $imgpath;
31
  $arr['themecolor'] = "#" . $row['theme_color'];
32
  $arr['textcolor'] = "#" . $row['text_color'];
33
- $arr['receivername'] = "Receiver Name";
34
  $arr['gcnote'] = $row['giftcard_note'];
35
  $arr['gcmsg'] = "Giftcard Message By Sender :)";
36
  $arr['barcode'] = $barcode;
23
  $imgpath = $mediapath . $row['template_img'];
24
  else $imgpath = "http://www.imagesbuddy.com/images/165/smile-greeting-card.jpg";
25
  $barcode = $mediapath . "giftcard/bar.gif";
26
+ $arr['customername'] = "Sender";
27
  $arr['giftcardname'] = "Giftcard Name";
28
+ $arr['giftcardval'] = "$500";
29
  $arr['giftcardcode'] = "XXXX-XXXX-XXXX";
30
  $arr['templateimg'] = $imgpath;
31
  $arr['themecolor'] = "#" . $row['theme_color'];
32
  $arr['textcolor'] = "#" . $row['text_color'];
33
+ $arr['receivername'] = "Receiver";
34
  $arr['gcnote'] = $row['giftcard_note'];
35
  $arr['gcmsg'] = "Giftcard Message By Sender :)";
36
  $arr['barcode'] = $barcode;
app/code/community/Kartparadigm/Giftcard/etc/adminhtml.xml CHANGED
@@ -24,7 +24,7 @@
24
  <action>adminhtml/template/index</action>
25
  </managetemplates>
26
  <sendgroupgcs module="kartparadigm_giftcard">
27
- <title>Send Giftcard To Groups</title>
28
  <sort_order>3</sort_order>
29
  <action>adminhtml/giftcard/groupsend</action>
30
  </sendgroupgcs>
24
  <action>adminhtml/template/index</action>
25
  </managetemplates>
26
  <sendgroupgcs module="kartparadigm_giftcard">
27
+ <title>Send Giftcard</title>
28
  <sort_order>3</sort_order>
29
  <action>adminhtml/giftcard/groupsend</action>
30
  </sendgroupgcs>
app/code/community/Kartparadigm/Giftcard/etc/adminhtml.xml~ DELETED
@@ -1,72 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <reference name="head">
4
- <action method="addJs">
5
- <file>jscolor/jscolor.js</file>
6
- </action>
7
- </reference>
8
- <menu>
9
-
10
-
11
-
12
- <kartparadigm_giftcard module="kartparadigm_giftcard">
13
- <title>Gift Cards</title>
14
- <sort_order>71</sort_order>
15
- <children>
16
- <managegiftcards module="kartparadigm_giftcard">
17
- <title>Manage GiftCards</title>
18
- <sort_order>0</sort_order>
19
- <action>adminhtml/giftcard/index</action>
20
- </managegiftcards>
21
- <managetemplates module="kartparadigm_giftcard">
22
- <title>Manage Templates</title>
23
- <sort_order>1</sort_order>
24
- <action>adminhtml/template/index</action>
25
- </managetemplates>
26
- <sendgroupgcs module="kartparadigm_giftcard">
27
- <title>Send Giftcard To Groups</title>
28
- <sort_order>3</sort_order>
29
- <action>adminhtml/giftcard/groupsend</action>
30
- </sendgroupgcs>
31
- <giftcardsettings module="kartparadigm_giftcard">
32
- <title>Giftcard Settings</title>
33
- <sort_order>4</sort_order>
34
- <action>adminhtml/system_config/edit/section/giftcard</action>
35
- </giftcardsettings>
36
-
37
- </children>
38
- </kartparadigm_giftcard>
39
- </menu>
40
- <acl> remove from bottom and uncomment this
41
- <resources>
42
- <admin>
43
- <children>
44
- <giftcard translate="title" module="kartparadigm_giftcard">
45
- <title>Gift Cards</title>
46
- <sort_order>300</sort_order>
47
- <children>
48
- <items translate="title" module="kartparadigm_giftcard">
49
- <title>Manage GiftCards</title>
50
- <sort_order>0</sort_order>
51
- </items>
52
- </children>
53
- </giftcard>
54
-
55
- <system>
56
- <children>
57
- <config>
58
- <children>
59
- <giftcard>
60
- <title>Giftcard Settings</title> <!-- Used in resources tree -->
61
- </giftcard>
62
- </children>
63
- </config>
64
- </children>
65
- </system>
66
- </children>
67
- </admin>
68
- </resources>
69
- </acl>
70
-
71
- </config>
72
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/etc/config.xml~ DELETED
@@ -1,245 +0,0 @@
1
- <config>
2
- <modules>
3
- <Kartparadigm_Giftcard>
4
- <version>0.1.5</version>
5
- </Kartparadigm_Giftcard>
6
- </modules>
7
- <adminhtml>
8
- <menu>
9
- <customer translate="title" module="customer">
10
- <children>
11
- <giftcards translate="title" module="customer">
12
- <title>Manage Giftcards</title>
13
- <action>adminhtml/giftcard/index</action>
14
- </giftcards>
15
- </children>
16
- </customer>
17
- </menu>
18
- </adminhtml>
19
- <global>
20
- <template>
21
- <email>
22
- <custom_email_template1 module="kartparadigm_giftcard">
23
- <label>Giftcard Template For Customer</label>
24
- <file>giftcard/custom_email_template1.html</file>
25
- <type>html</type>
26
- </custom_email_template1>
27
- <admin_giftcard_template module="kartparadigm_giftcard">
28
- <label>Giftcard Template For Admin</label>
29
- <file>giftcard/admin_giftcard_template.html</file>
30
- <type>html</type>
31
- </admin_giftcard_template>
32
- </email>
33
- </template>
34
- <events>
35
-
36
-
37
- <sales_quote_collect_totals_after>
38
- <observers>
39
- <kartparadigm_giftcard_model_observer>
40
- <class>Kartparadigm_Giftcard_Model_Observer</class>
41
- <method>collectTotals</method>
42
- </kartparadigm_giftcard_model_observer>
43
- </observers>
44
- </sales_quote_collect_totals_after>
45
- <checkout_cart_product_add_after>
46
- <observers>
47
- <kartparadigm_giftcard>
48
- <class>Kartparadigm_Giftcard_Model_Observer</class>
49
- <method>changingPrice</method>
50
- </kartparadigm_giftcard>
51
- </observers>
52
- </checkout_cart_product_add_after>
53
- <!--Event when Order Invoice generation completed-->
54
- <sales_order_invoice_save_after>
55
- <observers>
56
- <kartparadigm_giftcard_model_observer>
57
- <type>singleton</type>
58
- <class>Kartparadigm_Giftcard_Model_Observer</class>
59
- <method>changingStatus</method>
60
- </kartparadigm_giftcard_model_observer>
61
- </observers>
62
- </sales_order_invoice_save_after>
63
- <sales_order_payment_cancel>
64
- <observers>
65
- <kartparadigm_giftcard_model_observer>
66
- <type>singleton</type>
67
- <class>Kartparadigm_Giftcard_Model_Observer</class>
68
- <method>kartparadigmCancel</method>
69
- </kartparadigm_giftcard_model_observer>
70
- </observers>
71
- </sales_order_payment_cancel>
72
- <!--Event when checkout process complete-->
73
- <sales_model_service_quote_submit_success>
74
- <observers>
75
- <kartparadigm_giftcard_model_observer>
76
- <type>singleton</type>
77
- <class>Kartparadigm_Giftcard_Model_Observer</class>
78
- <method>generatecode</method>
79
- </kartparadigm_giftcard_model_observer>
80
- </observers>
81
- </sales_model_service_quote_submit_success>
82
- <!--Event when product loaded into cart -->
83
- <catalog_product_load_after>
84
- <observers>
85
- <kartparadigm_giftcard_model_observer>
86
- <type>model</type>
87
- <class>Kartparadigm_Giftcard_Model_Observer</class>
88
- <method>catalogProductLoadAfter</method>
89
- </kartparadigm_giftcard_model_observer>
90
- </observers>
91
- </catalog_product_load_after>
92
- <!--Observer to make the custom options persist-->
93
- <sales_convert_quote_item_to_order_item>
94
- <observers>
95
- <kartparadigm_giftcard_model_observer>
96
- <type>model</type>
97
- <class>Kartparadigm_Giftcard_Model_Observer</class>
98
- <method>salesConvertQuoteItemToOrderItem</method>
99
- </kartparadigm_giftcard_model_observer>
100
- </observers>
101
- </sales_convert_quote_item_to_order_item>
102
- </events>
103
- <blocks>
104
- <kartparadigm_giftcard>
105
- <class>Kartparadigm_Giftcard_Block</class>
106
- </kartparadigm_giftcard>
107
- </blocks>
108
- <helpers>
109
- <kartparadigm_giftcard>
110
- <class>Kartparadigm_Giftcard_Helper</class>
111
- </kartparadigm_giftcard>
112
- <payment>
113
- <rewrite>
114
- <data>Kartparadigm_Giftcard_Helper_Payment</data>
115
- </rewrite>
116
- </payment>
117
- </helpers>
118
- <models>
119
- <kartparadigm_giftcard>
120
- <class>Kartparadigm_Giftcard_Model</class>
121
- <resourceModel>kartparadigm_giftcard_mysql4</resourceModel>
122
- </kartparadigm_giftcard>
123
- <kartparadigm_giftcard_mysql4>
124
- <class>Kartparadigm_Giftcard_Model_Mysql4</class>
125
- <entities>
126
- <giftcard>
127
- <table>kartparadigm_giftcard_giftcard</table>
128
- </giftcard>
129
- <giftcardtrans>
130
- <table>kartparadigm_giftcard_giftcardtrans</table>
131
- </giftcardtrans>
132
- <giftcardtemplate>
133
- <table>kartparadigm_giftcard_giftcardtemplate</table>
134
- </giftcardtemplate>
135
- </entities>
136
- </kartparadigm_giftcard_mysql4>
137
- </models>
138
- <resources>
139
- <kartparadigm_giftcard_setup>
140
- <setup>
141
- <module>Kartparadigm_Giftcard</module>
142
- <class>Mage_Catalog_Model_Resource_Setup</class>
143
- </setup>
144
- </kartparadigm_giftcard_setup>
145
- </resources>
146
- <catalog>
147
- <product>
148
- <type>
149
- <giftcard translate="label" module="kartparadigm_giftcard">
150
- <label>GiftCard Product</label>
151
- <model>kartparadigm_giftcard/product_type</model>
152
- <is_qty>0</is_qty>
153
- <composite>0</composite>
154
- <can_use_qty_decimals>0</can_use_qty_decimals>
155
- </giftcard>
156
- </type>
157
- </product>
158
- </catalog>
159
- </global>
160
- <frontend>
161
- <layout>
162
- <updates>
163
- <giftcard module="Kartparadigm_Giftcard">
164
- <file>kartparadigm/giftcard.xml</file>
165
- </giftcard>
166
- </updates>
167
- </layout>
168
- <routers>
169
- <kartparadigm_giftcard>
170
- <use>standard</use>
171
- <args>
172
- <module>Kartparadigm_Giftcard</module>
173
- <frontName>giftcard</frontName>
174
- </args>
175
- </kartparadigm_giftcard>
176
- </routers>
177
- <translate>
178
- <modules>
179
- <Kartparadigm_Giftcard>
180
- <files>
181
- <default>Kartparadigm_Giftcard.csv</default>
182
- </files>
183
- </Kartparadigm_Giftcard>
184
- </modules>
185
- </translate>
186
- </frontend>
187
- <!-- Default Values for giftcard fields-->
188
- <default>
189
- <giftcard>
190
- <giftcard>
191
- <enabled>0</enabled>
192
- <txt_clength>12</txt_clength>
193
- <txt_dashafter>4</txt_dashafter>
194
- <txt_expiry>60</txt_expiry>
195
- <giftcard_sender_email>Sales</giftcard_sender_email>
196
- </giftcard>
197
- </giftcard>
198
- <payment>
199
- <kartparadigm_giftcard>
200
- <active>0</active>
201
- <model>kartparadigm_giftcard/quote_payment</model>
202
- <order_status>pending</order_status>
203
- <title>Gift Card Payment</title>
204
- <allowspecific>0</allowspecific>
205
- <comments>
206
- <![CDATA[This order will be fully paid by the gift card]]>
207
- </comments>
208
- </kartparadigm_giftcard>
209
- </payment>
210
- </default>
211
- <admin>
212
- <routers>
213
- <adminhtml>
214
- <args>
215
- <modules>
216
- <kartparadigm_giftcard before="Mage_Adminhtml">Kartparadigm_Giftcard_Adminhtml</kartparadigm_giftcard>
217
- </modules>
218
- </args>
219
- </adminhtml>
220
- </routers>
221
- </admin>
222
- <!-- Over loading admin templates in module-->
223
- <stores>
224
- <admin>
225
- <design>
226
- <package>
227
- <name>default</name>
228
- </package>
229
- <theme>
230
- <default>kartparadigm</default>
231
- </theme>
232
- </design>
233
- </admin>
234
- </stores>
235
- <adminhtml>
236
- <layout>
237
- <updates>
238
- <kartparadigm_giftcard module="Kartparadigm_Giftcard">
239
- <file>giftcard.xml</file>
240
- </kartparadigm_giftcard>
241
- </updates>
242
- </layout>
243
- </adminhtml>
244
-
245
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Giftcard/etc/system.xml CHANGED
@@ -75,7 +75,7 @@
75
  <comment><![CDATA[Ex : 60 means 60 days after giftcard purchase]]></comment>
76
  </txt_expiry>
77
  <customamt_select translate="label">
78
- <label>Show Custom Amout Redeem Option: </label>
79
  <comment>Enable Custom Amount Redeeming Text Box In Giftcard Block</comment>
80
  <frontend_type>select</frontend_type>
81
  <sort_order>90</sort_order>
@@ -85,7 +85,7 @@
85
  <source_model>adminhtml/system_config_source_yesno</source_model>
86
  </customamt_select>
87
  <othersbuy_select translate="label">
88
- <label>Can Other Customers Redeem Giftcard : </label>
89
  <comment>Yes allows other customers also redeeming giftcard</comment>
90
  <frontend_type>select</frontend_type>
91
  <sort_order>90</sort_order>
@@ -95,7 +95,7 @@
95
  <source_model>adminhtml/system_config_source_yesno</source_model>
96
  </othersbuy_select>
97
  <giftcardbuy_select translate="label">
98
- <label>Can Giftcard Code Used To Buy Giftcards : </label>
99
  <comment>Yes allows buying giftcards with giftcard codes</comment>
100
  <frontend_type>select</frontend_type>
101
  <sort_order>90</sort_order>
@@ -105,7 +105,7 @@
105
  <source_model>adminhtml/system_config_source_yesno</source_model>
106
  </giftcardbuy_select>
107
  <suborgrand_select translate="label">
108
- <label>Apply Giftcard To GrandTotal: </label>
109
  <comment>'Yes' will deduct from GrandTotal 'No' will deduct from SubTotal</comment>
110
  <frontend_type>select</frontend_type>
111
  <sort_order>90</sort_order>
@@ -115,7 +115,7 @@
115
  <source_model>adminhtml/system_config_source_yesno</source_model>
116
  </suborgrand_select>
117
  <custom_email_template1 translate="label">
118
- <label>Gift Card Email Template for Customer</label>
119
  <frontend_type>select</frontend_type>
120
  <source_model>adminhtml/system_config_source_email_template</source_model>
121
  <sort_order>40</sort_order>
@@ -124,7 +124,7 @@
124
  <show_in_store>1</show_in_store>
125
  </custom_email_template1>
126
  <admin_giftcard_template translate="label">
127
- <label>Gift Card Email Template for Admin</label>
128
  <frontend_type>select</frontend_type>
129
  <source_model>adminhtml/system_config_source_email_template</source_model>
130
  <sort_order>50</sort_order>
75
  <comment><![CDATA[Ex : 60 means 60 days after giftcard purchase]]></comment>
76
  </txt_expiry>
77
  <customamt_select translate="label">
78
+ <label>Show Partial Amout Redeem Option </label>
79
  <comment>Enable Custom Amount Redeeming Text Box In Giftcard Block</comment>
80
  <frontend_type>select</frontend_type>
81
  <sort_order>90</sort_order>
85
  <source_model>adminhtml/system_config_source_yesno</source_model>
86
  </customamt_select>
87
  <othersbuy_select translate="label">
88
+ <label>Allow Guest To Redeem Giftcard </label>
89
  <comment>Yes allows other customers also redeeming giftcard</comment>
90
  <frontend_type>select</frontend_type>
91
  <sort_order>90</sort_order>
95
  <source_model>adminhtml/system_config_source_yesno</source_model>
96
  </othersbuy_select>
97
  <giftcardbuy_select translate="label">
98
+ <label>Allow Giftcard Code To Buy Another Giftcard </label>
99
  <comment>Yes allows buying giftcards with giftcard codes</comment>
100
  <frontend_type>select</frontend_type>
101
  <sort_order>90</sort_order>
105
  <source_model>adminhtml/system_config_source_yesno</source_model>
106
  </giftcardbuy_select>
107
  <suborgrand_select translate="label">
108
+ <label>Apply Giftcard To GrandTotal </label>
109
  <comment>'Yes' will deduct from GrandTotal 'No' will deduct from SubTotal</comment>
110
  <frontend_type>select</frontend_type>
111
  <sort_order>90</sort_order>
115
  <source_model>adminhtml/system_config_source_yesno</source_model>
116
  </suborgrand_select>
117
  <custom_email_template1 translate="label">
118
+ <label>Gift Card Email Template To Customer</label>
119
  <frontend_type>select</frontend_type>
120
  <source_model>adminhtml/system_config_source_email_template</source_model>
121
  <sort_order>40</sort_order>
124
  <show_in_store>1</show_in_store>
125
  </custom_email_template1>
126
  <admin_giftcard_template translate="label">
127
+ <label>Gift Card Email Template Send By Admin</label>
128
  <frontend_type>select</frontend_type>
129
  <source_model>adminhtml/system_config_source_email_template</source_model>
130
  <sort_order>50</sort_order>
app/code/community/Kartparadigm/Giftcard/etc/system.xml~ DELETED
@@ -1,181 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
-
4
- <tabs>
5
- <kartparadigm_giftcard translate="label">
6
- <label>Kartparadigm GiftCard</label>
7
- <sort_order>150</sort_order>
8
- </kartparadigm_giftcard>
9
- </tabs>
10
- <sections>
11
- <giftcard translate="label" module="kartparadigm_giftcard">
12
- <label>Giftcard</label>
13
- <tab>kartparadigm_giftcard</tab>
14
- <sort_order>10</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
19
- <giftcard translate="label comment">
20
- <label>Giftcard Settings</label>
21
- <sort_order>51</sort_order>
22
- <show_in_default>1</show_in_default>
23
- <show_in_website>1</show_in_website>
24
- <show_in_store>1</show_in_store>
25
-
26
- <fields>
27
- <enabled translate="label">
28
- <label>Enable Module </label>
29
- <frontend_type>select</frontend_type>
30
- <sort_order>9</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- <source_model>adminhtml/system_config_source_yesno</source_model>
35
- </enabled>
36
- <txt_clength translate="label comment">
37
- <label>Code length</label>
38
- <comment>Text field with store view scope.</comment>
39
- <frontend_type>text</frontend_type>
40
- <validate>required-entry</validate>
41
- <sort_order>10</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- </txt_clength>
46
- <txt_dashafter translate="label comment">
47
- <label>Dash After Every 'X' Chars</label>
48
- <comment>Text field with store view scope.</comment>
49
- <frontend_type>text</frontend_type>
50
- <validate>required-entry</validate>
51
- <sort_order>11</sort_order>
52
- <show_in_default>1</show_in_default>
53
- <show_in_website>1</show_in_website>
54
- <show_in_store>1</show_in_store>
55
- <comment><![CDATA[Ex : 3 means code should be QWE-ERT-TYU-RTY]]></comment>
56
- </txt_dashafter>
57
- <giftcard_sender_email translate="label">
58
- <label>Email Sender</label>
59
- <frontend_type>select</frontend_type>
60
- <source_model>adminhtml/system_config_source_email_identity</source_model>
61
- <sort_order>20</sort_order>
62
- <show_in_default>1</show_in_default>
63
- <show_in_website>1</show_in_website>
64
- <show_in_store>1</show_in_store>
65
- </giftcard_sender_email>
66
- <txt_expiry translate="label comment">
67
- <label>Giftcard Validity</label>
68
- <comment>Text field with store view scope.</comment>
69
- <frontend_type>text</frontend_type>
70
- <sort_order>12</sort_order>
71
- <validate>required-entry</validate>
72
- <show_in_default>1</show_in_default>
73
- <show_in_website>1</show_in_website>
74
- <show_in_store>1</show_in_store>
75
- <comment><![CDATA[Ex : 60 means 60 days after giftcard purchase]]></comment>
76
- </txt_expiry>
77
- <customamt_select translate="label">
78
- <label>Show Custom Amout Redeem Option: </label>
79
- <comment>Enable Custom Amount Redeeming Text Box In Giftcard Block</comment>
80
- <frontend_type>select</frontend_type>
81
- <sort_order>90</sort_order>
82
- <show_in_default>1</show_in_default>
83
- <show_in_website>1</show_in_website>
84
- <show_in_store>1</show_in_store>
85
- <source_model>adminhtml/system_config_source_yesno</source_model>
86
- </customamt_select>
87
- <customres_select translate="label">
88
- <label>Can Other Customers Redeem Giftcard : </label>
89
- <comment>Yes allows other customers also redeeming giftcard</comment>
90
- <frontend_type>select</frontend_type>
91
- <sort_order>90</sort_order>
92
- <show_in_default>1</show_in_default>
93
- <show_in_website>1</show_in_website>
94
- <show_in_store>1</show_in_store>
95
- <source_model>adminhtml/system_config_source_yesno</source_model>
96
- </customres_select>
97
- <giftcardbuy_select translate="label">
98
- <label>Can Giftcard Code Used To Buy Giftcards : </label>
99
- <comment>Yes allows buying giftcards with giftcard codes</comment>
100
- <frontend_type>select</frontend_type>
101
- <sort_order>90</sort_order>
102
- <show_in_default>1</show_in_default>
103
- <show_in_website>1</show_in_website>
104
- <show_in_store>1</show_in_store>
105
- <source_model>adminhtml/system_config_source_yesno</source_model>
106
- </giftcardbuy_select>
107
- <suborgrand_select translate="label">
108
- <label>Apply Giftcard To GrandTotal: </label>
109
- <comment>'Yes' will deduct from GrandTotal 'No' will deduct from SubTotal</comment>
110
- <frontend_type>select</frontend_type>
111
- <sort_order>90</sort_order>
112
- <show_in_default>1</show_in_default>
113
- <show_in_website>1</show_in_website>
114
- <show_in_store>1</show_in_store>
115
- <source_model>adminhtml/system_config_source_yesno</source_model>
116
- </suborgrand_select>
117
- <custom_email_template1 translate="label">
118
- <label>Gift Card Email Template for Customer</label>
119
- <frontend_type>select</frontend_type>
120
- <source_model>adminhtml/system_config_source_email_template</source_model>
121
- <sort_order>40</sort_order>
122
- <show_in_default>1</show_in_default>
123
- <show_in_website>1</show_in_website>
124
- <show_in_store>1</show_in_store>
125
- </custom_email_template1>
126
- <admin_giftcard_template translate="label">
127
- <label>Gift Card Email Template for Admin</label>
128
- <frontend_type>select</frontend_type>
129
- <source_model>adminhtml/system_config_source_email_template</source_model>
130
- <sort_order>50</sort_order>
131
- <show_in_default>1</show_in_default>
132
- <show_in_website>1</show_in_website>
133
- <show_in_store>1</show_in_store>
134
- </admin_giftcard_template>
135
-
136
- </fields>
137
- </giftcard>
138
- </groups>
139
- </giftcard>
140
- <payment>
141
- <groups>
142
- <kartparadigm_giftcard translate="label" module="kartparadigm_giftcard">
143
- <label>Gift Card Payment</label>
144
- <frontend_type>text</frontend_type>
145
- <sort_order>1</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
- <order_status translate="label">
151
- <label>New order status</label>
152
- <frontend_type>select</frontend_type>
153
- <source_model>adminhtml/system_config_source_order_status</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>0</show_in_store>
158
- </order_status>
159
-
160
- <title translate="label">
161
- <label>Title</label>
162
- <frontend_type>text</frontend_type>
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
- </title>
168
- <comments translate="label">
169
- <label>Comments</label>
170
- <frontend_type>textarea</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
- </comments>
176
- </fields>
177
- </kartparadigm_giftcard>
178
- </groups>
179
- </payment>
180
- </sections>
181
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/Block/Adminhtml/System/Config/Form/Field/Font.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- /**
3
- * @version 1.0 12.0.2012
4
- * @author Kartparadigm http://www.Kartparadigm.com
5
- * @copyright Copyright (C) 2010 - 2012 Kartparadigm
6
- */
7
-
8
- class Kartparadigm_Theme_Block_Adminhtml_System_Config_Form_Field_Font extends Mage_Adminhtml_Block_System_Config_Form_Field
9
- {
10
- /**
11
- * Override field method to add js
12
- *
13
- * @param Varien_Data_Form_Element_Abstract $element
14
- * @return String
15
- */
16
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
17
- {
18
- // Get the default HTML for this option
19
- $html = parent::_getElementHtml($element);
20
-
21
- $html .= '<br/><div id="tele_theme_preview" style="font-size:20px; margin-top:5px;">The quick brown fox jumps over the lazy dog</div>
22
- <script>
23
- var googleFontPreviewModel = Class.create();
24
-
25
- googleFontPreviewModel.prototype = {
26
- initialize : function()
27
- {
28
- this.fontElement = $("'.$element->getHtmlId().'");
29
- this.previewElement = $("tele_theme_preview");
30
- this.loadedFonts = "";
31
-
32
- this.refreshPreview();
33
- this.bindFontChange();
34
- },
35
- bindFontChange : function()
36
- {
37
- Event.observe(this.fontElement, "change", this.refreshPreview.bind(this));
38
- Event.observe(this.fontElement, "keyup", this.refreshPreview.bind(this));
39
- Event.observe(this.fontElement, "keydown", this.refreshPreview.bind(this));
40
- },
41
- refreshPreview : function()
42
- {
43
- if ( this.loadedFonts.indexOf( this.fontElement.value ) > -1 ) {
44
- this.updateFontFamily();
45
- return;
46
- }
47
-
48
- var ss = document.createElement("link");
49
- ss.type = "text/css";
50
- ss.rel = "stylesheet";
51
- ss.href = "http://fonts.googleapis.com/css?family=" + this.fontElement.value;
52
- document.getElementsByTagName("head")[0].appendChild(ss);
53
-
54
- this.updateFontFamily();
55
-
56
- this.loadedFonts += this.fontElement.value + ",";
57
- },
58
- updateFontFamily : function()
59
- {
60
- $(this.previewElement).setStyle({ fontFamily: this.fontElement.value });
61
- }
62
- }
63
-
64
- googleFontPreview = new googleFontPreviewModel();
65
- </script>
66
- ';
67
- return $html;
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Kartparadigm_Theme_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
- }
6
- ?>
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/Model/Config/Font.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
-
4
- class Kartparadigm_Theme_Model_Config_Font
5
- {
6
- /**
7
- * google fonts list
8
- *
9
- * @var string
10
- */
11
- private $gfonts = "Abel,Arial,Abril Fatface,Aclonica,Acme,Actor,Adamina,Aguafina Script,Aladin,Aldrich,Alegreya,Alegreya SC,Alex Brush,Alfa Slab One,Alice,Alike,Alike Angular,Allan,Allerta,Allerta Stencil,Allura,Almendra,Almendra SC,Amaranth,Amatic SC,Amethysta,Andada,Andika,Annie Use Your Telescope,Anonymous Pro,Antic,Anton,Arapey,Arbutus,Architects Daughter,Arimo,Arizonia,Armata,Artifika,Arvo,Asap,Asset,Astloch,Asul,Atomic Age,Aubrey,Bad Script,Balthazar,Bangers,Basic,Baumans,Belgrano,Bentham,Bevan,Dosis,Pacifico,Roboto,Niconne,Oswald,Merriweather,Lobster,
12
- Orbitron,Open Sans";
13
-
14
- public function toOptionArray()
15
- {
16
- $fonts = explode(',', $this->gfonts);
17
- $options = array();
18
- foreach ($fonts as $f ){
19
- $options[] = array(
20
- 'value' => $f,
21
- 'label' => $f,
22
- );
23
- }
24
-
25
- return $options;
26
- }
27
-
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/Model/Config/Header.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
-
4
- class Kartparadigm_Theme_Model_Config_Header
5
- {
6
- /**
7
- * google fonts list
8
- *
9
- * @var string
10
- */
11
- private $gfonts = "No,Yes";
12
-
13
- public function toOptionArray()
14
- {
15
- $fonts = explode(',', $this->gfonts);
16
- $options = array();
17
- foreach ($fonts as $f ){
18
- $options[] = array(
19
- 'value' => $f,
20
- 'label' => $f,
21
- );
22
- }
23
-
24
- return $options;
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/etc/config.xml DELETED
@@ -1,78 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
-
4
- <modules>
5
- <Kartparadigm_Theme>
6
- <version>0.1.0</version>
7
- </Kartparadigm_Theme>
8
- </modules>
9
-
10
- <adminhtml>
11
- <layout>
12
- <updates>
13
- <themeoptions>
14
- <file>kartparadigm_themeoptions.xml</file>
15
- </themeoptions>
16
- </updates>
17
- </layout>
18
- <acl>
19
- <resources>
20
- <admin>
21
- <children>
22
- <system>
23
- <children>
24
- <config>
25
- <children>
26
- <theme>
27
- <title>Kartparadigm Theme Settings</title>
28
- </theme>
29
- </children>
30
- </config>
31
- </children>
32
- </system>
33
- </children>
34
- </admin>
35
- </resources>
36
- </acl>
37
- </adminhtml>
38
-
39
- <global>
40
- <blocks>
41
- <theme>
42
- <class>Kartparadigm_Theme_Block</class>
43
- </theme>
44
- </blocks>
45
- <helpers>
46
- <theme>
47
- <class>Kartparadigm_Theme_Helper</class>
48
- </theme>
49
- </helpers>
50
- <models>
51
- <theme>
52
- <class>Kartparadigm_Theme_Model</class>
53
- </theme>
54
- </models>
55
- <resources>
56
- <theme_setup>
57
- <setup>
58
- <module>Kartparadigm_Theme</module>
59
- <class>Mage_Eav_Model_Entity_Setup</class>
60
- </setup>
61
- <connection>
62
- <use>default_setup</use>
63
- </connection>
64
- </theme_setup>
65
- </resources>
66
- </global>
67
-
68
- <default>
69
- <theme>
70
- <theme_config>
71
- <font>Arial</font>
72
- <color>FFFFFF</color>
73
- </theme_config>
74
-
75
- </theme>
76
- </default>
77
-
78
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/etc/system.xml DELETED
@@ -1,358 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <theme translate="label" module="theme">
5
- <label>Kartparadigm</label>
6
- <sort_order>105</sort_order>
7
- </theme>
8
- </tabs>
9
- <sections>
10
- <theme translate="label" module="theme">
11
- <label>Elagance Theme Settings</label>
12
- <tab>theme</tab>
13
- <sort_order>10</sort_order>
14
- <show_in_default>1</show_in_default>
15
- <show_in_website>1</show_in_website>
16
- <show_in_store>1</show_in_store>
17
- <groups>
18
- <theme_config translate="label">
19
- <label>Elagance Theme Settings</label>
20
- <frontend_type>text</frontend_type>
21
- <sort_order>10</sort_order>
22
- <show_in_default>1</show_in_default>
23
- <show_in_website>1</show_in_website>
24
- <show_in_store>1</show_in_store>
25
- <fields>
26
- <font translate="label comment">
27
- <label>Font Style: </label>
28
- <frontend_type>select</frontend_type>
29
- <frontend_model>theme/adminhtml_system_config_form_field_font</frontend_model>
30
- <source_model>theme/config_font</source_model>
31
- <sort_order>40</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>1</show_in_store>
35
- </font>
36
-
37
- <color translate="label comment">
38
- <label>Theme Color :</label>
39
- <frontend_type>text</frontend_type>
40
- <comment>Click to select the theme color</comment>
41
- <validate>color</validate>
42
- <sort_order>50</sort_order>
43
- <show_in_default>1</show_in_default>
44
- <show_in_website>1</show_in_website>
45
- <show_in_store>1</show_in_store>
46
- </color>
47
-
48
- </fields>
49
-
50
-
51
- </theme_config>
52
- <theme_config_header translate="label">
53
- <label>Elagance Theme Header Settings</label>
54
- <frontend_type>text</frontend_type>
55
- <sort_order>20</sort_order>
56
- <show_in_default>1</show_in_default>
57
- <show_in_website>1</show_in_website>
58
- <show_in_store>1</show_in_store>
59
- <fields>
60
- <toolbarbgcolor translate="label comment">
61
- <label>Toolbar Background Color: </label>
62
- <comment>Click to select toolbar background color</comment>
63
-
64
- <validate>color</validate>
65
-
66
- <sort_order>10</sort_order>
67
- <show_in_default>1</show_in_default>
68
- <show_in_website>1</show_in_website>
69
- <show_in_store>1</show_in_store>
70
- </toolbarbgcolor>
71
-
72
- <toolbarcolor translate="label comment">
73
- <label>Toolbar Color: </label>
74
- <frontend_type>text</frontend_type>
75
- <comment>Click to select the toolbar text color</comment>
76
-
77
- <validate>color</validate>
78
- <sort_order>20</sort_order>
79
- <show_in_default>1</show_in_default>
80
- <show_in_website>1</show_in_website>
81
- <show_in_store>1</show_in_store>
82
- </toolbarcolor>
83
- <toolbarhovercolor translate="label comment">
84
- <label>Toolbar Mouse Hover Color: </label>
85
- <frontend_type>text</frontend_type>
86
- <comment>Click to select the toolbar text color on mouse hover</comment>
87
-
88
- <validate>color</validate>
89
- <sort_order>30</sort_order>
90
- <show_in_default>1</show_in_default>
91
- <show_in_website>1</show_in_website>
92
- <show_in_store>1</show_in_store>
93
- </toolbarhovercolor>
94
-
95
- <headerbgcolor translate="label comment">
96
- <label>Header Background Color: </label>
97
- <frontend_type>text</frontend_type>
98
- <comment>Click to select the header color </comment>
99
-
100
- <validate>color</validate>
101
- <sort_order>30</sort_order>
102
- <show_in_default>1</show_in_default>
103
- <show_in_website>1</show_in_website>
104
- <show_in_store>1</show_in_store>
105
- </headerbgcolor>
106
- </fields>
107
- </theme_config_header>
108
- <theme_config_zoom translate="label">
109
- <label>Elagance Theme Zoom Settings</label>
110
- <frontend_type>text</frontend_type>
111
- <sort_order>50</sort_order>
112
- <show_in_default>1</show_in_default>
113
- <show_in_website>1</show_in_website>
114
- <show_in_store>1</show_in_store>
115
- <fields>
116
- <productheight translate="label comment">
117
- <label>Product Image Height: </label>
118
- <comment>Give Product Image height in product page ex:500</comment>
119
- <frontend_type>text</frontend_type>
120
-
121
-
122
- <sort_order>10</sort_order>
123
- <show_in_default>1</show_in_default>
124
- <show_in_website>1</show_in_website>
125
- <show_in_store>1</show_in_store>
126
- </productheight>
127
- <productwidth translate="label comment">
128
- <label>Product Image Width: </label>
129
- <comment>Give Product Image width in product page ex:500</comment>
130
-
131
- <frontend_type>text</frontend_type>
132
-
133
- <sort_order>20</sort_order>
134
- <show_in_default>1</show_in_default>
135
- <show_in_website>1</show_in_website>
136
- <show_in_store>1</show_in_store>
137
- </productwidth>
138
-
139
- <zoomheight translate="label comment">
140
- <label>Zoom window Height: </label>
141
- <comment>Give Zoom window Height ex:500</comment>
142
- <frontend_type>text</frontend_type>
143
-
144
-
145
- <sort_order>10</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
- </zoomheight>
150
- <zoomwidth translate="label comment">
151
- <label>Zoom Window Width: </label>
152
- <comment>Give Zoom window width ex:500</comment>
153
-
154
- <frontend_type>text</frontend_type>
155
-
156
- <sort_order>20</sort_order>
157
- <show_in_default>1</show_in_default>
158
- <show_in_website>1</show_in_website>
159
- <show_in_store>1</show_in_store>
160
- </zoomwidth>
161
- </fields>
162
- </theme_config_zoom>
163
- <theme_config_home translate="label">
164
- <label>Home Slide Show Settings</label>
165
- <frontend_type>text</frontend_type>
166
- <sort_order>50</sort_order>
167
- <show_in_default>1</show_in_default>
168
- <show_in_website>1</show_in_website>
169
- <show_in_store>1</show_in_store>
170
- <fields>
171
- <sliderheight translate="label comment">
172
- <label>Slider Height: </label>
173
- <comment>you can give fluid/fixed height (for fluid use %).For better view, use minimum 300 as slider height</comment>
174
- <frontend_type>text</frontend_type>
175
- <sort_order>10</sort_order>
176
- <show_in_default>1</show_in_default>
177
- <show_in_website>1</show_in_website>
178
- <show_in_store>1</show_in_store>
179
- </sliderheight>
180
-
181
- <bannerimage1 translate="label comment">
182
- <label>Banner Image1: </label>
183
- <comment>Give banner image floder name and image name ex:images/fullimage1.jpg</comment>
184
- <frontend_type>text</frontend_type>
185
- <sort_order>10</sort_order>
186
- <show_in_default>1</show_in_default>
187
- <show_in_website>1</show_in_website>
188
- <show_in_store>1</show_in_store>
189
- </bannerimage1>
190
- <image1target translate="label comment">
191
- <label>Banner Image1 Target: </label>
192
- <comment>you can give any category or page url.Default target is home page. </comment>
193
- <frontend_type>text</frontend_type>
194
- <sort_order>20</sort_order>
195
- <show_in_default>1</show_in_default>
196
- <show_in_website>1</show_in_website>
197
- <show_in_store>1</show_in_store>
198
- </image1target>
199
- <bannerimage2 translate="label comment">
200
- <label>Banner Image2: </label>
201
- <comment>Give banner image floder name and image name ex:images/fullimage1.jpg</comment>
202
- <frontend_type>text</frontend_type>
203
- <sort_order>30</sort_order>
204
- <show_in_default>1</show_in_default>
205
- <show_in_website>1</show_in_website>
206
- <show_in_store>1</show_in_store>
207
- </bannerimage2>
208
- <image2target translate="label comment">
209
- <label>Banner Image2 Target: </label>
210
- <comment>you can give any category or page url .Default target is home page.ex:furniture.html</comment>
211
- <frontend_type>text</frontend_type>
212
- <sort_order>40</sort_order>
213
- <show_in_default>1</show_in_default>
214
- <show_in_website>1</show_in_website>
215
- <show_in_store>1</show_in_store>
216
- </image2target>
217
- <bannerimage3 translate="label comment">
218
- <label>Banner Image3: </label>
219
- <comment>Give banner image floder name and image name ex:images/fullimage1.jpg </comment>
220
- <frontend_type>text</frontend_type>
221
- <sort_order>50</sort_order>
222
- <show_in_default>1</show_in_default>
223
- <show_in_website>1</show_in_website>
224
- <show_in_store>1</show_in_store>
225
- </bannerimage3>
226
- <image3target translate="label comment">
227
- <label>Banner Image3 Target: </label>
228
- <comment>you can give any category or page url..Default target is home page.ex:furniture.html </comment>
229
- <frontend_type>text</frontend_type>
230
- <sort_order>60</sort_order>
231
- <show_in_default>1</show_in_default>
232
- <show_in_website>1</show_in_website>
233
- <show_in_store>1</show_in_store>
234
- </image3target>
235
- <globalslideshow translate="label comment">
236
- <label>You want to make this slide show as global : </label>
237
- <frontend_type>select</frontend_type>
238
- <comment>if you select yes it will display on all pages by default it is in home page.ex:furniture.html</comment>
239
-
240
- <source_model>theme/config_header</source_model>
241
-
242
- <sort_order>70</sort_order>
243
- <show_in_default>1</show_in_default>
244
- <show_in_website>1</show_in_website>
245
- <show_in_store>1</show_in_store>
246
- </globalslideshow>
247
-
248
- </fields>
249
- </theme_config_home>
250
- <theme_config_res translate="label">
251
- <label>Restore Default Settings</label>
252
- <frontend_type>text</frontend_type>
253
- <sort_order>60</sort_order>
254
- <show_in_default>1</show_in_default>
255
- <show_in_website>1</show_in_website>
256
- <show_in_store>1</show_in_store>
257
- <fields>
258
- <themres translate="label comment">
259
- <label>Theme Color Restore: </label>
260
- <frontend_type>select</frontend_type>
261
- <comment>select yes to restore default theme color settings</comment>
262
-
263
- <source_model>theme/config_header</source_model>
264
-
265
- <sort_order>10</sort_order>
266
- <show_in_default>1</show_in_default>
267
- <show_in_website>1</show_in_website>
268
- <show_in_store>1</show_in_store>
269
- </themres>
270
- <headerres translate="label comment">
271
- <label>Header Restore: </label>
272
- <frontend_type>select</frontend_type>
273
- <comment>select yes to restore default header color settings</comment>
274
-
275
- <source_model>theme/config_header</source_model>
276
-
277
- <sort_order>20</sort_order>
278
- <show_in_default>1</show_in_default>
279
- <show_in_website>1</show_in_website>
280
- <show_in_store>1</show_in_store>
281
- </headerres>
282
-
283
- <footerres translate="label comment">
284
- <label>FooterRestore: </label>
285
- <frontend_type>select</frontend_type>
286
- <comment>select yes to restore default footer color settings</comment>
287
-
288
- <source_model>theme/config_header</source_model>
289
-
290
- <sort_order>30</sort_order>
291
- <show_in_default>1</show_in_default>
292
- <show_in_website>1</show_in_website>
293
- <show_in_store>1</show_in_store>
294
- </footerres>
295
- </fields>
296
- </theme_config_res>
297
- <theme_config_footer translate="label">
298
- <label>Elagance Theme Footer Settings</label>
299
- <frontend_type>text</frontend_type>
300
- <sort_order>30</sort_order>
301
- <show_in_default>1</show_in_default>
302
- <show_in_website>1</show_in_website>
303
- <show_in_store>1</show_in_store>
304
- <fields>
305
- <footerbgcolor translate="label comment">
306
- <label>Footer Background Color: </label>
307
- <frontend_type>text</frontend_type>
308
- <comment>Click to select the Footer Background color </comment>
309
-
310
- <validate>color</validate>
311
- <sort_order>30</sort_order>
312
- <show_in_default>1</show_in_default>
313
- <show_in_website>1</show_in_website>
314
- <show_in_store>1</show_in_store>
315
- </footerbgcolor>
316
- <footertextcolor translate="label comment">
317
- <label>Footer Text Color: </label>
318
- <frontend_type>text</frontend_type>
319
- <comment>Click to select the footer text color</comment>
320
-
321
- <validate>color</validate>
322
- <sort_order>20</sort_order>
323
- <show_in_default>1</show_in_default>
324
- <show_in_website>1</show_in_website>
325
- <show_in_store>1</show_in_store>
326
- </footertextcolor>
327
- <footerlinkscolor translate="label comment">
328
- <label>Footer Links Color: </label>
329
- <frontend_type>text</frontend_type>
330
- <comment>Click to select the footer links color</comment>
331
-
332
- <validate>color</validate>
333
- <sort_order>20</sort_order>
334
- <show_in_default>1</show_in_default>
335
- <show_in_website>1</show_in_website>
336
- <show_in_store>1</show_in_store>
337
- </footerlinkscolor>
338
- <footertexthovercolor translate="label comment">
339
- <label>Footer Text Mouse Hover Color: </label>
340
- <frontend_type>text</frontend_type>
341
- <comment>Click to select the footer text color on mouse hover</comment>
342
-
343
- <validate>color</validate>
344
- <sort_order>30</sort_order>
345
- <show_in_default>1</show_in_default>
346
- <show_in_website>1</show_in_website>
347
- <show_in_store>1</show_in_store>
348
- </footertexthovercolor>
349
-
350
-
351
- </fields>
352
- </theme_config_footer >
353
- </groups>
354
- </theme>
355
- </sections>
356
- </config>
357
-
358
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kartparadigm/Theme/sql/theme_setup/mysql4-install-0.1.0.php DELETED
@@ -1,149 +0,0 @@
1
-
2
- <?php
3
- $this->startSetup();
4
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
5
-
6
-
7
- $staticBlock = array(
8
- 'title' => 'Customer Service',
9
- 'identifier' => 'rt001-footer-box1',
10
- 'content' => '<ul>
11
- <li><a href="{{store url="customer-service"}}">Customer Service</a></li>
12
- <li><a href="{{store url="sales/guest/form"}}">Orders and Returns</a></li>
13
- <li><a href="{{store url="customer-service"}}">Shipping and Delivery</a></li>
14
- <li><a href="{{store url="catalog/seo_sitemap/category"}}">Sitemap</a></li>
15
- </ul>',
16
- 'is_active' => 1,
17
- 'stores' => array(0)
18
- );
19
- Mage::getModel('cms/block')->setData($staticBlock)->save();
20
-
21
- $staticBlock = array(
22
- 'title' => 'About Us',
23
- 'identifier' => 'rt001-footer-box2',
24
- 'content' => '<ul>
25
- <li><a href="{{store url="about-magento-demo-store"}}">About Us</a></li>
26
- <li><a href="{{store url="privacy-policy-cookie-restriction-mode"}}">Privacy Policy</a></li>
27
- <li><a href="{{store url="contacts"}}">Contact Us</a></li>
28
- <li><a href="{{store url="customer-service"}}">Shopping Infos</a></li>
29
- </ul>',
30
- 'is_active' => 1,
31
- 'stores' => array(0)
32
- );
33
- Mage::getModel('cms/block')->setData($staticBlock)->save();
34
-
35
- $staticBlock = array(
36
- 'title' => 'New Products',
37
- 'identifier' => 'rt001-footer-box3',
38
- 'content' => '<ul>
39
- <li><a href="{{store url="#"}}">Textlink</a></li>
40
- <li><a href="{{store url="#"}}">Textlink</a></li>
41
- <li><a href="{{store url="#"}}">Textlink</a></li>
42
- <li><a href="{{store url="#"}}">Textlink</a></li>
43
- </ul>',
44
- 'is_active' => 1,
45
- 'stores' => array(0)
46
- );
47
- Mage::getModel('cms/block')->setData($staticBlock)->save();
48
-
49
- $staticBlock = array(
50
- 'title' => 'Popular',
51
- 'identifier' => 'rt001-footer-box4',
52
- 'content' => '<ul>
53
- <li><a href="{{store url="#"}}">Textlink</a></li>
54
- <li><a href="{{store url="#"}}">Textlink</a></li>
55
- <li><a href="{{store url="#"}}">Textlink</a></li>
56
- <li><a href="{{store url="#"}}">Textlink</a></li>
57
- </ul>',
58
- 'is_active' => 1,
59
- 'stores' => array(0)
60
- );
61
- Mage::getModel('cms/block')->setData($staticBlock)->save();
62
-
63
- $staticBlock = array(
64
- 'title' => 'Left Collout Banners',
65
- 'identifier' => 'left_collout_banner',
66
- 'content' => '
67
- <ul>
68
- <li><a href="{{store url="furniture.phtml"}}">
69
- <img src="{{media url="wysiwyg/img/col_left_callout.jpg"}}" alt="Image1" /></a></li>
70
- <li><img src="{{media url="wysiwyg/img/ph_callout_left_rebel.jpg"}}" alt="Image2" /></li>
71
- <li><img src="{{media url="wysiwyg/img/col_left_callout.jpg"}}" alt="Image3" /></li>
72
- </ul>',
73
- 'is_active' => 1,
74
- 'stores' => array(0)
75
- );
76
- Mage::getModel('cms/block')->setData($staticBlock)->save();
77
-
78
- $staticBlock = array(
79
- 'title' => 'Right Collout Banners',
80
- 'identifier' => 'right_collout_banner',
81
- 'content' => '
82
- <ul>
83
- <li><a href="{{store url="apparel.html"}}">
84
- <img src="{{media url="wysiwyg/img/ph_callout_left_rebel.jpg"}}" alt="Image1" /></a></li>
85
- <li><img src="{{media url="wysiwyg/img/col_left_callout.jpg"}}" alt="Image2" /></li>
86
- <li><img src="{{media url="wysiwyg/img/ph_callout_left_rebel.jpg"}}" alt="Image3" /></li>
87
- </ul>',
88
- 'is_active' => 1,
89
- 'stores' => array(0)
90
- );
91
- Mage::getModel('cms/block')->setData($staticBlock)->save();
92
-
93
- $staticBlock = array(
94
- 'title' => 'Category Banners',
95
- 'identifier' => 'kartparadigm_category_banners',
96
- 'content' => '
97
- <table style="width: 100%; height: auto;" border="0" cellspacing="10">
98
- <tbody>
99
- <tr>
100
- <td><a href="{{store url="electronics/cell-phones.html"}}">
101
- <img style="padding: 10;" src="{{media url="wysiwyg/img/electronics_cellphones.jpg"}}" alt="Image1" width="90%" />
102
- </a></td>
103
- <td><a href="{{store url="electronics/cameras.html"}}">
104
- <img style="padding: 10;" src="{{media url="wysiwyg/img/electronics_digitalcameras.jpg"}}" alt="Image2" width="90%" />
105
- </a></td>
106
- <td><a href="{{store url="electronics/computers.html"}}">
107
- <img style="padding: 10;" src="{{media url="wysiwyg/img/electronics_laptops.jpg"}}" alt="Image3" width="90%" />
108
- </a></td>
109
- </tr>
110
- </tbody>
111
- </table>',
112
- 'is_active' => 1,
113
- 'stores' => array(0)
114
- );
115
- Mage::getModel('cms/block')->setData($staticBlock)->save();
116
-
117
- $staticBlock = array(
118
- 'title' => 'Custom Banners Slider',
119
- 'identifier' => 'custom_banners_slider',
120
- 'content' => '
121
- <div id="custom_slider" class="owl-carousel owl-theme">
122
- <div class="item"><a href="#"> <img src="{{media url="wysiwyg/img/col_left_callout.jpg"}}" alt="Image1" /></a></div>
123
- <div class="item"><a href="#"> <img src="{{media url="wysiwyg/img/ph_callout_left_rebel.jpg"}}" alt="Image2" /></a></div>
124
- <div class="item"><a href="#"> <img src="{{media url="wysiwyg/img/col_left_callout.jpg"}}" alt="Image3" /></a></div>
125
- </div>',
126
- 'is_active' => 1,
127
- 'stores' => array(0)
128
- );
129
- Mage::getModel('cms/block')->setData($staticBlock)->save();
130
-
131
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
132
- $cmsPageData = array(
133
- 'title' => 'Kartparadigm Home Page',
134
- 'root_template' => 'one_column',
135
- 'meta_keywords' => 'meta,keywords',
136
- 'meta_description' => 'meta description',
137
- 'identifier' => 'kartparadigm-home',
138
- 'is_active' => 1,
139
- 'sort_order' => 0,
140
- 'stores' => array(0),//available for all store views
141
- 'content' => '
142
- {{block type="cms/block" block_id="kartparadigm_category_banners"}}
143
- {{widget type="catalog/product_widget_new" display_type="all_products" products_count="10" template="catalog/product/widget/new/content/new_grid.phtml"}}'
144
- );
145
-
146
- Mage::getModel('cms/page')->setData($cmsPageData)->save();
147
-
148
- $this->endSetup();
149
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/{default → base}/default/template/kartparadigm/giftcard/view.phtml RENAMED
@@ -9,6 +9,11 @@ function goBack() {
9
  window.history.back()
10
  }
11
  </script>
 
 
 
 
 
12
  <div class="content-header">
13
  <table cellspacing="0">
14
  <tbody><tr>
@@ -20,49 +25,68 @@ function goBack() {
20
  </tbody></table>
21
  </div>
22
  <center>
23
- <div id='giftcard' class="giftcard-preview-container" style="width:650px;height:650px;padding-left:10px;
24
- border: 10px solid gray;">
 
 
 
 
 
25
  <div style="background-repeat: no-repeat;float:left;
26
- width:350px; height:630px; padding-top:5px;" >
27
- <img src="<?php echo $temp['templateimg']?>" style="width:350px;height:630px;" alt="Image Name" >
 
 
28
  </div>
29
- <table style="float:right;padding-top:30px;width:300px;" >
 
 
30
  <tr style="padding:2px 2px;
31
- height:48px;">
32
- <td style="padding:2px 2px;
33
- height:24px;"> <span style="font-weight:bold;
34
- font-size:20px;color:<?php echo $temp['textcolor'] ?>;"><?php echo $temp['giftcardname']?></td>
35
  </tr>
36
- <tr style="padding:2px 2px;
37
- height:48px;">
38
- <td style="padding:2px 2px;
39
  height:24px;">
40
- <span style="font-weight:bold;
41
- font-size:16px;
42
- color:<?php echo $temp['themecolor'] ?>;">From : <span id='from' style="font-size:14px;font-weight:bold;
43
- color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['customername']?></span></span>
44
  </td>
45
  </tr>
46
  <tr style="padding:2px 2px;
47
- height:48px;">
48
- <td style="padding:2px 2px;
49
- height:24px;">
50
- <span style="font-weight:bold;
51
- font-size:16px;
52
- color:<?php echo $temp['themecolor'] ?>;">To : <span id='to' style="font-size:14px;font-weight:bold;
 
 
 
 
 
 
 
 
53
  color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['receivername']?></span></span>
54
  </td>
55
  </tr>
56
- <tr style="padding:2px 2px;
57
- height:48px;">
58
- <td style="padding:2px 2px;
 
59
  height:24px;">
60
- <div style="margin:0 auto; width:270px; height:120px;padding:5px; line-height:15px; text-align:left;color:<?php echo $temp['textcolor'] ?>;border-radius:10px;border:1px solid gray;" id="txtCustName"><?php echo $temp['gcmsg']?></div>
 
 
 
 
61
  </td>
62
  </tr>
63
  <tr style="padding:2px 2px;
64
- height:48px;">
65
- <td style="padding:2px 2px;
66
  height:24px;">
67
  <div style="color:<?php echo $temp['textcolor'] ?>;
68
  font-weight:bold;
@@ -72,29 +96,27 @@ border: 10px solid gray;">
72
  </td>
73
  </tr>
74
  <tr style="padding:2px 2px;
75
- height:48px;" >
76
- <td style="padding:2px 2px;
77
  height:24px;">
78
  <div style="color:<?php echo $temp['themecolor'] ?>;
79
  font-weight:bold;
80
  font-size:15px;
81
  width:100px;
82
- float:left;">Value : <span style="color:<?php echo $temp['textcolor'] ?>;
83
- font-size:16px;"><?php echo $temp['giftcardval']?></span></div>
84
- <img class="imgright barcode" style="width:140px;
85
- height:50px;
86
- float:right;" src="<?php echo $temp['barcode']?>" >
87
  </td>
88
  </tr>
89
  <tr style="padding:2px 2px;
90
- height:48px;" >
91
- <td style="padding:2px 2px;
92
  height:24px;">
93
  <div style="color:<?php echo $temp['themecolor'] ?>;
94
  font-weight:bold;
95
  font-size:12px;
96
  width:240px;
97
- float:left;"><?php echo $temp['gcnote']?></div>
98
  </td>
99
  </tr>
100
  </table>
9
  window.history.back()
10
  }
11
  </script>
12
+ <style>
13
+ <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
14
+
15
+
16
+ </style>
17
  <div class="content-header">
18
  <table cellspacing="0">
19
  <tbody><tr>
25
  </tbody></table>
26
  </div>
27
  <center>
28
+ <div id='giftcard' class="giftcard-preview-container" style="width: 678px;
29
+ height: 448px;
30
+
31
+
32
+ -webkit-box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);
33
+ -moz-box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);
34
+ box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);">
35
  <div style="background-repeat: no-repeat;float:left;
36
+ width:350px; ; padding-top:2px;" >
37
+ <img src="<?php echo $temp['templateimg']?>" style="width: 340px;
38
+ height: 435px;
39
+ padding-top: 5px;" alt="Image Name" >
40
  </div>
41
+ <table style=" float: right;
42
+ padding-top: 15px;
43
+ width: 315px;" >
44
  <tr style="padding:2px 2px;
45
+ height:32px;">
46
+ <td colspan="2" style="padding:2px 2px;
47
+ height:24px;"> <span style="font-size: 24px;
48
+ font-family: 'Tangerine', serif;font-style: oblique;color:<?php echo $temp['textcolor'] ?>;"><?php echo $temp['giftcardname']?></td>
49
  </tr>
50
+ <tr style="padding:2px 2px;
51
+ height:24px;">
52
+ <td style="padding:2px 2px;
53
  height:24px;">
54
+
 
 
 
55
  </td>
56
  </tr>
57
  <tr style="padding:2px 2px;
58
+ height:20px;">
59
+ <td style="padding:2px 2px;
60
+ height:20px;">
61
+ <span style="
62
+ font-size: 18px;
63
+ color:<?php echo $temp['themecolor'] ?>;">From : <span id='from' style="font-size:16px; text-transform: capitalize;
64
+ color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['customername']?></span></span>
65
+ </td>
66
+ <td style="padding:2px 10px;
67
+ height:18px;">
68
+ <span style="
69
+ font-size:18px;
70
+ color:<?php echo $temp['themecolor'] ?>;"><span style="
71
+ font-size:18px;color:gray;">| </span>To : <span id='to' style="font-size:16px; text-transform: capitalize;
72
  color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['receivername']?></span></span>
73
  </td>
74
  </tr>
75
+
76
+ <tr style="padding-top:10px;
77
+ height:32px;">
78
+ <td colspan="2" style="padding:2px 2px;
79
  height:24px;">
80
+ <div style="margin: 0px auto;font-size:14px;
81
+ width: 285px;
82
+ height: 100px;
83
+ padding: 5px;
84
+ line-height: 15px;text-align:left;color:<?php echo $temp['textcolor'] ?>;border-radius:10px;border:1px solid gray;" id="txtCustName"><?php echo $temp['gcmsg']?></div>
85
  </td>
86
  </tr>
87
  <tr style="padding:2px 2px;
88
+ height:32px;">
89
+ <td colspan="2" style="padding:2px 2px;
90
  height:24px;">
91
  <div style="color:<?php echo $temp['textcolor'] ?>;
92
  font-weight:bold;
96
  </td>
97
  </tr>
98
  <tr style="padding:2px 2px;
99
+ height:32px;" >
100
+ <td colspan="2" style="padding:2px 2px;
101
  height:24px;">
102
  <div style="color:<?php echo $temp['themecolor'] ?>;
103
  font-weight:bold;
104
  font-size:15px;
105
  width:100px;
106
+ float:left;">Value : <br/><span style="color:<?php echo $temp['textcolor'] ?>;
107
+ font-size:18px;margin-top:15px;"><?php echo $temp['giftcardval']?></span></div>
108
+
 
 
109
  </td>
110
  </tr>
111
  <tr style="padding:2px 2px;
112
+ height:32px;" >
113
+ <td colspan="2" style="padding:2px 2px;
114
  height:24px;">
115
  <div style="color:<?php echo $temp['themecolor'] ?>;
116
  font-weight:bold;
117
  font-size:12px;
118
  width:240px;
119
+ float:left;padding-top: 30px;"><?php echo $temp['gcnote']?>Giftcard is for purchase in store.</div>
120
  </td>
121
  </tr>
122
  </table>
app/design/adminhtml/default/default/template/kartparadigm/giftcard/view.phtml~ DELETED
@@ -1,115 +0,0 @@
1
- <?php $temp=Mage::registry('tempvariables');
2
-
3
- Mage::log($temp,null,'logfile.log');
4
-
5
- Mage::log("URL ".$this->getUrl());
6
- ?>
7
- <script>
8
- function goBack() {
9
- window.history.back()
10
- }
11
- </script>
12
- <div class="content-header">
13
- <table cellspacing="0">
14
- <tbody><tr>
15
- <td style="width:50%;"><h3 class="icon-head head-adminhtml-templates">Giftcard Template</h3></td>
16
- <td class="form-buttons"><button type="button" onclick="printDiv('giftcard')" value="print Giftcard" style="float:right;margin-right:25px;" /><span><span><span>Print Giftcard</span></span></span></button>
17
-
18
- <button title="View Template" onclick="goBack()" type="button"><span><span><span>Back</span></span></span></button></td>
19
- </form> </tr>
20
- </tbody></table>
21
- </div>
22
- <center>
23
- <div id='giftcard' class="giftcard-preview-container" style="width:650px;height:650px;padding-left:10px;
24
- border: 10px solid gray;">
25
- <div style="background-repeat: no-repeat;float:left;
26
- width:350px; height:630px; padding-top:5px;" >
27
- <img src="<?php echo $temp['templateimg']?>" style="width:350px;height:630px;" alt="Image Name" >
28
- </div>
29
- <table style="float:right;padding-top:30px;width:300px;" >
30
- <tr style="padding:2px 2px;
31
- height:48px;">
32
- <td style="padding:2px 2px;
33
- height:24px;"> <span style="font-weight:bold;
34
- font-size:20px;color:<?php echo $temp['textcolor'] ?>;"><?php echo $temp['giftcardname']?></td>
35
- </tr>
36
- <tr style="padding:2px 2px;
37
- height:48px;">
38
- <td style="padding:2px 2px;
39
- height:24px;">
40
- <span style="font-weight:bold;
41
- font-size:16px;
42
- color:<?php echo $temp['themecolor'] ?>;">From : <span id='from' style="font-size:14px;font-weight:bold;
43
- color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['customername']?></span></span>
44
- </td>
45
- </tr>
46
- <tr style="padding:2px 2px;
47
- height:48px;">
48
- <td style="padding:2px 2px;
49
- height:24px;">
50
- <span style="font-weight:bold;
51
- font-size:16px;
52
- color:<?php echo $temp['themecolor'] ?>;">To : <span id='to' style="font-size:14px;font-weight:bold;
53
- color:<?php echo $temp['textcolor'] ?>;" ><?php echo $temp['receivername']?></span></span>
54
- </td>
55
- </tr>
56
- <tr style="padding:2px 2px;
57
- height:48px;">
58
- <td style="padding:2px 2px;
59
- height:24px;">
60
- <div style="margin:0 auto; width:270px; height:120px;padding:5px; line-height:15px; text-align:left;color:<?php echo $temp['textcolor'] ?>;border-radius:10px;border:1px solid gray;" id="txtCustName"><?php echo $temp['gcmsg']?></div>
61
- </td>
62
- </tr>
63
- <tr style="padding:2px 2px;
64
- height:48px;">
65
- <td style="padding:2px 2px;
66
- height:24px;">
67
- <div style="color:<?php echo $temp['textcolor'] ?>;
68
- font-weight:bold;
69
- font-size:12px;
70
- float:right;
71
- padding-right:15px;">Giftcard Code: <span class="textcolor" style="color:<?php echo $temp['themecolor'] ?>;"><?php echo $temp['giftcardcode']?></span></div>
72
- </td>
73
- </tr>
74
- <tr style="padding:2px 2px;
75
- height:48px;" >
76
- <td style="padding:2px 2px;
77
- height:24px;">
78
- <div style="color:<?php echo $temp['themecolor'] ?>;
79
- font-weight:bold;
80
- font-size:15px;
81
- width:100px;
82
- float:left;">Value : <span style="color:<?php echo $temp['textcolor'] ?>;
83
- font-size:16px;"><?php echo $temp['giftcardval']?></span></div>
84
- <img class="imgright barcode" style="width:140px;
85
- height:50px;
86
- float:right;" src="<?php echo $temp['barcode']?>" >
87
- </td>
88
- </tr>
89
- <tr style="padding:2px 2px;
90
- height:48px;" >
91
- <td style="padding:2px 2px;
92
- height:24px;">
93
- <div style="color:<?php echo $temp['themecolor'] ?>;
94
- font-weight:bold;
95
- font-size:12px;
96
- width:240px;
97
- float:left;"><?php echo $temp['gcnote']?></div>
98
- </td>
99
- </tr>
100
- </table>
101
-
102
- </div>
103
- </center>
104
- <script>
105
- function printDiv(divName) {
106
- var printContents = document.getElementById(divName).innerHTML;
107
- var originalContents = document.body.innerHTML;
108
-
109
- document.body.innerHTML = printContents;
110
-
111
- window.print();
112
-
113
- document.body.innerHTML = originalContents;
114
- }
115
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/kartparadigm/template/catalog/form/renderer/fieldset/element.phtml CHANGED
@@ -45,7 +45,7 @@ $_element = $this->getElement(); ?>
45
  <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
46
  </tr>
47
  <?php else: ?>
48
- <tr >
49
 
50
  <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
51
  <td class="value">
45
  <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
46
  </tr>
47
  <?php else: ?>
48
+ <tr id="<?php echo $_element->getHtmlId() ?>">
49
 
50
  <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
51
  <td class="value">
app/design/adminhtml/default/kartparadigm/template/catalog/form/renderer/fieldset/element.phtml~ CHANGED
@@ -45,7 +45,7 @@ $_element = $this->getElement(); ?>
45
  <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
46
  </tr>
47
  <?php else: ?>
48
- <tr >
49
 
50
  <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
51
  <td class="value">
45
  <td class="hidden" colspan="100"><?php echo trim($_element->getElementHtml()) ?></td>
46
  </tr>
47
  <?php else: ?>
48
+ <tr id="<?php echo $_element->getHtmlId() ?>">
49
 
50
  <td class="label"><?php echo trim($this->getElementLabelHtml()) ?></td>
51
  <td class="value">
app/design/frontend/base/default/layout/kartparadigm/giftcard.xml CHANGED
@@ -54,7 +54,6 @@
54
  </checkout_cart_index>
55
 
56
 
57
-
58
  <!-- adding custom page block to customer myaccount-->
59
  <kartparadigm_giftcard_customer_balance>
60
  <reference name="my.account.wrapper">
54
  </checkout_cart_index>
55
 
56
 
 
57
  <!-- adding custom page block to customer myaccount-->
58
  <kartparadigm_giftcard_customer_balance>
59
  <reference name="my.account.wrapper">
app/design/frontend/base/default/template/kartparadigm/giftcard/product/media.phtml CHANGED
@@ -6,8 +6,8 @@
6
  $options=$_product->getAttributeText('giftcard_template');
7
  $value=reset($options);
8
  //$row=Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name',$value)->getFirstItem();
9
- $textcol="red";
10
- $themecol="green";
11
  $mediapath=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
12
  $imgpath=$this->helper('catalog/image')->init($_product, 'image');
13
  $barcode=$mediapath."giftcard/bar.gif";
@@ -20,6 +20,11 @@ $price=Mage::helper('core')->currency($_product->getPrice());
20
 
21
 
22
  ?>
 
 
 
 
 
23
  <style type="text/css">
24
  /* example styling, feel free to move it to your styles.css */
25
 
@@ -42,17 +47,17 @@ height:24px;
42
  }
43
  .froml{
44
  font-weight:bold;
45
- font-size:16px;
46
 
47
  }
48
  .tol{
49
  font-weight:bold;
50
- font-size:16px;
51
 
52
  }
53
  .proname{
54
- font-weight:bold;
55
- font-size:20px;
56
 
57
  }
58
  .themecolor{
@@ -76,13 +81,13 @@ width:100px;
76
  float:left;
77
  }
78
  .gcnote{
79
- font-weight:bold;
80
  font-size:12px;
81
  width:240px;
82
  float:left;
 
83
  }
84
  .tab{
85
- padding-top:20px;margin-left: 250px; width:290px;position: absolute;
86
  }
87
  .imgright{
88
  float:right;
@@ -92,7 +97,7 @@ width:140px;
92
  height:50px;
93
  }
94
  .amt{
95
- font-size:16px;
96
  }
97
  .giftcard-preview-message-box{
98
  background-repeat: no-repeat;
@@ -107,14 +112,21 @@ font-size:14px;font-weight:bold;
107
  .giftcard-message { margin:0 auto; width:270px; height:75px;padding:5px; line-height:15px; text-align:left;color:brown;border-radius:10px;border:1px solid gray; }
108
  </style>
109
 
110
- <script src="<?php echo $this->getSkinUrl('js/giftcard/jquery.min-1.11.1.js')?>"></script>
 
 
 
 
111
  <script src="<?php echo $this->getSkinUrl('js/giftcard/blurbox.js')?>"></script>
 
 
 
 
 
112
  <script>
113
  var gctemp=$.noConflict();
114
  gctemp(document).ready(function() {
115
  gctemp(".pop").click(function() {
116
- //alert(pid);
117
- // gctemp('#popup').hide();
118
  gctemp('.popup').blurbox({blur: 10, animateBlur: true}).show();
119
 
120
  });
@@ -158,32 +170,32 @@ gctemp("#giftcard_template").change(function() {
158
  });
159
  </script>
160
  <div class='pop' class="giftcard-preview-container">
161
- <div class="giftcard-preview-message-box" >
162
 
163
  </div>
164
 
165
  <table class='tab' >
166
- <tr><td> <span class="proname themecolor"><?php echo $_product->getName();?></td></tr>
167
- <tr><td>
168
- <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from' class="fromto themecolor" ></span></span></td></tr><tr>
169
- <td>
170
- <span class="tol textcolor"><?php echo $this->__('To') ?> : <span id='to' class="fromto themecolor" ></span></span></td></tr>
171
 
172
- <tr><td>
173
 
174
  <div class="giftcard-message themecolor" id="txtCustName"></div></td>
175
  </tr>
176
- <tr><td>
177
  <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
178
  </td>
179
  </tr>
180
- <tr><td>
181
 
182
- <div class="val textcolor"><?php echo $this->__('Value') ?> : <span class="amt themecolor"><?php echo $price?></span></div>
183
- <img class="imgright barcode" src="<?php echo $barcode?>" class="barcode">
184
  </td>
185
  </tr>
186
- <tr><td>
187
  <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
188
  </td></tr>
189
  </table>
@@ -200,27 +212,28 @@ gctemp("#giftcard_template").change(function() {
200
 
201
 
202
  <table class='tab' >
203
- <tr><td> <span class="proname themecolor"><?php echo $_product->getName();?></td></tr>
204
- <tr><td>
205
- <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from1' class="fromto themecolor" ></span></span></td></tr><tr>
206
- <td>
207
- <span class="tol textcolor"><?php echo $this->__('To') ?> : <span id='to1' class="fromto themecolor" ></span></span></td></tr>
 
208
 
209
- <tr><td>
210
 
211
  <div class="giftcard-message themecolor" id="txtCustName1"></div></td>
212
  </tr>
213
- <tr><td>
214
  <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
215
  </td>
216
  </tr>
217
- <tr><td>
218
 
219
- <div class="val textcolor"><?php echo $this->__('Value') ?> : <span class="amt themecolor"><?php echo $price?> </span></div>
220
- <img class="imgright barcode" src="<?php echo $barcode?>" class="barcode">
221
  </td>
222
  </tr>
223
- <tr><td>
224
  <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
225
  </td></tr>
226
 
6
  $options=$_product->getAttributeText('giftcard_template');
7
  $value=reset($options);
8
  //$row=Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name',$value)->getFirstItem();
9
+ $textcol="#BF0D0D";
10
+ $themecol="#32943F";
11
  $mediapath=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
12
  $imgpath=$this->helper('catalog/image')->init($_product, 'image');
13
  $barcode=$mediapath."giftcard/bar.gif";
20
 
21
 
22
  ?>
23
+ <style>
24
+ <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
25
+
26
+
27
+ </style>
28
  <style type="text/css">
29
  /* example styling, feel free to move it to your styles.css */
30
 
47
  }
48
  .froml{
49
  font-weight:bold;
50
+ font-size:14px;
51
 
52
  }
53
  .tol{
54
  font-weight:bold;
55
+ font-size:14px;
56
 
57
  }
58
  .proname{
59
+ font-size: 22px;
60
+ font-family: 'Tangerine', serif;font-style: oblique;
61
 
62
  }
63
  .themecolor{
81
  float:left;
82
  }
83
  .gcnote{
 
84
  font-size:12px;
85
  width:240px;
86
  float:left;
87
+ padding-top:30px;
88
  }
89
  .tab{
90
+ margin-left: 250px; width:290px;position: absolute;
91
  }
92
  .imgright{
93
  float:right;
97
  height:50px;
98
  }
99
  .amt{
100
+ font-size:18px;
101
  }
102
  .giftcard-preview-message-box{
103
  background-repeat: no-repeat;
112
  .giftcard-message { margin:0 auto; width:270px; height:75px;padding:5px; line-height:15px; text-align:left;color:brown;border-radius:10px;border:1px solid gray; }
113
  </style>
114
 
115
+ <script src="<?php echo $this->getSkinUrl('js/giftcard/jquery.min-1.11.1.js')?>"></script>
116
+
117
+ <?php Mage::log("version : ". Mage::getVersion());if((Mage::getVersion()=="1.8.1.0")||(Mage::getVersion()=="1.8.0.0")) :?>
118
+ <script src="<?php echo $this->getSkinUrl('js/giftcard/blurbox1.js')?>"></script>
119
+ <?php else :?>
120
  <script src="<?php echo $this->getSkinUrl('js/giftcard/blurbox.js')?>"></script>
121
+ <style>
122
+ .col1-layout .product-view .product-shop {
123
+ float: left;
124
+ }</style>
125
+ <?php endif; ?>
126
  <script>
127
  var gctemp=$.noConflict();
128
  gctemp(document).ready(function() {
129
  gctemp(".pop").click(function() {
 
 
130
  gctemp('.popup').blurbox({blur: 10, animateBlur: true}).show();
131
 
132
  });
170
  });
171
  </script>
172
  <div class='pop' class="giftcard-preview-container">
173
+ <div class="giftcard-preview-message-box" >
174
 
175
  </div>
176
 
177
  <table class='tab' >
178
+ <tr><td colspan="2" style="padding-bottom:10px;"> <span class="proname themecolor"><?php echo $_product->getName();?></td></tr>
179
+ <tr><td style="width: 140px;">
180
+ <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from' class="fromto themecolor" ></span></span></td>
181
+ <td >
182
+ <span class="tol " style="color:gray;">| </span><span class="tol textcolor"> <?php echo $this->__(' To') ?> : <span id='to' class="fromto themecolor" ></span></span></td></tr>
183
 
184
+ <tr><td colspan="2">
185
 
186
  <div class="giftcard-message themecolor" id="txtCustName"></div></td>
187
  </tr>
188
+ <tr><td colspan="2">
189
  <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
190
  </td>
191
  </tr>
192
+ <tr><td colspan="2">
193
 
194
+ <div class="val textcolor"><?php echo $this->__('Value') ?> : <br/><span class="amt themecolor"><?php echo $price?></span></div>
195
+
196
  </td>
197
  </tr>
198
+ <tr><td colspan="2">
199
  <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
200
  </td></tr>
201
  </table>
212
 
213
 
214
  <table class='tab' >
215
+ <tr><td style="padding-bottom:10px;"> <span class="proname themecolor" ><?php echo $_product->getName();?></span></td></tr>
216
+ <tr><td style="width:140px">
217
+ <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from1' class="fromto themecolor" ></span></span></td>
218
+ <td>
219
+ <span class="tol " style="color:gray;">| </span><span class="tol textcolor"> <?php echo $this->__(' To') ?> : <span id='to1' class="fromto themecolor" ></span></span></td>
220
+ </tr>
221
 
222
+ <tr><td colspan="2">
223
 
224
  <div class="giftcard-message themecolor" id="txtCustName1"></div></td>
225
  </tr>
226
+ <tr><td colspan="2">
227
  <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
228
  </td>
229
  </tr>
230
+ <tr><td colspan="2">
231
 
232
+ <div class="val textcolor"><?php echo $this->__('Value') ?> : <br/><span class="amt themecolor"><?php echo $price?> </span></div>
233
+
234
  </td>
235
  </tr>
236
+ <tr><td colspan="2">
237
  <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
238
  </td></tr>
239
 
app/design/frontend/base/default/template/kartparadigm/giftcard/product/media.phtml~ ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <?php
4
+
5
+ $_product = $this->getProduct();
6
+ $options=$_product->getAttributeText('giftcard_template');
7
+ $value=reset($options);
8
+ //$row=Mage::getModel('kartparadigm_giftcard/giftcardtemplate')->getCollection()->addFieldToFilter('template_name',$value)->getFirstItem();
9
+ $textcol="#BF0D0D";
10
+ $themecol="#32943F";
11
+ $mediapath=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
12
+ $imgpath=$this->helper('catalog/image')->init($_product, 'image');
13
+ $barcode=$mediapath."giftcard/bar.gif";
14
+ $close=$mediapath."giftcard/clos.png";
15
+
16
+ if(($_product->getGiftcardValue()!=$_product->getPrice())&& ($_product->getGiftcardValue()!=0))
17
+ $price =Mage::helper('core')->currency($_product->getGiftcardValue(), true, false);
18
+ else
19
+ $price=Mage::helper('core')->currency($_product->getPrice());
20
+
21
+
22
+ ?>
23
+ <style>
24
+ <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
25
+
26
+
27
+ </style>
28
+ <style type="text/css">
29
+ /* example styling, feel free to move it to your styles.css */
30
+
31
+ .col1-layout .product-view .product-shop {
32
+ float: right;
33
+ width: 290px;
34
+ }
35
+ .product-view .product-img-box {
36
+ float: left;
37
+ width: 550px;
38
+ height:350px;
39
+ }
40
+ .tab .tr{
41
+ padding:2px 2px;
42
+ height:28px;
43
+ }
44
+ .tab td{
45
+ padding:2px 2px;
46
+ height:24px;
47
+ }
48
+ .froml{
49
+ font-weight:bold;
50
+ font-size:14px;
51
+
52
+ }
53
+ .tol{
54
+ font-weight:bold;
55
+ font-size:14px;
56
+
57
+ }
58
+ .proname{
59
+ font-size: 22px;
60
+ font-family: 'Tangerine', serif;font-style: oblique;
61
+
62
+ }
63
+ .themecolor{
64
+ color:<?php echo $themecol ?>;
65
+ }
66
+ .textcolor{
67
+ color:<?php echo $textcol ?>;
68
+ }
69
+
70
+ .giftcard-code{
71
+
72
+ font-weight:bold;
73
+ font-size:12px;
74
+ float:right;
75
+ padding-right:15px;
76
+ }
77
+ .val{
78
+ font-weight:bold;
79
+ font-size:15px;
80
+ width:100px;
81
+ float:left;
82
+ }
83
+ .gcnote{
84
+ font-size:12px;
85
+ width:240px;
86
+ float:left;
87
+ padding-top:30px;
88
+ }
89
+ .tab{
90
+ margin-left: 250px; width:290px;position: absolute;
91
+ }
92
+ .imgright{
93
+ float:right;
94
+ }
95
+ .barcode{
96
+ width:140px;
97
+ height:50px;
98
+ }
99
+ .amt{
100
+ font-size:18px;
101
+ }
102
+ .giftcard-preview-message-box{
103
+ background-repeat: no-repeat;
104
+ background-image: url('<?php echo $imgpath ?>');
105
+ background-size: 240px 350px;
106
+ }
107
+ .fromto{
108
+ font-size:14px;font-weight:bold;
109
+ }
110
+ .giftcard-preview-container{width:550px;height:350px;}
111
+ .giftcard-preview-message-box {width:525px;position: absolute; height:350px; padding-top:5px}
112
+ .giftcard-message { margin:0 auto; width:270px; height:75px;padding:5px; line-height:15px; text-align:left;color:brown;border-radius:10px;border:1px solid gray; }
113
+ </style>
114
+
115
+ <script src="<?php echo $this->getSkinUrl('js/giftcard/jquery.min-1.11.1.js')?>"></script>
116
+
117
+ <?php Mage::log("version : ". Mage::getVersion());if((Mage::getVersion()=="1.8.1.0")||(Mage::getVersion()=="1.8.0.0")) :?>
118
+ <script src="<?php echo $this->getSkinUrl('js/giftcard/blurbox1.js')?>"></script>
119
+ <?php else :?>
120
+ <script src="<?php echo $this->getSkinUrl('js/giftcard/blurbox.js')?>"></script>
121
+ <style>
122
+ .col1-layout .product-view .product-shop {
123
+ float: left;
124
+ }</style>
125
+ <?php endif; ?>
126
+ <script>
127
+ var gctemp=$.noConflict();
128
+ gctemp(document).ready(function() {
129
+ gctemp(".pop").click(function() {
130
+ gctemp('.popup').blurbox({blur: 10, animateBlur: true}).show();
131
+
132
+ });
133
+ gctemp("#quick-close").click(function() {
134
+
135
+ //alert(pid);
136
+ gctemp('.popup').blurbox().hide();
137
+
138
+ });
139
+
140
+ gctemp("#giftcard_template").change(function() {
141
+
142
+
143
+ var array = gctemp('option:selected',gctemp(this)).val().split(",");
144
+ var text="#"+array[0];
145
+ var theme="#"+array[1];
146
+ var url='<?php echo $mediapath;?>';
147
+ var p='url('+url+array[2]+')';
148
+ var dpath='<?php $imgpath ?>';
149
+ var dcolor='<?php $textcol ?>';
150
+ var dthem= '<?php $themecol ?>';
151
+ var note=array[3];
152
+ if(array[0]!='')
153
+ {
154
+ gctemp(".themecolor").css("color",text);
155
+ gctemp(".textcolor").css("color",theme);
156
+ gctemp(".giftcard-preview-message-box").css('background-image',p);
157
+ gctemp(".gcnote").html(note);
158
+ }
159
+ else
160
+ {
161
+ gctemp(".themecolor").css("color",dcolor);
162
+ gctemp(".textcolor").css("color",dthem);
163
+ gctemp(".giftcard-preview-message-box").css('background-image',dpath);
164
+
165
+ }
166
+
167
+
168
+ });
169
+
170
+ });
171
+ </script>
172
+ <div class='pop' class="giftcard-preview-container">
173
+ <div class="giftcard-preview-message-box" >
174
+
175
+ </div>
176
+
177
+ <table class='tab' >
178
+ <tr><td colspan="2" style="padding-bottom:10px;"> <span class="proname themecolor"><?php echo $_product->getName();?></td></tr>
179
+ <tr><td style="width: 140px;">
180
+ <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from' class="fromto themecolor" ></span></span></td>
181
+ <td >
182
+ <span class="tol " style="color:gray;">| </span><span class="tol textcolor"> <?php echo $this->__(' To') ?> : <span id='to' class="fromto themecolor" ></span></span></td></tr>
183
+
184
+ <tr><td colspan="2">
185
+
186
+ <div class="giftcard-message themecolor" id="txtCustName"></div></td>
187
+ </tr>
188
+ <tr><td colspan="2">
189
+ <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
190
+ </td>
191
+ </tr>
192
+ <tr><td colspan="2">
193
+
194
+ <div class="val textcolor"><?php echo $this->__('Value') ?> : <br/><span class="amt themecolor"><?php echo $price?></span></div>
195
+
196
+ </td>
197
+ </tr>
198
+ <tr><td colspan="2">
199
+ <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
200
+ </td></tr>
201
+ </table>
202
+
203
+ </div>
204
+
205
+ <!--Pop UP Div-->
206
+
207
+ <div class="popup" style="display:none;width:550px;height:350px;" >
208
+ <img class='imgright' src="<?php echo $close?>" id="quick-close" style="margin-right: -8px;margin-top: -8px;">
209
+
210
+ <div class="giftcard-preview-message-box" >
211
+ </div>
212
+
213
+
214
+ <table class='tab' >
215
+ <tr><td style="padding-bottom:10px;"> <span class="proname themecolor" ><?php echo $_product->getName();?></span></td></tr>
216
+ <tr><td style="width:140px">
217
+ <span class="froml textcolor"><?php echo $this->__('From') ?> : <span id='from1' class="fromto themecolor" ></span></span></td>
218
+ <td>
219
+ <span class="tol " style="color:gray;">| </span><span class="tol textcolor"> <?php echo $this->__(' To') ?> : <span id='to1' class="fromto themecolor" ></span></span></td>
220
+ </tr>
221
+
222
+ <tr><td colspan="2">
223
+
224
+ <div class="giftcard-message themecolor" id="txtCustName1"></div></td>
225
+ </tr>
226
+ <tr><td colspan="2">
227
+ <div class="giftcard-code themecolor"><?php echo $this->__('Giftcard Code') ?>: <span class="textcolor" >XXX-XXX</span></div>
228
+ </td>
229
+ </tr>
230
+ <tr><td colspan="2">
231
+
232
+ <div class="val textcolor"><?php echo $this->__('Value') ?> : <br/><span class="amt themecolor"><?php echo $price?> </span></div>
233
+
234
+ </td>
235
+ </tr>
236
+ <tr><td colspan="2">
237
+ <div class="gcnote textcolor"><?php echo $this->__('Giftcards only used for purchase in store only') ?></div>
238
+ </td></tr>
239
+
240
+ </table>
241
+
242
+ </div>
243
+
244
+
245
+
app/design/frontend/base/default/template/kartparadigm/giftcard/product/type.phtml CHANGED
@@ -66,6 +66,9 @@ endif; ?>
66
 
67
  padding:2px 2px;
68
  }
 
 
 
69
  </style>
70
  <script src="<?php echo $this->getSkinUrl('js/giftcard/jquery.min-1.11.1.js') ?>"></script>
71
  <script type="text/javascript">
@@ -141,7 +144,7 @@ gc('#tb1').keyup(function(e){
141
  <tr>
142
  <td><?php echo $this->__('Delivery Date') ?> :</td><td><span>
143
  <input type="text" style="width: 120px;" class="input-text" value="" id="selected_date" name="DeliveryDate"/>
144
- <img style="" title="Select Date" id="date_select_trig" class="v-middle" alt="" src="<?php
145
  echo $this->getSkinUrl('images/calendar.gif'); ?> "/>
146
 
147
  <script type="text/javascript">
66
 
67
  padding:2px 2px;
68
  }
69
+ .price-info{
70
+ display:none;
71
+ }
72
  </style>
73
  <script src="<?php echo $this->getSkinUrl('js/giftcard/jquery.min-1.11.1.js') ?>"></script>
74
  <script type="text/javascript">
144
  <tr>
145
  <td><?php echo $this->__('Delivery Date') ?> :</td><td><span>
146
  <input type="text" style="width: 120px;" class="input-text" value="" id="selected_date" name="DeliveryDate"/>
147
+ <img style="display:inline;" title="Select Date" id="date_select_trig" class="v-middle" alt="" src="<?php
148
  echo $this->getSkinUrl('images/calendar.gif'); ?> "/>
149
 
150
  <script type="text/javascript">
app/locale/en_US/template/email/giftcard/custom_email_template1.html CHANGED
@@ -1,6 +1,8 @@
1
 
2
  <div class="giftcard-preview-container" style="width:550px;height:370px;
3
- border-radius: 10px;padding-left:10px;">
 
 
4
  <div style="background-repeat: no-repeat;float:left;
5
  width:240px; height:350px; padding-top:5px;" >
6
  <img src="{{var templateimg}}" style="width:240px;height:350px;" alt="Image Name" >
@@ -60,9 +62,7 @@
60
  width:100px;
61
  float:left;">Value : <span style="color:{{var textcolor}};
62
  font-size:16px;">{{var giftcardval}}</span></div>
63
- <img style="width:140px;
64
- height:50px;
65
- float:right;" src="http://www.barcoding.com/images/Barcodes/code93.gif" >
66
  </td>
67
  </tr>
68
  <tr style="padding:2px 2px;
1
 
2
  <div class="giftcard-preview-container" style="width:550px;height:370px;
3
+ padding:10px;-webkit-box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);
4
+ -moz-box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);
5
+ box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.75);">
6
  <div style="background-repeat: no-repeat;float:left;
7
  width:240px; height:350px; padding-top:5px;" >
8
  <img src="{{var templateimg}}" style="width:240px;height:350px;" alt="Image Name" >
62
  width:100px;
63
  float:left;">Value : <span style="color:{{var textcolor}};
64
  font-size:16px;">{{var giftcardval}}</span></div>
65
+
 
 
66
  </td>
67
  </tr>
68
  <tr style="padding:2px 2px;
media/giftcard/clos.png CHANGED
Binary file
media/giftcard/greet.jpg CHANGED
Binary file
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Kartparadigm_Giftcard</name>
4
- <version>1.5.1.0</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Giftcard product codes are used to buy products from store</description>
11
  <notes>Giftcard Extension Tested in 1.8 and Working Fine</notes>
12
  <authors><author><name>Kartparadigm</name><user>kartparadigm</user><email>kartparadigm@gmail.com</email></author></authors>
13
- <date>2015-03-23</date>
14
- <time>11:18:09</time>
15
- <contents><target name="magecommunity"><dir name="Kartparadigm"><dir name="Giftcard"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Form"><dir name="Renderer"><dir name="Fieldset"><file name="Element.php" hash="17050e37b24626ee24ad6ac2b7a4822a"/></dir></dir></dir></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><dir name="Giftcard"><file name="List.php" hash="7abb5f6a9d0098b30b65944b40fd9ad5"/></dir><file name="Giftcard.php" hash="a76ded858f806fcfbd98f55a22911a15"/></dir></dir></dir><dir name="Groupsend"><dir name="Edit"><file name="Form.php" hash="c3b50bf823b004ba57e2219c42b7ef96"/><file name="Form.php~" hash="dfd150e3c6d08630791a6238b88a8328"/><file name="Tabs.php~" hash="894890ac5d0f7ef6dae1dbb162861bee"/></dir><file name="Edit.php" hash="163356d156d010e175864d9fd9a20472"/></dir><file name="Groupsend.php" hash="3df73363e8501c9e743b5441cc8af43c"/><dir name="Registries"><dir name="Edit"><file name="Form.php" hash="a49e7bb6f609aa02863a2e31f7246355"/></dir><file name="Edit.php" hash="cab16c05aa27713b1f0ee1c7a87f0074"/><file name="Grid.php" hash="83e7cf397a098b8781d22739ee1f73f9"/></dir><file name="Registries.php" hash="5e4db8fdafb8dab2b66ebeb5127b21a9"/><dir name="Templates"><dir name="Edit"><file name="Form.php" hash="dfd2051bb0a9795a43b3434eda069efd"/></dir><file name="Edit.php" hash="96ab9201e133b99ab6dc325fcfb2f161"/><file name="Grid.php" hash="69e8f1ebb651f59f76b2ce0401ee5d5e"/></dir><file name="Templates.php" hash="004967e1c9ebbc58a7bb4d1cd9cbeaf7"/></dir><file name="Balance.php" hash="86c44b60c5a7a45f20892f61a37b6e29"/><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Type.php" hash="b5e6bfdfcd4e10bf347be102cc7b501b"/></dir></dir></dir><dir name="Payment"><file name="Form.php" hash="a3f96979e4213379e95746c280cfd934"/><file name="Info.php" hash="a77b1cbfc1a625997d255d2ca12752a0"/></dir><file name="View.php" hash="5ef34e972c5d02b5f2aa9491da9d33d5"/></dir><dir name="Helper"><file name="Data.php" hash="16ecfad5aff0b9b921d32823a2a860a5"/><file name="Data.php~" hash="16ecfad5aff0b9b921d32823a2a860a5"/><file name="Payment.php" hash="bcd7ff2a288daba5c8757154e114b854"/><file name="Payment.php~" hash="bcd7ff2a288daba5c8757154e114b854"/></dir><dir name="Model"><file name="Custommethods.php" hash="3cebfb6a54d4a9ad3f6ad58a7dbf37e2"/><file name="Giftcard.php" hash="081146193dc762092716247ca8392565"/><file name="Giftcardtemplate.php" hash="fbb3912a24b90428915b2f88648c88a0"/><file name="Giftcardtrans.php" hash="5adb9c6700568f721b1fd639a7a5c549"/><dir name="Mysql4"><dir name="Giftcard"><file name="Collection.php" hash="fc8623fa3ef4eead6dae31ed78c5fc92"/><file name="Collection.php~" hash="05bf9f2c151bf7ce8d13a2261fb12f51"/></dir><file name="Giftcard.php" hash="c5b07a78a587883f3e189bfa324e9cc8"/><file name="Giftcard.php~" hash="9d3b8baf73c040696528017971b060fa"/><dir name="Giftcardtemplate"><file name="Collection.php" hash="ab9b4578b8f188e8a50b4c94d0725685"/><file name="Collection.php~" hash="f2fbfe9e9332e27ef96b28183d223d16"/></dir><file name="Giftcardtemplate.php" hash="3a4132f99a06bd4b20254377aadd19fc"/><file name="Giftcardtemplate.php~" hash="f5c9a2f6443ad607e8e3a05e3f18847a"/><dir name="Giftcardtrans"><file name="Collection.php" hash="6f3b6dc5328295ea86989abd02a0424c"/><file name="Collection.php~" hash="b6cf8f0827786f6e97c9b25b54bd16a5"/></dir><file name="Giftcardtrans.php" hash="fb63b8ebf8f84ffb4b0ada2e8e6b3068"/><file name="Giftcardtrans.php~" hash="fc622dd95f06afe35cae494d0b81c456"/><file name="Template.php~" hash="8c54ea2544046ccf890e47d4ed3cd5db"/><file name="Templates.php~" hash="8c54ea2544046ccf890e47d4ed3cd5db"/></dir><file name="Observer.php" hash="b57d809d5d18c5052a4666b26c5218f2"/><file name="Observer.php~" hash="9fb9820e8f86a8558a6405046434a91e"/><dir name="Product"><file name="Type.php" hash="8f4056f991455ce5047887560bd42283"/><file name="Type.php~" hash="8f4056f991455ce5047887560bd42283"/></dir><dir name="Quote"><file name="Payment.php" hash="6ad5e1533144996c5589c5971cec133e"/><file name="Payment.php~" hash="6ad5e1533144996c5589c5971cec133e"/><file name="Total.php~" hash="660d49fadd0c041c9fd989788137f359"/></dir><dir name="Resource"><file name="Setup.php" hash="9a09b300732fdbe5ebcd4914e607b46f"/><file name="Setup.php~" hash="9a09b300732fdbe5ebcd4914e607b46f"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GiftcardController.php" hash="9dd4f4ca4ab3583769d5d3140ad58edc"/><file name="TemplateController.php" hash="9dee0be88f3c6ecc33356b1ba671b15d"/></dir><file name="CustomerController.php" hash="3c65b0337b06565b9b106a82afc706d6"/><file name="IndexController.php" hash="e4fb8ec50fdf8f25a810207b64e05f0d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2f753c2c901fe16df9b2dbdf93cc6731"/><file name="adminhtml.xml~" hash="2f753c2c901fe16df9b2dbdf93cc6731"/><file name="config.xml" hash="42b89e028d48411ecfa3a0fe82dc4d6e"/><file name="config.xml~" hash="42b89e028d48411ecfa3a0fe82dc4d6e"/><file name="system.xml" hash="a7601b0b343995dc25ad0631b529e079"/><file name="system.xml~" hash="26287cd1d9461c900a4e5a19ec858f95"/></dir><dir name="sql"><dir name="kartparadigm_giftcard_setup"><file name="install-0.1.0.php" hash="832d74de34ac2105e69ae96db29ea848"/><file name="upgrade-0.1.0-0.1.1.php" hash="091e1f143d0b588364f6452db953b0ee"/><file name="upgrade-0.1.1-0.1.2 .php" hash="738146964a99b9752e00cfbce581de0e"/><file name="upgrade-0.1.2-0.1.3.php" hash="703f3f61b6ae27bf3ce52a3a0f0b64c6"/><file name="upgrade-0.1.3-0.1.4.php" hash="fe8b9c9ceb3955e85ceef9a99f123591"/><file name="upgrade-0.1.4-0.1.5.php" hash="6eb4e7e4c9abd0fca35e26b9ec7f4f09"/></dir></dir></dir><dir name="Theme"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Font.php" hash="3599b033416ebbc47cb29cafcaee1d92"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="55bc660756d1d82f38bf7b6220d9745b"/></dir><dir name="Model"><dir name="Config"><file name="Font.php" hash="2d9c8970e46b276286aebdbb6aadad22"/><file name="Header.php" hash="b8dd7f630481aafa26a69b24e665fbf2"/></dir></dir><dir name="etc"><file name="config.xml" hash="9a7322e27aadaec500be22393023fac2"/><file name="system.xml" hash="e56cfa8938e4af450776521c57c49d81"/></dir><dir name="sql"><dir name="theme_setup"><file name="mysql4-install-0.1.0.php" hash="20ca91407bfc3dcc4c66f2b7cc2fa985"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="giftcard.xml" hash="1c0f86139a17fac13d4393fccbdd7b74"/></dir><dir name="template"><dir name="kartparadigm"><dir name="giftcard"><file name="view.phtml" hash="be2ac452b636c0050c8bca2b20b3d399"/><file name="view.phtml~" hash="bdbdb46981fb80bdc0b29de58a08ea8f"/></dir></dir></dir></dir><dir name="kartparadigm"><dir name="template"><dir name="catalog"><dir name="form"><dir name="renderer"><dir name="fieldset"><file name="element.phtml" hash="82656db359d9521faa49a11c2774ab6e"/><file name="element.phtml~" hash="82656db359d9521faa49a11c2774ab6e"/></dir></dir></dir><dir name="product"><file name="edit.phtml" hash="b4071beacb31042d3e8fd5f5ac0c6127"/><file name="edit.phtml~" hash="b4071beacb31042d3e8fd5f5ac0c6127"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="kartparadigm"><dir name="giftcard"><dir name="customer"><file name="main.phtml" hash="d7eca62cebcb44d6386870f32e79b1d7"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="kartparadigm"><file name="giftcard.xml" hash="19e29afe175650261b05310d1c6ba91b"/></dir></dir><dir name="template"><dir name="kartparadigm"><dir name="giftcard"><dir name="customer"><file name="balance.phtml" hash="74e76ca3735feab4bf02bc72090ba0b8"/><file name="balview.phtml" hash="22e843fd69058ca76527bd130b3b78d5"/><file name="shareview.phtml" hash="da8e03e56ad748f54a6dc8710dd2a558"/></dir><dir name="payment"><file name="form.phtml" hash="5bee798c8677379f565bd2ee6e05a79b"/></dir><dir name="product"><file name="coupon.phtml" hash="8b637da2ba83dec8d980eba60c629fc2"/><file name="giftcardprice.phtml" hash="b7412477510cc777380db91d18f639f3"/><file name="listprice.phtml" hash="ca21cf3ca82946ccaa20e0041d5e2da6"/><file name="media.phtml" hash="6f6af8239b788467854e15a736d855b1"/><file name="type.phtml" hash="d25055ec13b4b19eb6daf5ba3c0fc8d6"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kartparadigm_Giftcard.xml" hash="f5df5aa804a3e1df5efa551b8a5e7fe6"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="giftcard"><file name="custom_email_template1.html" hash="3eba5b074ba17c3ff643de246e6edfe1"/></dir></dir></dir><file name="Kartparadigm_Giftcard.csv" hash="dc235c2229d9e2b2b40bf5e4bc69afe2"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="giftcard"><file name="blurbox.js" hash="1d248e0b91cb6e61264e43c93dc497ce"/><file name="jquery.min-1.11.1.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="giftcard"><file name="bar.gif" hash="aed53f61e4a67494a2829e7d9c32597b"/><file name="clos.png" hash="3af928af8bfcc76e5935a665b81b0c62"/><file name="greet.jpg" hash="f9be686771c81af6e1d5bc98846f3c6a"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Kartparadigm_Giftcard</name>
4
+ <version>1.5.2.0</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
10
  <description>Giftcard product codes are used to buy products from store</description>
11
  <notes>Giftcard Extension Tested in 1.8 and Working Fine</notes>
12
  <authors><author><name>Kartparadigm</name><user>kartparadigm</user><email>kartparadigm@gmail.com</email></author></authors>
13
+ <date>2015-03-31</date>
14
+ <time>04:56:47</time>
15
+ <contents><target name="magecommunity"><dir name="Kartparadigm"><dir name="Giftcard"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Form"><dir name="Renderer"><dir name="Fieldset"><file name="Element.php" hash="17050e37b24626ee24ad6ac2b7a4822a"/></dir></dir></dir></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><dir name="Giftcard"><file name="List.php" hash="7abb5f6a9d0098b30b65944b40fd9ad5"/></dir><file name="Giftcard.php" hash="a76ded858f806fcfbd98f55a22911a15"/></dir></dir></dir><dir name="Groupsend"><dir name="Edit"><file name="Form.php" hash="886813198d104b37cc8812b520f830d4"/></dir><file name="Edit.php" hash="d9bd86a23776d5244686ce4601cb7e31"/></dir><file name="Groupsend.php" hash="ce8108e5ed24c6925d840ab1e71ac35d"/><dir name="Registries"><dir name="Edit"><file name="Form.php" hash="a49e7bb6f609aa02863a2e31f7246355"/></dir><file name="Edit.php" hash="cab16c05aa27713b1f0ee1c7a87f0074"/><file name="Grid.php" hash="83e7cf397a098b8781d22739ee1f73f9"/></dir><file name="Registries.php" hash="1eac04049c6a5bf14c05529cfd1d040e"/><dir name="Templates"><dir name="Edit"><file name="Form.php" hash="17a96c18816422c8cd2b24cd4a191aef"/></dir><file name="Edit.php" hash="96ab9201e133b99ab6dc325fcfb2f161"/><file name="Grid.php" hash="69e8f1ebb651f59f76b2ce0401ee5d5e"/></dir><file name="Templates.php" hash="004967e1c9ebbc58a7bb4d1cd9cbeaf7"/></dir><file name="Balance.php" hash="86c44b60c5a7a45f20892f61a37b6e29"/><dir name="Catalog"><dir name="Product"><dir name="View"><file name="Type.php" hash="b5e6bfdfcd4e10bf347be102cc7b501b"/></dir></dir></dir><dir name="Payment"><file name="Form.php" hash="a3f96979e4213379e95746c280cfd934"/><file name="Info.php" hash="a77b1cbfc1a625997d255d2ca12752a0"/></dir><file name="View.php" hash="5ef34e972c5d02b5f2aa9491da9d33d5"/></dir><dir name="Helper"><file name="Data.php" hash="16ecfad5aff0b9b921d32823a2a860a5"/><file name="Payment.php" hash="bcd7ff2a288daba5c8757154e114b854"/></dir><dir name="Model"><file name="Custommethods.php" hash="3cebfb6a54d4a9ad3f6ad58a7dbf37e2"/><file name="Giftcard.php" hash="081146193dc762092716247ca8392565"/><file name="Giftcardtemplate.php" hash="fbb3912a24b90428915b2f88648c88a0"/><file name="Giftcardtrans.php" hash="5adb9c6700568f721b1fd639a7a5c549"/><dir name="Mysql4"><dir name="Giftcard"><file name="Collection.php" hash="fc8623fa3ef4eead6dae31ed78c5fc92"/></dir><file name="Giftcard.php" hash="c5b07a78a587883f3e189bfa324e9cc8"/><dir name="Giftcardtemplate"><file name="Collection.php" hash="ab9b4578b8f188e8a50b4c94d0725685"/></dir><file name="Giftcardtemplate.php" hash="3a4132f99a06bd4b20254377aadd19fc"/><dir name="Giftcardtrans"><file name="Collection.php" hash="6f3b6dc5328295ea86989abd02a0424c"/></dir><file name="Giftcardtrans.php" hash="fb63b8ebf8f84ffb4b0ada2e8e6b3068"/></dir><file name="Observer.php" hash="ea8de9f679457b1f1b33e94512078a58"/><dir name="Product"><file name="Type.php" hash="8f4056f991455ce5047887560bd42283"/></dir><dir name="Quote"><file name="Payment.php" hash="6ad5e1533144996c5589c5971cec133e"/></dir><dir name="Resource"><file name="Setup.php" hash="9a09b300732fdbe5ebcd4914e607b46f"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GiftcardController.php" hash="6a097449c838d0d736abc79852862d81"/><file name="TemplateController.php" hash="92aa3ccc774cfbdbb16f22a630a34f71"/></dir><file name="CustomerController.php" hash="3c65b0337b06565b9b106a82afc706d6"/><file name="IndexController.php" hash="e4fb8ec50fdf8f25a810207b64e05f0d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9e34693359a38a91a86c59fa78125942"/><file name="config.xml" hash="42b89e028d48411ecfa3a0fe82dc4d6e"/><file name="system.xml" hash="033d2ecb65a17349092b0ee963e7f147"/></dir><dir name="sql"><dir name="kartparadigm_giftcard_setup"><file name="install-0.1.0.php" hash="832d74de34ac2105e69ae96db29ea848"/><file name="upgrade-0.1.0-0.1.1.php" hash="091e1f143d0b588364f6452db953b0ee"/><file name="upgrade-0.1.1-0.1.2 .php" hash="738146964a99b9752e00cfbce581de0e"/><file name="upgrade-0.1.2-0.1.3.php" hash="703f3f61b6ae27bf3ce52a3a0f0b64c6"/><file name="upgrade-0.1.3-0.1.4.php" hash="fe8b9c9ceb3955e85ceef9a99f123591"/><file name="upgrade-0.1.4-0.1.5.php" hash="6eb4e7e4c9abd0fca35e26b9ec7f4f09"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="giftcard.xml" hash="1c0f86139a17fac13d4393fccbdd7b74"/></dir></dir><dir name="kartparadigm"><dir name="template"><dir name="catalog"><dir name="form"><dir name="renderer"><dir name="fieldset"><file name="element.phtml" hash="e82890b8bd32a140ef66830ba7eea6ed"/><file name="element.phtml~" hash="e82890b8bd32a140ef66830ba7eea6ed"/></dir></dir></dir><dir name="product"><file name="edit.phtml" hash="b4071beacb31042d3e8fd5f5ac0c6127"/><file name="edit.phtml~" hash="b4071beacb31042d3e8fd5f5ac0c6127"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="kartparadigm"><dir name="giftcard"><dir name="customer"><file name="main.phtml" hash="d7eca62cebcb44d6386870f32e79b1d7"/></dir><file name="view.phtml" hash="d8356d74c529fa65d2a45814b249a2b8"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="kartparadigm"><file name="giftcard.xml" hash="19524e554cb965933c1a97a90c1a0759"/></dir></dir><dir name="template"><dir name="kartparadigm"><dir name="giftcard"><dir name="customer"><file name="balance.phtml" hash="74e76ca3735feab4bf02bc72090ba0b8"/><file name="balview.phtml" hash="22e843fd69058ca76527bd130b3b78d5"/><file name="shareview.phtml" hash="da8e03e56ad748f54a6dc8710dd2a558"/></dir><dir name="payment"><file name="form.phtml" hash="5bee798c8677379f565bd2ee6e05a79b"/></dir><dir name="product"><file name="coupon.phtml" hash="8b637da2ba83dec8d980eba60c629fc2"/><file name="giftcardprice.phtml" hash="b7412477510cc777380db91d18f639f3"/><file name="listprice.phtml" hash="ca21cf3ca82946ccaa20e0041d5e2da6"/><file name="media.phtml" hash="d4099ae7b129834264cef47f57a1bdf4"/><file name="media.phtml~" hash="d4099ae7b129834264cef47f57a1bdf4"/><file name="type.phtml" hash="d89f4b7c024bb550afabc6ab8a123b3e"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kartparadigm_Giftcard.xml" hash="f5df5aa804a3e1df5efa551b8a5e7fe6"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="giftcard"><file name="custom_email_template1.html" hash="ce295b88e3cf44626e469c93fd1e4af3"/></dir></dir></dir><file name="Kartparadigm_Giftcard.csv" hash="dc235c2229d9e2b2b40bf5e4bc69afe2"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="giftcard"><file name="blurbox.js" hash="27da8428a6b04675434e4f5fa6282a45"/><file name="blurbox1.js" hash="1d248e0b91cb6e61264e43c93dc497ce"/><file name="jquery.min-1.11.1.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="giftcard"><file name="bar.gif" hash="aed53f61e4a67494a2829e7d9c32597b"/><file name="clos.png" hash="cfd4a4e03d31233d8a655394e5fdf278"/><file name="greet.jpg" hash="684c53e56cc7dd0cfdfaccdea9f6a58c"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/frontend/base/default/js/giftcard/blurbox.js CHANGED
@@ -13,7 +13,7 @@
13
  body, html { width: 100%; height: 100%; margin: 0; padding: 0; }\
14
  .blurbox-noscroll { overflow: hidden; height: 100%; width: 100%; }\
15
  .blurbox-hidden { display: none !important; }\
16
- #blurbox-wrapper { overflow: auto; overflow-x:hidden;padding: 10px; border-radius: 5px; background-color: white; opacity: 0; position: fixed; top: 50%; left: 50%; z-index: 9999; width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; }\
17
  #blurbox-wrapper.blurbox-small { box-sizing: border-box; }\
18
  #blurbox-wrapper.blurbox-show { opacity: 1; }\
19
  #blurbox-darkenbg { opacity: 0; top: 0; left: 0; z-index: 9998; position: fixed; height: 100%; width: 100%; }\
13
  body, html { width: 100%; height: 100%; margin: 0; padding: 0; }\
14
  .blurbox-noscroll { overflow: hidden; height: 100%; width: 100%; }\
15
  .blurbox-hidden { display: none !important; }\
16
+ #blurbox-wrapper { overflow: auto; overflow-x:hidden; border-radius: 5px; background-color: white; opacity: 0; position: fixed; top: 50%; left: 50%; z-index: 9999; width: 105%; height: 105%; max-width: 105%; max-height: 105%; display: block; }\
17
  #blurbox-wrapper.blurbox-small { box-sizing: border-box; }\
18
  #blurbox-wrapper.blurbox-show { opacity: 1; }\
19
  #blurbox-darkenbg { opacity: 0; top: 0; left: 0; z-index: 9998; position: fixed; height: 100%; width: 100%; }\
skin/frontend/base/default/js/giftcard/blurbox1.js ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function (factory) {
2
+ if (typeof define === 'function' && define.amd) {
3
+ // AMD. Register as an anonymous module.
4
+ define(['jquery'], factory);
5
+ } else {
6
+ // Browser globals
7
+ factory(jQuery);
8
+ }
9
+ }(function ($, undefined) {
10
+ "use strict";
11
+
12
+ var style = '\
13
+ body, html { width: 100%; height: 100%; margin: 0; padding: 0; }\
14
+ .blurbox-noscroll { overflow: hidden; height: 100%; width: 100%; }\
15
+ .blurbox-hidden { display: none !important; }\
16
+ #blurbox-wrapper { overflow: auto; overflow-x:hidden;padding: 10px; border-radius: 5px; background-color: white; opacity: 0; position: fixed; top: 50%; left: 50%; z-index: 9999; width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; }\
17
+ #blurbox-wrapper.blurbox-small { box-sizing: border-box; }\
18
+ #blurbox-wrapper.blurbox-show { opacity: 1; }\
19
+ #blurbox-darkenbg { opacity: 0; top: 0; left: 0; z-index: 9998; position: fixed; height: 100%; width: 100%; }\
20
+ #blurbox-darkenbg.blurbox-show { opacity: 1; }\
21
+ @media (max-width: 480px) {\
22
+ #blurbox-wrapper { margin: 0; left: 0; height: 100%; width: 100%; top: 100%; opacity: 1; border-radius: 0; max-height: none; max-width: none; }\
23
+ #blurbox-wrapper.blurbox-show { top: 0; }\
24
+ }\
25
+ ',
26
+ ffsvg = 'url("data:image/svg+xml;utf8,'+encodeURIComponent('<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><filter id="blur"><feGaussianBlur stdDeviation="')+'{blur}'+encodeURIComponent('" /></filter></svg>')+'#blur")';
27
+
28
+ $('head').append('<style>'+style+'</style>');
29
+ var pluginName = 'blurbox',
30
+ plugin = function( element, options ) {
31
+ this.element = $(element);
32
+ this.options = $.extend( {}, plugin.defaults, options);
33
+ this._init();
34
+ };
35
+
36
+ $.extend(plugin, {
37
+ defaults: {
38
+ blur: 3,
39
+ animateBlur: true,
40
+ duration: 300,
41
+ autosize: true,
42
+ bgColor: 'rgba(0,0,0,0.2)',
43
+ bodyContent: null
44
+ },
45
+ activeBlurbox: null,
46
+ darkenbg: null,
47
+ wrapper: null,
48
+ bodyContent: null,
49
+ styleProps: {
50
+ filter: 'filter',
51
+ transition: 'transition',
52
+ },
53
+ cssProps: {
54
+ filter: 'filter',
55
+ transition: 'transition'
56
+ },
57
+ stylePropVals: {
58
+ filter: 'blur({blur}px)',
59
+ transition: '{prop} {dur}ms'
60
+ },
61
+ stylePrefixes: ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'],
62
+ transitionEndEvents: 'webkitTransitionEnd mozTransitionEnd msTransitionEnd oTransitionEnd',
63
+ _init: function() {
64
+ this.darkenbg = $('#blurbox-darkenbg');
65
+ if(!this.darkenbg.length) {
66
+ this.darkenbg = $('<div id="blurbox-darkenbg" class="blurbox-hidden">');
67
+ $('body').append(this.darkenbg);
68
+ this.darkenbg.click(function() {
69
+ plugin.activeBlurbox.hide();
70
+ });
71
+ }
72
+
73
+ this.wrapper = $('#blurbox-wrapper');
74
+ if(!this.wrapper.length) {
75
+ this.wrapper = $('<div id="blurbox-wrapper" class="blurbox-hidden">');
76
+ $('body').append(this.wrapper);
77
+ }
78
+
79
+ this.bodyContent = $('body').children(':first');
80
+
81
+ this._determineProps();
82
+ },
83
+ _testStylePrefixes: function(s, prop, testVal) {
84
+ // test no prefix first
85
+ if(s[prop] !== undefined) {
86
+ s[prop] = testVal;
87
+ if(s[testprop] === testVal) {
88
+ plugin.styleProps[prop] = prop;
89
+ plugin.cssProps[prop] = prop;
90
+ return;
91
+ }
92
+ }
93
+ var capprop = prop.substr(0,1).toUpperCase()+prop.substr(1),
94
+ testprop;
95
+ $.each(this.stylePrefixes, function(i,v) {
96
+ testprop = v+capprop;
97
+ // check if the property exists
98
+ if(s[testprop] !== undefined) {
99
+ // try setting it (for webkit)
100
+ s[testprop] = testVal;
101
+ if(s[testprop] === testVal) {
102
+ plugin.styleProps[prop] = testprop;
103
+ plugin.cssProps[prop] = '-'+v.toLowerCase()+'-'+prop;
104
+ return false;
105
+ }
106
+ }
107
+ });
108
+ },
109
+ _determineProps: function() {
110
+ var s = $('<div>')[0].style;
111
+ plugin._testStylePrefixes(s, 'filter', 'blur(3px)')
112
+ if(plugin.styleProps.filter === 'filter') {
113
+ // test for moz
114
+ var testval = ffsvg.replace('{blur}',1);
115
+ s.filter = testval;
116
+ if(s.filter === testval) {
117
+ plugin.stylePropVals.filter = ffsvg;
118
+ }
119
+ }
120
+ plugin._testStylePrefixes(s, 'transition', 'width 100ms');
121
+ },
122
+ _applyProp: function(el,prop,subs) {
123
+ var val = plugin.stylePropVals[prop];
124
+ if($.isPlainObject(subs)) {
125
+ $.each(subs, function(k,v) {
126
+ val = val.replace('{'+k+'}', v);
127
+ });
128
+ } else {
129
+ // array of property values
130
+ var vals = [];
131
+ $.each(subs, function(i,sub) {
132
+ $.each(sub, function(k,v) {
133
+ vals.push(val.replace('{'+k+'}', v));
134
+ });
135
+ });
136
+ val = vals.join(', ');
137
+ }
138
+
139
+ el.style[plugin.styleProps[prop]] = val;
140
+ },
141
+ _removeProp: function(el, prop) {
142
+ el.style[plugin.styleProps[prop]] = '';
143
+ },
144
+ hide: function(options) {
145
+ if(this.activeBlurbox) {
146
+ this.activeBlurbox.hide(options);
147
+ }
148
+ }
149
+ });
150
+
151
+ plugin._init();
152
+
153
+ $.extend(plugin.prototype, {
154
+ _init: function() {
155
+ this.displayed = false;
156
+ //this.element.detach();
157
+ this.applyOptions(this.options);
158
+ },
159
+
160
+ applyOptions: function(options) {
161
+ this.options = $.extend( {}, plugin.defaults, options);;
162
+
163
+ this.bodyContent = this.options.bodyContent || plugin.bodyContent;
164
+ this.bodyContent.addClass('blurbox-bodyContent');
165
+
166
+ // apply styles
167
+ var isSmall = $('body').width() <= 480;
168
+ plugin._applyProp(plugin.wrapper[0], 'transition', {prop:isSmall ? 'top' : 'opacity',dur:this.options.duration});
169
+ plugin._applyProp(plugin.darkenbg[0], 'transition', {prop:'opacity',dur:this.options.duration});
170
+ if(this.options.animateBlur) {
171
+ plugin._applyProp(this.bodyContent[0], 'transition', {prop:plugin.cssProps.filter,dur:this.options.duration});
172
+ } else {
173
+ plugin._removeProp(this.bodyContent[0], 'transition');
174
+ }
175
+
176
+ plugin.darkenbg.css('backgroundColor', this.options.bgColor || '');
177
+ },
178
+
179
+ show: function(options) {
180
+ this.applyOptions((options && $.isPlainObject(options)) || {});
181
+
182
+ if(plugin.activeBlurbox) {
183
+ plugin.activeBlurbox.hide();
184
+ }
185
+
186
+ $(document).trigger('blurbox.willShow', this);
187
+
188
+ this.element.detach();
189
+
190
+ var isBig = $('body').width() > 480;
191
+
192
+ plugin.wrapper.addClass(isBig ? 'blurbox-big' : 'blurbox-small');
193
+
194
+ if(isBig && this.options.autosize) {
195
+ this.autosize(true);
196
+ }
197
+
198
+ // prevent scroll on body
199
+ this.bodyContent.addClass('blurbox-noscroll');
200
+ // set the popup content and 'show' it
201
+ plugin.wrapper.html(this.element);
202
+ this.element.show();
203
+ // blur it
204
+ if(isBig && this.options.animateBlur && this.options.blur > 0) {
205
+ plugin._applyProp(this.bodyContent[0], 'filter', {blur:this.options.blur});
206
+ }
207
+ plugin.wrapper.removeClass('blurbox-hidden');
208
+ if(this.options.bgColor) {
209
+ plugin.darkenbg.removeClass('blurbox-hidden');
210
+ }
211
+ if(isBig) {
212
+ plugin.wrapper.css({'margin-left':'-'+(plugin.wrapper.width()/2)+'px', 'margin-top':'-'+(plugin.wrapper.height()/2)+'px'})
213
+ }
214
+
215
+ var t = this,
216
+ endAnim = function() {
217
+ if(!t.options.animateBlur && t.options.blur > 0) {
218
+ plugin._applyProp(t.bodyContent[0], 'filter', {blur:t.options.blur});
219
+ }
220
+ plugin.wrapper.off(plugin.tranisitionEndEvents);
221
+ clearTimeout(timeout);
222
+ },
223
+ timeout;
224
+ // set timeout at 0 to let elements be rendered first after display:none has been removed
225
+ setTimeout(function() {
226
+ plugin.wrapper.addClass('blurbox-show');
227
+ if(t.options.bgColor) {
228
+ plugin.darkenbg.addClass('blurbox-show');
229
+ }
230
+ t.bodyContent.on('click.blurbox', $.proxy(t.hide,t));
231
+
232
+ timeout = setTimeout(endAnim, t.options.duration+50);
233
+ plugin.wrapper.on(plugin.tranisitionEndEvents, endAnim);
234
+ },0);
235
+
236
+ this.displayed = true;
237
+ plugin.activeBlurbox = this;
238
+
239
+ $(document).trigger('blurbox.didShow', this);
240
+
241
+ return this;
242
+ },
243
+
244
+ hide: function(options) {
245
+ this.applyOptions((options && $.isPlainObject(options)) || {});
246
+
247
+ $(document).trigger('blurbox.willHide', this);
248
+ this.bodyContent.off('click.blurbox');
249
+ // allow scroll on body
250
+ this.bodyContent.removeClass('blurbox-noscroll');
251
+ // hide the wrapper
252
+ plugin.wrapper.removeClass('blurbox-show');
253
+ // hide the overlay
254
+ plugin.darkenbg.removeClass('blurbox-show');
255
+ // set a timeout and listen for transition end events, whichever happens first end the animation
256
+ var endAnim = function() {
257
+ // at end of animation, display:none the wrapper
258
+ plugin.wrapper.addClass('blurbox-hidden').removeClass('blurbox-big').removeClass('blurbox-small');
259
+ plugin.wrapper.css({height:'',width:'','margin-left':'', 'margin-top':''});
260
+ // and the overlay
261
+ plugin.darkenbg.addClass('blurbox-hidden');
262
+ // stop listening for animation end events and clear the timeout
263
+ plugin.wrapper.off(plugin.tranisitionEndEvents);
264
+ clearTimeout(timeout);
265
+ },
266
+ timeout = setTimeout(endAnim, this.options.duration);
267
+ plugin.wrapper.on(plugin.tranisitionEndEvents, endAnim);
268
+ plugin._removeProp(this.bodyContent[0], 'filter');
269
+ this.displayed = false;
270
+ plugin.activeBlurbox = null;
271
+ $(document).trigger('blurbox.didHide', this);
272
+ return this;
273
+ },
274
+
275
+ toggle: function(options) {
276
+ return this.displayed ? this.hide(options) : this.show(options);
277
+ },
278
+
279
+ autosize: function(renderOffscreen) {
280
+ if(renderOffscreen) {
281
+ var style = this.element.attr('style');
282
+ // render off screen for size
283
+ this.element.css({position:'absolute',left:'100000px',display:'block'});
284
+ $('body').append(this.element);
285
+ }
286
+ var width = this.element.width();
287
+ var height = this.element.height();
288
+ if(renderOffscreen) {
289
+ this.element.detach();
290
+ style ? this.element.attr('style', style) : this.element.removeAttr('style');
291
+ }
292
+ plugin.wrapper.css({width:width,height:height});
293
+ }
294
+ });
295
+
296
+ $.fn[pluginName] = function ( options ) {
297
+ if(!this.length) return null;
298
+ var p = $.data(this, 'plugin_' + pluginName);
299
+ if (p) { return p; }
300
+ p = new plugin( this, options );
301
+ $.data(this, 'plugin_' + pluginName, p);
302
+ return p;
303
+ };
304
+
305
+ $[pluginName] = plugin;
306
+ }));