PHP 5 e-commerce Development- P58 pdf

5 136 0
PHP 5 e-commerce Development- P58 pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

Administration [ 268 ] Examples of messages the administrator may need to leave for a customer include: Your shipment's tracking number is XXX. Your payment was rejected. Please make alternative arrangements. As requested, we have cancelled your order and a refund has been issued. Your order is currently being processed. Due to a high volume of orders lately, this may take a day or two. Please accept our apologies for the delay. This simply requires two elds on a form, the order status and a custom message box, as illustrated below: Dispatch note When it comes to dispatching customers' orders, a dispatch note would be very useful. This is simply a duplication of the view order screen, with different information in different areas so that the note can be printed and folded to t within a dispatch note envelope, displaying the delivery address suitably. Refunds Depending on our payment method, we may be able to automatically refund a customer with a single click. If this is the case, we could integrate that with the order update screen, so that when we select that an order has been refunded, a refund is automatically issued (if the payment method supports that); or alternatively, if we view an order and click on a refund button, it could then automatically update the order to "refunded". • • • • This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Chapter 13 [ 269 ] Customers area A simple customers area would be useful for listing customers within the store (which can be searched too). This way, if we or the store administrators need to contact a customer, we can simply nd the customer from the list, and view their details such as their name, e-mail address, and default delivery address. We could also view all of the orders associated with that customer at one place. If a customer loses their conrmation details and needs to send ofine payment, this area would help the store administrator deal with a telephone or e-mail enquiry asking for the customer's order reference number. Listing customers The following SQL could be used to list all of our customers: SELECT u.ID, e.default_shipping_name, e.default_shipping_city, u.ID, u.email FROM users u, users_extra e WHERE u.active=1 AND e.user_id=u.ID ORDER BY u.ID ASC We would, of course, wish to paginate the results of this query, limiting the page to 20 or so records, allowing us to navigate through the list, 20 at a time. A customer's orders We already have a query which does this for us from the user account feature; all we need to do is change how we detect the selected user's ID. "SELECT os.name AS status_name, o.ID AS order_id, (o.products_cost + o.shipping_cost) AS cost, DATE_FORMAT(o.timestamp, '%D %b %Y') AS order_placed FROM orders o, order_statuses os WHERE os.ID=o.status AND o.user_id=" . $customer; Miscellaneous Finally, we come to the miscellaneous section of the administration area; this can house any number of aspects that can't be as easily classied as the other features. Shipping With regards to shipping, we need to be able to create a shipping method, manage existing shipping methods, and create and manage shipping rules. This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Administration [ 270 ] Creating a shipping method Creating a shipping method should be quite simple, with one minor complication. Our shipping method just needs to store some basic information: Name Default shipping cost If the method should be the default shipping method One important aspect we need to take into account when creating a shipping method is that we need to create an associated shipping cost for it for each product in the store. This is where the default cost comes into play—if we know the method will have an average cost of $5 for most products in the store, we create it with that default. This way, each product will automatically get a shipping cost of $5, and we can manually update products where this isn't correct. It also means that when we create new products, this default will be there for the new product. If the administrator selects the option for the shipping method to be the default shipping method, we must update the shipping methods table to update any method already set to be default, to ensure it is no longer the default. Voucher codes The other feature we have is voucher codes. We need to be able to create and manage voucher codes from within the administration area. Creating a voucher code Creating a voucher code should be straightforward: we simply need to take the information from the create voucher form, and insert it into one record in the voucher codes table. The only complication is that we need to verify and convert the format of the expiry date. • • • This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Chapter 13 [ 271 ] Summary In this chapter, we have created a centralized administration area that allows administrators to: Get an overview of the store Create new products Edit existing products either by saving changes or creating a product based off another product Delete products Manage categories within the store View and manage orders placed within the store, updating customers as we update the orders View customer proles, their details, and orders associated with their accounts Manage other settings such as shipping methods, shipping rules, and voucher codes In the next chapter, we will look at the security and maintenance of our store, looking at deploying our framework, securing it with SSL certicates, and backing up and restoring our framework in the case of an emergency. • • • • • • • • This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 . will have an average cost of $5 for most products in the store, we create it with that default. This way, each product will automatically get a shipping cost of $5, and we can manually update. tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 . material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Chapter 13 [ 269 ] Customers area A simple customers area would

Ngày đăng: 07/07/2014, 10:20

Từ khóa liên quan

Mục lục

  • Preface

  • PHP e-commerce

    • e-commerce: who, what, where, why?

      • An overview of e-commerce

        • eBay

        • Amazon

        • Brick 'N Mortar stores

        • Service-based companies

        • Why use e-commerce?

        • Rolling out your own framework

          • Why PHP?

          • Why a framework?

          • When to use an existing package?

            • Existing products

            • A look at e-commerce sites

              • iStockphoto

              • WooThemes

              • eBay

              • Amazon

              • Play.com

              • e-commerce: what does it need to do/have?

                • Products

                • Checkout process

                • General

                • Our framework: what is it going to do?

                • Our framework: why is it going to do it?

                  • Juniper Theatricals

                  • Summary

Tài liệu cùng người dùng

Tài liệu liên quan