Skip to content

Commit d4de3d1

Browse files
yasiloghmaniyasiloghmani
andauthored
Add Multi-cart option to Bulk-add and Partial-add "Add to cart" button (#101)
* Add cart-button to BulkOrder to have multi-cart options * remove console and extra spacing * Add multi-cart to quick add + Add create cart button to multi-cart dropdown * Fix responsive design , Add partial add error message to quick order * partial add to cart when user is not loggedIn * Change Bulkd-update error message panel, fix quantity of items added to the cart and empty items sku cart wich added to the cart in quick add * Add responsive design * responsive change in bulk-add * fix the issue with res.errors * add the condition for res.errors * move add to cart btn to left per design * fix issue : clear quantity of item after added successfully Co-authored-by: yasiloghmani <yasaman.loghmani@EP-ML-10062.local>
1 parent 34c3d83 commit d4de3d1

File tree

6 files changed

+739
-122
lines changed

6 files changed

+739
-122
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.0.0",
44
"private": true,
55
"dependencies": {
6-
"@moltin/sdk": "5.5.0",
6+
"@moltin/sdk": "^5.5.0",
77
"@types/node": "^12.0.0",
88
"@types/react": "^16.9.0",
99
"@types/react-dom": "^16.9.0",

src/BulkOrder.scss

Lines changed: 211 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
@import './theme/common';
22

33
.bulkorder {
4+
position: relative;
5+
display: flex;
6+
flex-direction: column-reverse;
47

58
&__form {
6-
max-width: 800px;
9+
max-width: 600px;
710
}
811

912
&__group {
@@ -19,7 +22,7 @@
1922

2023
&__textarea {
2124
width: 100%;
22-
min-height: 400px;
25+
min-height: 200px;
2326
padding: 10px;
2427
font-size: $sizeSmall;
2528
border: 1px solid $secondBorderColor;
@@ -65,30 +68,228 @@
6568
}
6669
}
6770

71+
&__messagewrap {
72+
margin-top: -25px;
73+
}
74+
6875
&__feedback {
6976
width: 100%;
70-
padding: 20px 60px;
71-
position: absolute;
72-
top: 0;
73-
left: 0;
7477
font-size: $sizeSmall;
7578
color: $mainErrorColor;
76-
border: 1px solid $mainErrorColor;
7779
background-color: $mainBackgroundColor;
78-
white-space: pre;
80+
white-space: pre-line;
81+
text-overflow: clip;
82+
line-height: 18px;
83+
max-height: 190px;
84+
overflow-y: auto;
85+
border-radius: 5px;
86+
margin-bottom: 30px;
87+
}
88+
89+
&__addtocartdropdowncontainer {
90+
position: relative;
91+
width: fit-content;
92+
margin-bottom: 20px;
93+
}
94+
95+
&__addtocartdropdownwrap {
96+
max-width: 330px;
97+
display: flex;
98+
}
99+
100+
&__addtocartbtn {
101+
text-align: left;
102+
flex-grow: 1;
103+
text-overflow: ellipsis;
104+
width: 270px;
105+
white-space: nowrap;
106+
overflow: hidden;
107+
}
108+
109+
&__addtocartdropdowntoggle {
110+
width: 50px;
111+
text-align: center;
112+
cursor: pointer;
113+
114+
&.--open {
115+
background-color: $mainColor!important;
116+
}
117+
}
118+
119+
@keyframes rotating {
120+
from {
121+
transform: rotate(0deg);
122+
}
123+
to {
124+
transform: rotate(360deg);
125+
}
126+
}
127+
128+
&__addtocartdropdownicspinner {
129+
animation: rotating 1s linear infinite;
130+
}
131+
132+
&__addtocartdropdowniscaret {
133+
margin: 3px 0;
134+
135+
&.--rotated {
136+
transform: rotate(180deg);
137+
}
138+
}
139+
140+
&__addtocartdropdowncontent {
141+
border: 1px solid $mainColor;
142+
width: 100%;
143+
max-width: 330px;
144+
max-height: 180px;
145+
overflow-x: hidden;
146+
z-index: 1;
147+
}
148+
149+
&__addtocartdropdownbtn {
150+
display: block;
151+
width: 100%;
152+
height: 32px;
153+
padding: 10px;
154+
background-color: $mainBackgroundColor;
155+
color: $firstComplimentColor;
156+
font-size: 13px;
157+
line-height: 13px;
158+
cursor: pointer;
159+
font-weight: bold;
160+
overflow: hidden;
161+
text-overflow: ellipsis;
162+
white-space: nowrap;
163+
164+
&:hover {
165+
background-color: $sixthComplimentBackground;
166+
}
167+
}
168+
169+
&__createcartmodalbg {
170+
position: absolute;
171+
z-index: 1;
172+
top: 0;
173+
bottom: 0;
174+
left: 0;
175+
right: 0;
176+
background: rgba(0, 0, 0, 0.3);
177+
}
178+
179+
&__createcartmodal {
180+
position: absolute;
181+
width: 460px;
182+
padding: 25px;
183+
z-index: 2;
184+
background: $mainNavigationColor;
185+
border: 1px solid $secondBorderColor;
186+
box-sizing: border-box;
187+
top: 50%;
188+
left: 50%;
189+
transform: translate(-50%, -50%);
190+
}
191+
192+
&__createcartheader {
193+
display: flex;
194+
justify-content: space-between;
195+
}
196+
197+
&__createcartheadertext {
198+
font-weight: bold;
199+
font-size: 24px;
200+
}
201+
202+
&__createcartheaderbnt {
203+
cursor: pointer;
204+
}
205+
206+
&__messagewrap {
207+
position: relative;
208+
}
209+
210+
&__clearerrorbtn {
211+
cursor: pointer;
212+
display:block;
213+
position: relative;
214+
left:93%
215+
}
216+
217+
&__clearerrorbtnicon{
218+
fill: $mainErrorColor;
79219
}
80220

81221
@media (max-width: $mobileWidth - 1px) {
82-
&__feedback {
83-
padding: 15px;
222+
223+
.--secondary{
224+
width: 100%;
84225
}
85226
}
86227

87228
@media (max-width: $mobileXSmallWidth - 1px) {
229+
88230
&__btns {
89231
.epbtn {
90232
min-width: 100%;
91233
}
92234
}
235+
236+
&__addtocartdropdowncontainer {
237+
width: 100%;
238+
}
239+
240+
&__addtocartdropdownwrap {
241+
max-width: 100%;
242+
}
243+
244+
&__addtocartdropdowncontent {
245+
max-width: 100%;
246+
}
247+
}
248+
249+
@media screen and (min-width: $tabletSmallWidth) {
250+
display: grid;
251+
grid-template-columns: 2fr 1fr;
252+
column-gap: 40px;
253+
254+
&__group {
255+
width: 600px;
256+
max-width: 800px;
257+
}
258+
259+
&__feedback {
260+
max-height: 390px;
261+
padding:10px;
262+
margin-bottom: 0px;
263+
}
264+
265+
&__messagewrap {
266+
margin-top: 0px;
267+
}
268+
269+
&__textarea {
270+
min-height: 400px;
271+
}
272+
}
273+
@media screen and (min-width: $fullHDWidth) {
274+
275+
&__group {
276+
width: 700px;
277+
}
278+
279+
&__form {
280+
max-width: 700px;
281+
}
282+
}
283+
284+
@media (max-width: $mobileSmallWidth - 1px) {
285+
286+
&__createcartmodalbg {
287+
position: fixed;
288+
}
289+
290+
&__createcartmodal {
291+
height: 100%;
292+
width: 100%;
293+
}
93294
}
94295
}

0 commit comments

Comments
 (0)