Giter Club home page Giter Club logo

ecommerce-website's Introduction

Screenshot Screenshot Screenshot Screenshot Screenshot Screenshot

Basic E-Commerce website(include products show, cart, checkout)

Use boostrap,jQuery, php, mySQl. CSS CLASS
know m-b-20px m-t-0px

File structure and roles

Layout

1.layout_head.php
$SESSION['cart'] html $page_title

2.layout_foot.php
html customized-js(class:update-quantity-form, class:product-id, class:cart-quantity

3.navigation.php
user_id count()

Display products

1.products.php
Define $db, $page_title, $product, $product_image, $cart_item, $action, $page, $records_per_page, $from_record_num, $page_url, $total_rows
call function: read($from_record_num, $records_per_page), rowCount(), count()

2.objects/product.php
Implement read($from_records_num, $records_per_page), count(), readByIds($ids)

3.objects/product_image.php
Implement readFirst()

4.read_products_temp.php
class:m-b-20px product-id product-link m-b-10px w-100-pct product-name w-1-pct
$product_image product_id $id user_id $cart_tiem
call readFirst()

5.pagination.php
class:col-md-12 pagination(bootstrap) m-b-20px m-t-0px
Define $cart_count $total_pages $range $page_url $page

Cart

1.add_to_cart.php
$cart_item user_id product_id $product_id quantity $quantity
call exists() create()
Action: added exists unable_to_add

2.objects/cart_item.php
Implement exists() count() create() read() update() delete() deleteByUser()

3.remove_from_cart.php
Define $product_id($GET['id']
Action:removed

4.update_quantity.php
Define $product_id($GET) $quantity($GET)
Call $cart_item update()
Action:updated unable_to_update

5.cart.php
show all action results
call $cart_count
class:cart-row product-name update-quantity-form product-id input-group cart-quantity input-group-btn update-quantity
!!!update quantity: class is 'update-quantity-form will trigger layout_foot.php javascript $(document).ready function

Checkout

1.checkout.php<br / > $page_title
call $cart_count $quantity
Define $total $item_count $sub_total

class: cart-row

2.place_order.php

tutorial is here!!

https://www.codeofaninja.com/2013/04/shopping-cart-in-php.html

ecommerce-website's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.