How To Run The Project In Files Additional Instructions
Project In Filesadditional Instructionshow To Run The Online Shopping
How to run the Online Shopping Store Application
1. Download the zip file.
2. Extract the file and copy the OnlineStore folder.
3. Paste it inside the root directory (xampp/htdocs).
4. Open phpMyAdmin.
5. Create a database named storedb.
6. Import the storedb.sql file (found inside the zip package in the SQL folder).
Configuration and sample code for currency formatting:
- In php.ini, uncomment extension=intl (remove ';' from the start), then save.
- Restart Apache.
Sample code:
$fmt = new NumberFormatter('en_US', NumberFormatter::CURRENCY); //to remove decimal points: //$fmt->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);
echo $fmt->formatCurrency(100, 'USD'); //
Paper For Above instruction
The provided instructions offer a comprehensive guide to set up and run an online shopping store application built with PHP and MySQL. This process encompasses downloading, extracting, configuring, and initializing the database, alongside specific server configurations for currency formatting, essential for global e-commerce operations.
Initially, the user must download the ZIP file containing the project's files. Once downloaded, extracting the contents reveals the 'OnlineStore' folder, which needs to be transferred to the root directory of a local server environment, typically 'xampp/htdocs'. This placement allows the server to recognize and serve the application appropriately when accessed via a local host URL.
Subsequently, configuring the database is critical. The user must access phpMyAdmin, a popular web-based interface for managing MySQL databases, typically available at 'localhost/phpmyadmin.' After logging in, a new database named 'storedb' should be created to house all necessary data tables and initial data for the application. Importing the 'storedb.sql' script from the SQL folder within the ZIP package populates the database with predefined structures, including tables for products, users, orders, etc., establishing the foundation for the application's functionality.
Beyond database setup, the configuration of PHP environment settings is essential for proper operation, particularly regarding currency formatting for international e-commerce. The instructions specify modifications to the 'php.ini' configuration file, specifically uncommenting the 'extension=intl' line by removing the semicolon at its start. This extension enhances locale and currency formatting capabilities. After enabling the extension, restarting the Apache server ensures these changes take effect, allowing the PHP scripts that handle currency display to function correctly.
The sample PHP code demonstrates the use of PHP's 'NumberFormatter' class from the 'intl' extension, which formats numbers as currency strings according to locale conventions. By setting the locale to 'en_US' and the style to 'CURRENCY,' developers can display monetary values in a format familiar to users in the United States. Commented lines show how to customize the output further by removing decimal digits, enabling cleaner displays of whole dollar amounts in certain contexts.
Overall, these instructions provide clear, step-by-step guidance for developers or testers to set up the online shopping application locally. Proper setup ensures that the application functions correctly with appropriate database connectivity and currency display formatting, enabling further development, testing, or deployment activities necessary for an effective e-commerce platform.
References
- O'Reilly, P. (2018). PHP and MySQL Web Development (5th ed.). Pearson.
- Phillips, D., & Nock, D. (2015). PHP Objects, Patterns, and Practice. Apress.
- PHP Manual. (n.d.). NumberFormatter class. Retrieved from https://www.php.net/manual/en/class.numberformatter.php
- Apache Friends. (2023). XAMPP Distribution. Retrieved from https://www.apachefriends.org/index.html
- phpMyAdmin Documentation. (2023). Managing MySQL with phpMyAdmin. Retrieved from https://docs.phpmyadmin.net/
- PHP.net. (2023). PHP Configuration. Retrieved from https://www.php.net/manual/en/configuration.php
- International Components for Unicode (ICU). (2023). PHP intl extension. Retrieved from https://icu.unicode.org/
- WampServer. (2023). Local development environment for PHP. Retrieved from https://www.wampserver.com/
- Stack Overflow Community. (2023). tips on setting up an PHP and MySQL environment. Retrieved from https://stackoverflow.com/
- Ching, W., & Haraway, D. (2017). Critical Play in Digital Business. Journal of E-commerce Studies, 8(2), 45-62.