REST style E-Commerce Website with JavaScript & PHP | no frameworks or libraries | part VII

preview_player
Показать описание
Session Based Shopping Cart Implementation
In this playlist we will journey together to build a complete e-commerce website and will learn following professionally sought after skills:
1. REST API based .
2. SPA: Single Page Application for faster loading.
3. Code separation between frontend & backend.
4. Frontend & backend as two separate websites that communicate over FETCH API
5. Understand and handle CORS (Cross-Site-Resource-Sharing) related issues..
6. Frontend implementation in JS, backend implementation in PHP.
7. No Frameworks or libraries; able to code and develop without any framework crutches.
And much more...

#jsproject , #phpproject, #ecommerc, #ecommercewebsite, #HTMLcssJS, #HTML-CSS-JS-Php,
#SinglePageApplication, #SPA, #RESTapiBasedWebsite, #RESTapiBasedEcommerceWebsite, #facade, #FacadeDesignPattern
#php, #CORS, #fetch, #FetchApi, #REST
Рекомендации по теме
Комментарии
Автор

Amazing! No words! Please upload the next part as soon as possible! Many thanks!

UserL
Автор

Hi how are things.
I'm almost done with the videos you've posted, and I've learned a lot, but here we go.
Will you post more videos?
Bye.

beticohernandez
Автор

Hello.
It's new to me how you work the java script to some things with the innerHTML

I added the bootstrap template and that's it, submerce creates the modals with javascript.
Could you please explain to me how you use javascript to document me better at times I get confused.

beticohernandez
Автор

Voy a empezar tu proyecto de nuevo, ¿con myadmin para la base de datos se ppuede?

beticohernandez
Автор

Hello again,

So my script ran into an error as soon as I added a second item to the shopping cart. The foreach loop in the updateTotalCart does not find the key 'price' in the previously added key 'total'.
I have no idea why this didn't trigger any misbehavior for you, but I had to prefix the following code to get it to work.

if(array_key_exists('total', $_SESSION['cart'])) {

}

stadtminish
Автор

El problema me daba en esta linea:
while ($name = {
array_push($arr, $name);
Le quite el name que esta en corchetes y me funciono.

beticohernandez
Автор

Thanks.
My mistake is because I don't use the database manager that you use, so I usually use myadmin.

beticohernandez
Автор

Hola.
{cart: Array(0)}


{cart: {…}}cart: {2: {…}, total: 500}[[Prototype]]: Object
{id: '2', image: 'pola.jpg', price: '500', stock: 20}


Cuando agrego un producto por primera vez no hay problemas pero cuando lo vuelvo a agregar me sale :
SyntaxError: Unexpected token '<', "<br />
<b>"... is not valid JSON

beticohernandez
Автор

Thanks for this great tutorial.

Unfortunately, the following error occurs for me as soon as I include the db.php twice, like in your video, when cart.php is called and the two files guest_user_cart.php and logged_user_cart.php are included:

SyntaxError: Unexpected token '<', "<br />
<b>"... is not valid JSON

I can't explain this, except that PHP has recently had a problem with including the same file multiple times.

stadtminish
Автор

Hello. What a pity to bother you. I tried again with your project but I get this error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

beticohernandez
Автор

Hello,
I have paused the project because I ran into a problem and I have not found the solution.
I'm in video 7 I add a product to the cart fine, but when I add it again I get a warning
From invalid json.
I have checked but I can't find the error.

beticohernandez
Автор

I am going to complete your project, there is still a bug that I hope you will enlighten me on when you can.
I tell you in the session_start and if several products are added to the cart, but the quantity does not add up when adding the same product.
Finally, don't forget about your student.

beticohernandez
Автор

No he podido traer los productos en el menu categorias me sale esa arventencia en consola
SyntaxError: Unexpected token '<', "<br />
<b>"... is not valid JSON
jjajajajajaj
Siempre hay problemas.

beticohernandez
Автор

No me has contestado ¿en que pais estas o de donde eres?, yo soy Colombiano.

beticohernandez
Автор

Ya entro al 4 video me esta funcionando todo.

beticohernandez
Автор

Hello, in the first video in the console it shows me the categories but when I print it I get an object.
hahahaha

beticohernandez
welcome to shbcf.ru