Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
soko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
soko
Commits
ea10d923
Commit
ea10d923
authored
Nov 26, 2018
by
gaseema.n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory update
parent
5e8fad5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
index.html
index.html
+3
-4
inventory.js
js/inventory.js
+6
-3
products.js
js/products.js
+7
-5
No files found.
index.html
View file @
ea10d923
...
...
@@ -1442,13 +1442,12 @@
<path
style=
"fill:#231F20;"
d=
"M224,344h64c13.255,0,24-10.745,24-24s-10.745-24-24-24h-64c-13.255,0-24,10.745-24,24 S210.745,344,224,344z M224,312h64c4.418,0,8,3.582,8,8s-3.582,8-8,8h-64c-4.418,0-8-3.582-8-8S219.582,312,224,312z"
></path>
</svg>
</div>
<h5
style=
"margin:0px;font-size: 1.3rem;padding-top: 10px;"
>
SPONSORED PRODUCTS
</h5>
<h5
style=
"margin:0px;font-size: 1.3rem;padding-top: 10px;"
>
Add Items To Your Inventory
</h5>
</div>
<div
class=
"col s12"
>
<div
class=
"row"
>
<div
class=
"input-field col s12"
>
<input
type=
"text"
id=
"check-prod-input"
class=
"autocomplete sponsoredPrd"
placeholder=
"Add Sponsored Products"
>
<label
for=
"check-prod-input"
></label>
<div
class=
"autocomplete"
style=
"width: 90%; display: block; margin: 20px auto;"
>
<input
id=
"check-prod-input"
type=
"text"
name=
"myCountry"
placeholder=
"Add Sponsored Products"
class=
"sponsoredPrd"
>
</div>
</div>
<div
class=
"row sprndProd"
></div>
...
...
js/inventory.js
View file @
ea10d923
...
...
@@ -18,18 +18,21 @@ function sponpProdNamesInput() {
data
:
inputVal
,
filter
:
'sponsored'
}).
then
(
function
(
e
)
{
console
.
log
(
'======================='
)
console
.
log
(
e
)
var
dat
=
{}
var
itemDat
=
new
Array
();
sponProds
=
e
.
products
;
for
(
var
iii
in
e
.
products
)
{
var
nm
=
e
.
products
[
iii
].
name
+
" - "
+
e
.
products
[
iii
].
price
;
var
icn
=
e
.
products
[
iii
].
icon
;
var
itemName
=
e
.
products
[
iii
].
name
//var id = e.users[iii].id;
dat
[
nm
]
=
icn
;
itemDat
.
push
(
itemName
)
}
inventoryInput
=
M
.
Autocomplete
.
init
(
document
.
querySelectorAll
(
'#check-prod-input'
),
{});
inventoryInput
[
0
].
updateData
(
dat
);
autocomplete
(
document
.
getElementById
(
"check-prod-input"
),
itemDat
);
});
}
...
...
js/products.js
View file @
ea10d923
...
...
@@ -171,17 +171,19 @@ $(document).on('touchstart click', '#noSponsoredBtn', function (event) {
$
(
"#rmvSpnsrdProd"
).
hide
();
});
$
(
'#spnsrdModal'
).
on
(
'click'
,
$
(
'ul.autocomplete-content li'
),
function
()
{
var
value
=
$
(
'.sponsoredPrd'
).
val
();
$
(
'#spnsrdModal'
).
on
(
'click'
,
$
(
'.autocomplete-items div'
),
function
()
{
var
value
=
$
(
'#check-prod-input'
).
val
();
console
.
log
(
'============'
)
console
.
log
(
value
)
if
(
value
!=
''
)
{
var
sponsoredProduct
=
$
(
'.sponsoredPrd'
).
val
()
;
var
sponsoredProduct
=
value
;
for
(
var
i
in
sponProds
)
{
var
name
=
sponProds
[
i
].
name
;
var
id
=
sponProds
[
i
].
id
;
var
price
=
sponProds
[
i
].
price
;
if
(
sponsoredProduct
==
name
+
" - "
+
price
)
{
if
(
sponsoredProduct
==
name
)
{
M
.
toast
({
html
:
'Adding sponsored produc'
,
html
:
'Adding sponsored produc
t
'
,
classes
:
'spnsrdTst'
,
displayLength
:
10000
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment