magento_remote 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/magento_remote/magento_mech.rb +7 -5
- data/lib/magento_remote/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c046cc78282d2687261608c924e9e819e935e09c
|
4
|
+
data.tar.gz: de3557aa46329e37c88542cec465d1c5dbc11c77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d63fa4e7413c57245cbbaa7e6df4ec28d1259e6e660199e41bbf042d011bc3248a0e77d5f69ee449c500375a3927834c5d5e8298a57caaab617b52c3548fbcef
|
7
|
+
data.tar.gz: 8e19970af5e5b8f8236b2b80b6a50af6d36a8c893d6fb2d39e9757004e9f72d5ad031cb2cd71913cc9dd85974ec79b433bf443f06b9e35805a1f67dba09d3984
|
@@ -236,13 +236,14 @@ class MagentoMech
|
|
236
236
|
return products
|
237
237
|
end
|
238
238
|
|
239
|
-
# Return list [date, volume, link] of last orders
|
239
|
+
# Return list [date, volume, link, id, state] of last orders
|
240
240
|
def last_orders
|
241
241
|
orders_url = relative_url("/customer/account/")
|
242
242
|
@mech.get orders_url
|
243
243
|
@mech.page.search('#my-orders-table tbody tr').map do |order_row|
|
244
|
+
# We should remove the span labels
|
244
245
|
row_columns = order_row.search("td")
|
245
|
-
[row_columns[1].text, row_columns[3].text, row_columns[5].search("a").first[:href]]
|
246
|
+
[row_columns[1].text, row_columns[3].text, row_columns[5].search("a").first[:href], row_columns[0].text[/\d+/], row_columns[4].text]
|
246
247
|
end
|
247
248
|
end
|
248
249
|
|
@@ -268,9 +269,10 @@ class MagentoMech
|
|
268
269
|
@mech.get order_url
|
269
270
|
@mech.page.search('tr.border').map do |tr|
|
270
271
|
product_name = tr.children[1].children[0].content
|
271
|
-
product_sku
|
272
|
-
product_qty
|
273
|
-
|
272
|
+
product_sku = tr.children[3].children[0].content
|
273
|
+
product_qty = tr.children[7].children[1].content[/\d+/] # "Ordered:
|
274
|
+
refunded_qty = tr.children[7].children[1].content[/(?<=Refunded: )\d+/].to_i
|
275
|
+
[product_name, product_sku, product_qty, refunded_qty]
|
274
276
|
end
|
275
277
|
end
|
276
278
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magento_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Wolfsteller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|