Closed AstroProjection closed 3 years ago
I don't see the PR
Will do it, but I wanted to latest version of your main branch so that I can work off of that
Ok, just commited my latest changes
I don't have access to push to your repository
Let me do that then
Try now
https://github.com/Obsession-Boutique/Joannie-Store-Shop/pull/2
Verify and let me know.
It does nothing: [0] DELETE /api/products/6089626dcc7322a7134fa879/reviews 201 323.964 ms - 28
Once I click, the error does not show, but it does not delete. The thing above is the response from the terminal in VSCODE
@AstroProjection
Could you send a pic of the payload that's being sent on the delete request as well as the headers which are being sent
![Uploading Screen Shot 2021-04-28 at 10.34.12 AM.png…]()
Could you you send an screenshot of the payload, it should be the review data that we're sending from the frontend to the back
Where do I find the payload?
Does this help? @AstroProjection Do you think we will have time to complete it today?
@AstroProjection Once we finish this, the next thing I want to integrate is Options. I created a issue about this in the proshop repo as well
https://github.com/Obsession-Boutique/Joannie-Store-Shop/pull/3 - this PR should resolve the issues
Yes it is working now
Ok, I implemented coupons. I think this may be a stupid fix, but when I do multiplication by 0.3 which is supposed to be 30% gives me a bunch of numbers after it. You know for example 3.2993448 when I have .toFixed(2). Any fixes you can think of?
You want me to explain where and what I did?
I'm not sure I understand the question, the float.toFixed(2) isn't working?
Exactly. Ok, so I am using the files cartAction: export const addCoupon = (coupon) => (dispatch) => { let couponDiscount = 0;
// TODO: Get couponDiscount value from db
if (coupon.toLowerCase() === "familydiscount") { couponDiscount = 3; }
if (coupon.toLowerCase() === "militarydiscount") { couponDiscount = 2; }
if (coupon.toLowerCase() === "sacoleiraspecialty") { couponDiscount = 4; }
dispatch({ type: CART_ADD_COUPON, payload: { coupon, couponDiscount }, });
localStorage.setItem("coupon", JSON.stringify(coupon)); localStorage.setItem("couponDiscount", JSON.stringify(couponDiscount)); };
I added a coupon constant in the cart constant: export const CART_ADD_COUPON = "CART_ADD_COUPON";
Added to reducer: case CART_ADD_COUPON: return { ...state, coupon: action.payload.coupon, couponDiscount: action.payload.couponDiscount, };
and in placeorderscreen is:
if (cart.couponDiscount) { cart.totalPrice *= Number(cart.couponDiscount).toFixed(2); }
The major component is in placeorderscreen. So I have the product price for example $7. Then the fee which is like $3.30. Then I get the value from the action and multiply by the cart total. When I add .toFixed(2) or even without toFixes(2) it does nothing. Doesn't constrain to two variables
Add toFixed to the final cart.totalPrice
I did this: if (cart.couponDiscount) { cart.totalPrice.toFixed(2) *= Number(cart.couponDiscount).toFixed(2); } and in terminal got: SyntaxError: /Users/carlitos/shop/frontend/src/screens/PlaceOrderScreen.js: Invalid left-hand side in assignment expression (75:4)
I don't understand why this is doing it because everything is using .toFixed(2) in terms of the totalPrice and all that
if (cart.couponDiscount) {
cart.totalPrice *= Number(cart.couponDiscount).toFixed(2);
cart.totalPrice = cart.totalPrice.toFixed(2);
}
You are multiplying the previous totalPrice with a new float value which will make it behave like that again
Yay, it is working! Thanks. You have been so helpful
I hate to keep bothering you but can we work on a vscode live share session. I started this feature but I was having multiple inputs and it was not passing to cartScreen. It's options
I really appreciate everything you have done for me. I have been trying to get help from other people and all I gotten is I can't help you or I'm busy. So I appreciate you for helping me. It means alot. I know words may not mean a-lot, I would pay you if I had money. Honestly. As a 16 year old, I got into programming last year, and it has been a journey. A great one.
I also found a bug in the reviews. It deleted the review, but when I'm seeing the word, it says 1 review when there is no review
@AstroProjection
Yeah sure, I can help you out, but i'm a bit busy during the day, it's 10AM where I live but in the evening I can try and help you out
Ok, thanks! You really are a lifesaver. It's 12:17 in the night for me. But at the time you messaged me is fine
Can you reply back here when you are available so I can come to this page. I get email notifications when someone replies. Thanks
I think I am doing the calculations wrong, for the coupon I mean. I am getting the 30% of the total and not the total minus the 30%. Any fixes?
Ok, I did this: if (cart.couponDiscount) { var tempDisc = Number(cart.couponDiscount) * cart.totalPrice cart.totalPrice -= tempDisc cart.totalPrice = cart.totalPrice.toFixed(2); }
You think this is efficient?
Are you available now? @AstroProjection
What time is it for you now?
I think I am doing the calculations wrong, for the coupon I mean. I am getting the 30% of the total and not the total minus the 30%. Any fixes?
Total * 0.7 will give you the total after 30% discount
Ok, I did this: if (cart.couponDiscount) { var tempDisc = Number(cart.couponDiscount) * cart.totalPrice cart.totalPrice -= tempDisc cart.totalPrice = cart.totalPrice.toFixed(2); }
You think this is efficient?
It should be fine
It's 8:30, it's been a busy day
I got that working!
On Thu, Apr 29, 2021 at 10:57 AM Akshay Hemant @.***> wrote:
I think I am doing the calculations wrong, for the coupon I mean. I am getting the 30% of the total and not the total minus the 30%. Any fixes?
Total * 0.7 will give you the total after 30% discount
Ok, I did this: if (cart.couponDiscount) { var tempDisc = Number(cart.couponDiscount) * cart.totalPrice cart.totalPrice -= tempDisc cart.totalPrice = cart.totalPrice.toFixed(2); }
You think this is efficient?
It should be fine
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/Obsession-Boutique/Joannie-Store-Shop/issues/1#issuecomment-829308188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3S3GDCRJDRBMOXQR2DTLFXT5ANCNFSM43XDGABA .
https://prod.liveshare.vsengsaas.visualstudio.com/join?79EF46F7F6DD3CA7348F4499315E061DF29C Here is my live share link
Can we continue chatting in discussions?
It's 8:30, it's been a busy day
It's been a busy morning for me too!
@AstroProjection Discussion Link: https://github.com/Obsession-Boutique/Joannie-Store-Shop/discussions/5
Good Morning to you! When will you be able to assist?
Hey good morning, again busy during the day but ask your queries and if I can help i'll give you suggestions
When are you going to be available to help in the programming process? This part I am really confused and have tried multiple times. The other things were things I had integrated in the backend but needed help in the frontend.
Whenever you can help me out like scope it out, I would appreciate it.
On Fri, Apr 30, 2021 at 12:17 AM Akshay Hemant @.***> wrote:
Hey good morning, again busy during the day but ask your queries and if I can help i'll give you suggestions
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/Obsession-Boutique/Joannie-Store-Shop/issues/1#issuecomment-829793200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3UCTKWNTBXEUU4C6PDTLIVM7ANCNFSM43XDGABA .
The thing that I need your help with is adding options and qty in products. Sort of like this:
@AstroProjection
Get started on it and I'll look into it later in the day, make a new branch from your master and make your changes on that
ok
On Fri, Apr 30, 2021 at 1:34 AM Akshay Hemant @.***> wrote:
Get started on it and I'll look into it later in the day, make a new branch from your master and make your changes on that
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/Obsession-Boutique/Joannie-Store-Shop/issues/1#issuecomment-829850525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3RLMXRWO6YEHAOXR6DTLI6NRANCNFSM43XDGABA .
I just pushed it to the branch that I created like you said Are you going to be available now? I updated the branch again. Can we continue in the discussions tab? @AstroProjection Is it 7pm for you? Can you see the new branch? I called it options @AstroProjection
Hey, yea I see the branch, what are you trying to do?
Fixing the issue of Delete Product Review as discussed on https://github.com/bradtraversy/proshop_mern/issues/141
Please update your 'master' branch to your latest changes and push it to origin