aongkir - Version 1.1.0.0

Version Notes

new feature add / subsctract shipping price & fixed minimum weight

Download this release

Release Info

Developer Ansyori
Extension aongkir
Version 1.1.0.0
Comparing to
See all releases


Code changes from version 1.0.0.4 to 1.1.0.0

app/code/local/Ansyori/Aongkir/Model/Carrier/Ongkir.php CHANGED
@@ -72,9 +72,9 @@ class Ansyori_Aongkir_Model_Carrier_Ongkir
72
  foreach($rates_by_kurir as $final_list)
73
  {
74
  if($weight > 29):
75
- $ship_cost = $final_list['cost'] * $weight;
76
  else:
77
- $ship_cost = $final_list['cost'];
78
  endif;
79
 
80
  $rate_list[] = array(
@@ -94,6 +94,81 @@ class Ansyori_Aongkir_Model_Carrier_Ongkir
94
  return explode(',',strtolower($this->helper()->config('kurir')));
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  public function getOriginId()
98
  {
99
  return $this->helper()->config('origin');
@@ -107,6 +182,10 @@ class Ansyori_Aongkir_Model_Carrier_Ongkir
107
  $totalWeight += ($item->getWeight() * $item->getQty()) ;
108
  }
109
 
 
 
 
 
110
  return $totalWeight;
111
  }
112
 
72
  foreach($rates_by_kurir as $final_list)
73
  {
74
  if($weight > 29):
75
+ $ship_cost = $this->changePrice($final_list['cost']) * $weight;
76
  else:
77
+ $ship_cost = $this->changePrice($final_list['cost']);
78
  endif;
79
 
80
  $rate_list[] = array(
94
  return explode(',',strtolower($this->helper()->config('kurir')));
95
  }
96
 
97
+
98
+ public function changePrice($price)
99
+ {
100
+ $set = $this->helper()->config('changeprice');
101
+
102
+ if(!$set):
103
+ return $price;
104
+
105
+ else:
106
+ /*if (strpos($a,'are') !== false) {
107
+ echo 'true';
108
+ }*/
109
+
110
+ $found_persen = false;
111
+
112
+ if (strpos($set,'%') !== false) {
113
+ //echo 'true';
114
+
115
+ $found_persen = true;
116
+
117
+ $set = str_replace('%','',$set);
118
+ };
119
+
120
+ $found_minus = false;
121
+
122
+ if (strpos($set,'-') !== false) {
123
+ //echo 'true';
124
+
125
+ $found_minus = true;
126
+ $set = str_replace('-','',$set);
127
+
128
+ };
129
+
130
+ $found_plus = false;
131
+
132
+ if (strpos($set,'+') !== false) {
133
+ //echo 'true';
134
+
135
+ $found_plus = true;
136
+ $set = str_replace('+','',$set);
137
+
138
+ };
139
+
140
+ $final_set = $set ;
141
+ $changed_price = 0;
142
+ if($found_persen)
143
+ {
144
+ $changed_price = ($price * $set) / 100;
145
+ }else
146
+ {
147
+ $changed_price = abs($set);
148
+ };
149
+
150
+ if($found_minus)
151
+ {
152
+ return $price - $changed_price;
153
+ };
154
+
155
+ if($found_plus)
156
+ {
157
+ return $price + $changed_price;
158
+ };
159
+
160
+
161
+
162
+
163
+
164
+ //$final_price
165
+
166
+
167
+
168
+ return $price;
169
+ endif;
170
+ }
171
+
172
  public function getOriginId()
173
  {
174
  return $this->helper()->config('origin');
182
  $totalWeight += ($item->getWeight() * $item->getQty()) ;
183
  }
184
 
185
+ if($totalWeight < 1)
186
+ $totalWeight = 1;
187
+
188
+
189
  return $totalWeight;
190
  }
191
 
app/code/local/Ansyori/Aongkir/etc/system.xml CHANGED
@@ -167,6 +167,16 @@
167
  <show_in_store>1</show_in_store>
168
  </jquery>
169
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  </fields>
172
  </ongkir>
167
  <show_in_store>1</show_in_store>
168
  </jquery>
169
 
170
+ <changeprice translate="label">
171
+ <label>Add or Substract Shipping Price by </label>
172
+ <frontend_type>text</frontend_type>
173
+ <sort_order>5</sort_order>
174
+ <show_in_default>1</show_in_default>
175
+ <show_in_website>1</show_in_website>
176
+ <show_in_store>1</show_in_store>
177
+ <comment><![CDATA[example: +5% , +5000 , -5% , -5000 , leave it empty if not necessary, plus(+) or minus (-) sign is MANDATORY to use this feature ]]></comment>
178
+ </changeprice>
179
+
180
 
181
  </fields>
182
  </ongkir>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aongkir</name>
4
- <version>1.0.0.4</version>
5
  <stability>stable</stability>
6
  <license>open source</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Indonesian Shippping Carriers</summary>
10
  <description>Indonesian Shippping Carriers</description>
11
- <notes>fix https issue on checkout</notes>
12
  <authors><author><name>Ansyori</name><user>ansyori</user><email>ansyori@gmail.com</email></author></authors>
13
- <date>2015-05-12</date>
14
- <time>05:58:36</time>
15
- <contents><target name="magelocal"><dir name="Ansyori"><dir name="Aongkir"><dir name="Block"><file name="Index.php" hash="eb68794e0f3220839a02dba0f9f7f105"/></dir><dir name="Helper"><file name="Data.php" hash="053a1cbaebc94470d1c05e34f1c32571"/></dir><dir name="Model"><file name="Area.php" hash="a50294a1ead04ef920bd79c457f4bc8a"/><dir name="Carrier"><file name="Ongkir.php" hash="4bb5434fc91f2a8440c34c2fb9a41330"/></dir><file name="Cron.php" hash="df18b4f51639879ce741063dcd34ce23"/><dir name="Mysql4"><dir name="Area"><file name="Collection.php" hash="5a1d6cfd02be80f7038f3cafd27f3ec1"/></dir><file name="Area.php" hash="79392c31d15280d608e47a12bcda6685"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="City.php" hash="db48d237dd037433d142e7bfd4fbe15a"/><file name="Kurir.php" hash="6b42824b026a709f56faa600e6cf1428"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="0fecc86f6fc58a6bd23375c628cd683e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7524c909e4c0ac821d4e0d41379c04d2"/><file name="config.xml" hash="ad9e0216ad24f345651bb8be9b096d42"/><file name="system.xml" hash="e1213117c56a0585cf75a459a5464a30"/></dir><dir name="sql"><dir name="aongkir_setup"><file name="mysql4-install-1.0.0.php" hash="4e8ba5ec0e19a30d13bb9568be4605eb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="aongkir.xml" hash="ec81d1456c144f706915d4daa6fb14d0"/></dir><dir name="template"><dir name="aongkir"><file name="billing.phtml" hash="3ff4e7d9d8043373bae8700e8c14c467"/><file name="edit.phtml" hash="59d5befe7677f4fad38a92f8a4764074"/><file name="shipping.phtml" hash="c18bcbe1da77b90de0a11efa9138e895"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="aongkir.xml" hash="ec81d1456c144f706915d4daa6fb14d0"/></dir><dir name="template"><dir name="aongkir"><file name="billing.phtml" hash="dac284ef3d6a94bd9775f4e1b8510387"/><file name="edit.phtml" hash="59d5befe7677f4fad38a92f8a4764074"/><file name="shipping.phtml" hash="3434b8c160cd22bbe1a45a5cc6689f41"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ansyori_Aongkir.xml" hash="f7f4be17fe16141cff15994c4f202a0f"/></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>aongkir</name>
4
+ <version>1.1.0.0</version>
5
  <stability>stable</stability>
6
  <license>open source</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Indonesian Shippping Carriers</summary>
10
  <description>Indonesian Shippping Carriers</description>
11
+ <notes>new feature add / subsctract shipping price &amp; fixed minimum weight</notes>
12
  <authors><author><name>Ansyori</name><user>ansyori</user><email>ansyori@gmail.com</email></author></authors>
13
+ <date>2015-05-18</date>
14
+ <time>06:58:25</time>
15
+ <contents><target name="magelocal"><dir name="Ansyori"><dir name="Aongkir"><dir name="Block"><file name="Index.php" hash="eb68794e0f3220839a02dba0f9f7f105"/></dir><dir name="Helper"><file name="Data.php" hash="053a1cbaebc94470d1c05e34f1c32571"/></dir><dir name="Model"><file name="Area.php" hash="a50294a1ead04ef920bd79c457f4bc8a"/><dir name="Carrier"><file name="Ongkir.php" hash="39fdb88f3b03bbc0b68a6835fd6e604d"/></dir><file name="Cron.php" hash="df18b4f51639879ce741063dcd34ce23"/><dir name="Mysql4"><dir name="Area"><file name="Collection.php" hash="5a1d6cfd02be80f7038f3cafd27f3ec1"/></dir><file name="Area.php" hash="79392c31d15280d608e47a12bcda6685"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="City.php" hash="db48d237dd037433d142e7bfd4fbe15a"/><file name="Kurir.php" hash="6b42824b026a709f56faa600e6cf1428"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="0fecc86f6fc58a6bd23375c628cd683e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7524c909e4c0ac821d4e0d41379c04d2"/><file name="config.xml" hash="ad9e0216ad24f345651bb8be9b096d42"/><file name="system.xml" hash="9036decaab9e66c2be1ace814434ccfb"/></dir><dir name="sql"><dir name="aongkir_setup"><file name="mysql4-install-1.0.0.php" hash="4e8ba5ec0e19a30d13bb9568be4605eb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="aongkir.xml" hash="ec81d1456c144f706915d4daa6fb14d0"/></dir><dir name="template"><dir name="aongkir"><file name="billing.phtml" hash="3ff4e7d9d8043373bae8700e8c14c467"/><file name="edit.phtml" hash="59d5befe7677f4fad38a92f8a4764074"/><file name="shipping.phtml" hash="c18bcbe1da77b90de0a11efa9138e895"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="aongkir.xml" hash="ec81d1456c144f706915d4daa6fb14d0"/></dir><dir name="template"><dir name="aongkir"><file name="billing.phtml" hash="dac284ef3d6a94bd9775f4e1b8510387"/><file name="edit.phtml" hash="59d5befe7677f4fad38a92f8a4764074"/><file name="shipping.phtml" hash="3434b8c160cd22bbe1a45a5cc6689f41"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ansyori_Aongkir.xml" hash="f7f4be17fe16141cff15994c4f202a0f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>