add value ProductLink
This commit is contained in:
parent
b3464278ac
commit
ac5b104eab
|
@ -24,6 +24,7 @@ type paxanWebOrderEntry struct {
|
||||||
Position string
|
Position string
|
||||||
ArticleNumber int
|
ArticleNumber int
|
||||||
Description string
|
Description string
|
||||||
|
ProductLink string
|
||||||
Amount string
|
Amount string
|
||||||
Price string
|
Price string
|
||||||
Total string
|
Total string
|
||||||
|
@ -170,8 +171,13 @@ func paxanGetOrderDetails(client *http.Client, orderNumber int) ([]paxanWebOrder
|
||||||
var row []string
|
var row []string
|
||||||
s.Find(".tableCell").Each(func(j int, s *goquery.Selection) {
|
s.Find(".tableCell").Each(func(j int, s *goquery.Selection) {
|
||||||
text := s.Contents().Text()
|
text := s.Contents().Text()
|
||||||
|
// Column 3 contains some more info
|
||||||
if j == 2 {
|
if j == 2 {
|
||||||
text = s.Find(".lineItemName").Text()
|
text = s.Find(".lineItemName").Text()
|
||||||
|
// Search for the link to the product page
|
||||||
|
linkTag := s.Find("a")
|
||||||
|
link, _ := linkTag.Attr("href")
|
||||||
|
row = append(row, link)
|
||||||
}
|
}
|
||||||
|
|
||||||
text = strings.Replace(text, "\n", "", -1)
|
text = strings.Replace(text, "\n", "", -1)
|
||||||
|
@ -183,13 +189,14 @@ func paxanGetOrderDetails(client *http.Client, orderNumber int) ([]paxanWebOrder
|
||||||
num, _ := strconv.Atoi(row[1])
|
num, _ := strconv.Atoi(row[1])
|
||||||
n := paxanWebOrderEntry{Position: row[0],
|
n := paxanWebOrderEntry{Position: row[0],
|
||||||
ArticleNumber: num,
|
ArticleNumber: num,
|
||||||
Description: row[2],
|
Description: row[3],
|
||||||
Amount: row[3],
|
ProductLink: row[2],
|
||||||
Price: row[4],
|
Amount: row[4],
|
||||||
Total: row[5],
|
Price: row[5],
|
||||||
Amount2: row[6],
|
Total: row[6],
|
||||||
Price2: row[7],
|
Amount2: row[7],
|
||||||
Total2: row[8]}
|
Price2: row[8],
|
||||||
|
Total2: row[9]}
|
||||||
list = append(list, n)
|
list = append(list, n)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -228,6 +235,7 @@ func ExportNewOrders(client *http.Client, lastOrder int) error {
|
||||||
orderDetail.Position + ";" +
|
orderDetail.Position + ";" +
|
||||||
strconv.Itoa(orderDetail.ArticleNumber) + ";" +
|
strconv.Itoa(orderDetail.ArticleNumber) + ";" +
|
||||||
orderDetail.Description + ";" +
|
orderDetail.Description + ";" +
|
||||||
|
orderDetail.ProductLink + ";" +
|
||||||
orderDetail.Amount + ";" +
|
orderDetail.Amount + ";" +
|
||||||
orderDetail.Price + ";" +
|
orderDetail.Price + ";" +
|
||||||
orderDetail.Total + ";" +
|
orderDetail.Total + ";" +
|
||||||
|
|
Loading…
Reference in New Issue