### Manage Currency Formatting and Conversion in PHP Source: https://context7.com/oscommerce/oscommerce2/llms.txt Provides examples for formatting prices, performing currency conversions, and calculating totals using the `currencies` class. It covers automatic conversion based on session currency, manual formatting, tax calculations, and retrieving currency-specific information like exchange rates and decimal places. Requires the global `$currencies` object to be initialized. ```php global $currencies; // Initialize currencies (happens automatically in application_top.php) // $currencies = new currencies(); // Format price with currency conversion $formatted = $currencies->format( $number = 29.99, $calculate_currency_value = true, $currency_type = 'USD', $currency_value = '' ); // Returns: "$29.99" (with appropriate symbol and formatting) // Format without currency conversion (already in target currency) $formatted = $currencies->format( $number = 29.99, $calculate_currency_value = false, $currency_type = 'EUR' ); // Returns: "€29.99" // Calculate price with tax and quantity $price = $currencies->calculate_price( $products_price = 19.99, $products_tax = 20, // 20% tax $quantity = 3 ); // Returns: 23.99 * 3 = 71.97 // Display formatted price with tax $display = $currencies->display_price( $products_price = 19.99, $products_tax = 20, $quantity = 2 ); // Returns: "$47.98" (formatted with currency symbol) // Check if currency code exists if ($currencies->is_set('GBP')) { echo "British Pound is available"; } // Get currency exchange rate value $rate = $currencies->get_value('EUR'); // Returns: 0.85 (example rate) // Get decimal places for currency $decimals = $currencies->get_decimal_places('JPY'); // Returns: 0 (Yen has no decimals) // Format raw number without currency symbols (for calculations) $raw = $currencies->format_raw( $number = 29.99, $calculate_currency_value = true, $currency_type = 'USD' ); // Returns: "29.99" (number only, no symbols) // Display raw price (useful for hidden form fields) $raw_display = $currencies->display_raw( $products_price = 19.99, $products_tax = 20, $quantity = 1 ); // Returns: "23.99" ``` -------------------------------- ### Manage Payment Modules in osCommerce 2 Source: https://context7.com/oscommerce/oscommerce2/llms.txt Handles initialization, management, and processing of payment methods using dynamic module loading. It supports automatic discovery of installed payment gateways and provides methods for accessing, validating, and processing payments throughout the checkout flow. Dependencies include the `payment` class and potentially session management. ```php use OSC\OM\Registry; // Initialize payment class with all available methods $payment = new payment(); // Automatically loads all installed payment modules from MODULE_PAYMENT_INSTALLED // Initialize with specific payment module $payment = new payment('paypal_express'); // Access available payment modules foreach ($payment->modules as $module_name) { echo "Available: " . $module_name . "\n"; } // Output: paypal_express.php, stripe.php, cod.php // Get selected payment module if (isset($payment->selected_module)) { echo "Selected payment: " . $payment->selected_module; } // Access payment module form action URL (for external gateways) if (isset($payment->form_action_url)) { echo '
'; // Payment gateway will be: https://www.paypal.com/cgi-bin/webscr } // Update payment status based on order destination $payment->update_status(); // Modules can enable/disable based on shipping country, order total, etc. // Get available payment methods for display $payment->javascript_validation(); // Returns JavaScript for client-side validation // Get payment module selection HTML $payment_selection = $payment->selection(); // Returns array with payment method details for checkout page: // [ // 'id' => 'paypal_express', // 'module' => 'PayPal Express Checkout', // 'fields' => [...] // Module-specific form fields // ] // Process payment before order creation $payment->pre_confirmation_check(); // Validates payment information before final confirmation // Get payment module confirmation details $confirmation = $payment->confirmation(); // Returns HTML or array with payment details for confirmation page // Process payment and get redirect info $payment_result = $payment->process_button(); // Returns hidden form fields for payment gateway redirect // Complete payment processing after order creation $payment->after_process(); // Handles post-order payment tasks (capture, logging, etc.) // Example: Complete checkout flow with payment if (isset($_POST['payment'])) { $_SESSION['payment'] = $_POST['payment']; } $payment = new payment($_SESSION['payment']); $payment->update_status(); // Display on checkout page $selection = $payment->selection(); echo ''; echo $selection['module']; // Before order confirmation $payment->pre_confirmation_check(); // After order is created $order_id = 1234; // Newly created order ID $payment->after_process(); // Get payment method for registry (App-based modules) if (strpos($_SESSION['payment'], '\\') !== false) { $code = 'Payment_' . str_replace('\\', '_', $_SESSION['payment']); $OSCOM_PM = Registry::get($code); echo $OSCOM_PM->title; } ``` -------------------------------- ### OSCommerce Core Framework Functions (PHP) Source: https://context7.com/oscommerce/oscommerce2/llms.txt Utilize the OSCOM core class for framework functionalities such as initialization, version retrieval, URL generation for catalog and admin pages, image and public resource linking, redirection, configuration management, route checking, language definition retrieval, site loading, and getting the current site. Dependencies include the OSC\OM\OSCOM and OSC\OM\Registry namespaces. ```php use OSC\OM\OSCOM; use OSC\OM\Registry; // Initialize the framework OSCOM::initialize(); // Sets timezone, error handling, and request type (HTTP/HTTPS) // Get osCommerce version $version = OSCOM::getVersion(); // Returns: "2.4.0" (example) // Generate link to catalog page $url = OSCOM::link( $page = 'product_info.php', $parameters = 'products_id=42&category=electronics', $add_session_id = true, $search_engine_safe = true ); // Returns: "http://example.com/catalog/product_info.php?products_id=42&category=electronics" // Or with SEO: "http://example.com/catalog/product_info.php/products_id/42/category/electronics" // Generate link to another site section $admin_url = OSCOM::link( $page = 'Admin/index.php', $parameters = 'selected_box=customers' ); // Generate image link $image_url = OSCOM::linkImage('products/laptop.jpg'); // Returns: "http://example.com/catalog/images/products/laptop.jpg" // Generate public resource link $public_url = OSCOM::linkPublic('css/stylesheet.css'); // Redirect to another page OSCOM::redirect('shopping_cart.php', 'action=view'); // Immediately redirects browser to shopping cart // Get configuration value $http_server = OSCOM::getConfig('http_server', 'Shop'); // Returns: "https://www.example.com" // Set configuration value OSCOM::setConfig('session_timeout', 3600, 'global'); // Check if configuration exists if (OSCOM::configExists('db_server')) { $db = OSCOM::getConfig('db_server'); } // Check route matching for RESTful patterns if (OSCOM::hasRoute(['api', 'v1', 'products'])) { // Handle API request: /api/v1/products } // Get language definition $text = OSCOM::getDef('text_welcome'); // Returns localized string from language files // Check if site exists if (OSCOM::siteExists('Admin')) { OSCOM::loadSite('Admin'); } // Get current site $current_site = OSCOM::getSite(); // Returns: "Shop" or "Admin" ``` -------------------------------- ### osCommerce 2 Utility Functions for Data Processing Source: https://context7.com/oscommerce/oscommerce2/llms.txt Provides essential helper functions for manipulating strings, managing GET parameters, performing calculations, and handling tax-related operations. These functions ensure consistent data processing across the application. They are often used in conjunction with global variables like `$currencies`. ```php // Break long words with line break character $broken_text = tep_break_string( $string = "verylongproductnamewithoutspaces", $len = 20, $break_char = '-' ); // Returns: "verylongproductnamew-ithoutspaces" // Get all GET parameters except specified ones $params = tep_get_all_get_params(['action', 'payment']); // If URL is: page.php?id=5&action=buy&sort=price // Returns: "id=5&sort=price" // Round number to specific decimal places $rounded = tep_round(19.996, 2); // Returns: 20.00 // Check if value is not null/empty if (tep_not_null($customer_name)) { echo $customer_name; } // Add tax to price $price_with_tax = tep_add_tax( $price = 100, $tax = 20 // 20% tax ); // Returns: 120.00 // Get tax rate for product class and location $tax_rate = tep_get_tax_rate( $class_id = 1, // Tax class $country_id = 223, // USA $zone_id = 12 // California ); // Returns: 8.5 (8.5% tax rate) // Get tax description $tax_desc = tep_get_tax_description( $class_id = 1, $country_id = 223, $zone_id = 12 ); // Returns: "CA Sales Tax" // Example: Build dynamic product link $product_id = 42; $category_id = 15; $base_url = 'product_info.php'; $current_params = tep_get_all_get_params(['action', 'products_id']); $product_url = OSCOM::link( $base_url, $current_params . '&products_id=' . $product_id ); echo 'View Product'; // Example: Calculate and display price with tax $base_price = 99.99; $tax_class = 1; $country = 223; $zone = 12; $tax_rate = tep_get_tax_rate($tax_class, $country, $zone); $final_price = tep_add_tax($base_price, $tax_rate); $rounded_price = tep_round($final_price, 2); global $currencies; echo $currencies->format($rounded_price); // Displays: "$108.49" (with 8.5% tax) ``` -------------------------------- ### Get Product Details with osCommerce Functions Source: https://context7.com/oscommerce/oscommerce2/llms.txt Retrieves product names, special prices, and stock quantities using osCommerce's built-in functions. It handles multilingual product names and checks for sale prices, returning false if no special price is set. Stock functions return the current quantity or a warning message if stock is insufficient. ```php use OSC\OM\Registry; // Get product name in current language $product_name = tep_get_products_name(42); // Returns: "Dell XPS 15 Laptop" // Get product name in specific language $OSCOM_Language = Registry::get('Language'); $german_name = tep_get_products_name(42, 2); // Language ID 2 // Returns: "Dell XPS 15 Laptop" (German translation) // Get special/sale price if product is on sale $special_price = tep_get_products_special_price(42); if ($special_price !== false) { echo "Sale price: $" . $special_price; } else { echo "No special price available"; } // Get current stock quantity $stock = tep_get_products_stock(42); echo "Available quantity: " . $stock; // Check if stock is sufficient for order $stock_message = tep_check_stock( $products_id = 42, $products_quantity = 5 ); if (!empty($stock_message)) { echo $stock_message; } // Returns: 'Out of Stock' if insufficient ``` -------------------------------- ### Create and Query Orders in PHP Source: https://context7.com/oscommerce/oscommerce2/llms.txt Demonstrates how to create new orders from cart data and retrieve existing orders by ID. It shows how to access order information, customer details, shipping and billing addresses, and product specifics. Dependencies include the `order` class and session data. ```php use OSC\OM\Registry; // Create new order from current cart and session data $order = new order(); // Automatically populates from $_SESSION['cart'], $_SESSION['customer_id'], // $_SESSION['sendto'], $_SESSION['billto'], $_SESSION['payment'] // Access order information echo "Currency: " . $order->info['currency']; echo "Total: " . $order->info['total']; echo "Payment: " . $order->info['payment_method']; echo "Shipping: " . $order->info['shipping_method']; echo "Subtotal: " . $order->info['subtotal']; echo "Tax: " . $order->info['tax']; // Access customer information echo "Customer: " . $order->customer['firstname'] . " " . $order->customer['lastname']; echo "Email: " . $order->customer['email_address']; echo "Phone: " . $order->customer['telephone']; echo "Address: " . $order->customer['street_address'] . ", " . $order->customer['city']; // Access delivery information if ($order->delivery !== false) { echo "Ship to: " . $order->delivery['firstname'] . " " . $order->delivery['lastname']; echo "Address: " . $order->delivery['street_address']; echo "City: " . $order->delivery['city'] . ", " . $order->delivery['state']; echo "Postal: " . $order->delivery['postcode']; } // Access billing information echo "Bill to: " . $order->billing['firstname'] . " " . $order->billing['lastname']; // Access ordered products foreach ($order->products as $product) { echo "Product: " . $product['name']; echo "Model: " . $product['model']; echo "Quantity: " . $product['qty']; echo "Price: " . $product['price']; echo "Final Price: " . $product['final_price']; echo "Tax: " . $product['tax'] . "% "; // Access product attributes if present if (isset($product['attributes'])) { foreach ($product['attributes'] as $attr) { echo " " . $attr['option'] . ": " . $attr['value']; echo " Price modifier: " . $attr['prefix'] . $attr['price']; } } } // Load existing order by ID $existing_order = new order(1234); // Query method automatically populates order details from database // Access order totals foreach ($existing_order->totals as $total) { echo $total['title'] . ": " . $total['text']; } ``` -------------------------------- ### Accessing Core Services via Registry Pattern in PHP Source: https://context7.com/oscommerce/oscommerce2/llms.txt Demonstrates how to retrieve instances of core services such as the database, language, and session managers using the Registry::get() method. It also shows how to set custom objects and check for their existence within the registry. This pattern is fundamental for accessing shared resources throughout the osCommerce application. ```php use OSC\OM\Registry; // Get database instance $OSCOM_Db = Registry::get('Db'); // Get language instance $OSCOM_Language = Registry::get('Language'); $current_language_id = $OSCOM_Language->getId(); // Returns: 1 (English) or 2 (German), etc. // Get session instance $OSCOM_Session = Registry::get('Session'); if ($OSCOM_Session->hasStarted()) { echo "Session active"; } // Get site instance $OSCOM_Site = Registry::get('Site'); $current_site = $OSCOM_Site->getName(); // Set custom object in registry $my_service = new MyCustomService(); Registry::set('MyService', $my_service); // Check if registry entry exists if (Registry::exists('Payment_paypal_express')) { $paypal = Registry::get('Payment_paypal_express'); echo $paypal->title; } // Get registered payment module $payment_code = 'Payment_' . str_replace('\\', '_', 'PayPal\Express'); if (Registry::exists($payment_code)) { $OSCOM_PM = Registry::get($payment_code); echo $OSCOM_PM->public_title; } // Example: Complete database and language operation $OSCOM_Db = Registry::get('Db'); $OSCOM_Language = Registry::get('Language'); $Qproduct = $OSCOM_Db->prepare('select products_name from :table_products_description where products_id = :products_id and language_id = :language_id'); $Qproduct->bindInt(':products_id', 42); $Qproduct->bindInt(':language_id', $OSCOM_Language->getId()); $Qproduct->execute(); if ($Qproduct->fetch() !== false) { echo $Qproduct->value('products_name'); } // Example: Access session and force cookie usage check $OSCOM_Session = Registry::get('Session'); if ($OSCOM_Session->isForceCookies() === false) { // Session ID can be in URL if (strlen(SID) > 0) { echo "Session ID: " . session_id(); } } ``` -------------------------------- ### OSCommerce Database Operations (PHP) Source: https://context7.com/oscommerce/oscommerce2/llms.txt Perform database queries using the Registry-based database abstraction layer. Supports prepared statements, parameter binding (integer, value, string), fetching single or multiple rows, retrieving results as an array, and performing INSERT, UPDATE, and DELETE operations with automatic table prefix handling. Requires the OSC\OM\Registry namespace. ```php use OSC\OM\Registry; // Get database instance from Registry $OSCOM_Db = Registry::get('Db'); // Prepare and execute SELECT query with bound parameters $Qproduct = $OSCOM_Db->prepare('select products_id, products_name, products_price, products_quantity from :table_products where products_id = :products_id and products_status = 1'); $Qproduct->bindInt(':products_id', 42); $Qproduct->execute(); // Fetch single row if ($Qproduct->fetch() !== false) { $product_name = $Qproduct->value('products_name'); $price = $Qproduct->valueDecimal('products_price'); $quantity = $Qproduct->valueInt('products_quantity'); $id = $Qproduct->valueInt('products_id'); echo "$product_name: $$price (Stock: $quantity)"; } // Fetch multiple rows $Qproducts = $OSCOM_Db->prepare('select products_id, products_name, products_price from :table_products where products_quantity > :min_qty order by products_name'); $Qproducts->bindInt(':min_qty', 10); $Qproducts->execute(); while ($Qproducts->fetch()) { echo $Qproducts->value('products_name') . ": "; echo "$" . $Qproducts->valueDecimal('products_price') . "\n"; } // Get result as array $Qcustomer = $OSCOM_Db->prepare('select customers_firstname, customers_lastname, customers_email_address from :table_customers where customers_id = :customers_id'); $Qcustomer->bindInt(':customers_id', $_SESSION['customer_id']); $Qcustomer->execute(); $customer_data = $Qcustomer->toArray(); // Returns: ['customers_firstname' => 'John', 'customers_lastname' => 'Doe', ...] // INSERT/UPDATE using save method (auto-detects operation) $OSCOM_Db->save('customers_basket', [ 'customers_id' => $_SESSION['customer_id'], 'products_id' => '42', 'customers_basket_quantity' => 2, 'customers_basket_date_added' => date('Ymd') ]); // UPDATE with WHERE conditions $OSCOM_Db->save('customers_basket', ['customers_basket_quantity' => 5], ['customers_id' => $_SESSION['customer_id'], 'products_id' => '42'] ); // DELETE records $OSCOM_Db->delete('customers_basket', [ 'customers_id' => $_SESSION['customer_id'], 'products_id' => '42' ]); // Simple query without parameters $Qcurrencies = $OSCOM_Db->query('select code, title, symbol_left, value from :table_currencies order by title'); while ($Qcurrencies->fetch()) { echo $Qcurrencies->value('title') . " (" . $Qcurrencies->value('code') . ")\n"; } // Bind string value $Qsearch = $OSCOM_Db->prepare('select products_id, products_name from :table_products_description where products_name like :search_term'); $Qsearch->bindValue(':search_term', '%laptop%'); $Qsearch->execute(); ``` -------------------------------- ### Display Product Price and Manage Cart with Stock Check Source: https://context7.com/oscommerce/oscommerce2/llms.txt Demonstrates how to display a product's price, prioritizing the special price if available, and how to add a product to the shopping cart only after confirming sufficient stock. The `tep_check_stock` function is used to validate quantity against available stock. ```php $product_id = 42; $product_name = tep_get_products_name($product_id); $regular_price = 999.99; $special_price = tep_get_products_special_price($product_id); if ($special_price !== false) { echo "$product_name: $$regular_price $$special_price"; } else { echo "$product_name: $$regular_price"; } // Check stock before adding to cart $requested_qty = 3; $stock_warning = tep_check_stock($product_id, $requested_qty); if (empty($stock_warning)) { $_SESSION['cart']->add_cart($product_id, $requested_qty); echo "Added to cart successfully"; } else { echo "Cannot add to cart: " . strip_tags($stock_warning); } ``` -------------------------------- ### Manage Shopping Cart in PHP Source: https://context7.com/oscommerce/oscommerce2/llms.txt This snippet demonstrates how to manage the shopping cart in osCommerce using PHP. It covers adding products with and without attributes, checking product existence, updating quantities, removing items, retrieving cart contents, calculating totals, and clearing the cart. It assumes the cart object is initialized from the session. ```php // Initialize shopping cart from session $cart = $_SESSION['cart']; // Add a simple product to cart $cart->add_cart( $products_id = 42, $qty = 2, $attributes = '', $notify = true ); // Add product with attributes (e.g., size and color options) $cart->add_cart( $products_id = 15, $qty = 1, $attributes = [ 1 => 3, // Option ID 1 (Size) => Value ID 3 (Large) 2 => 7 // Option ID 2 (Color) => Value ID 7 (Blue) ], $notify = true ); // Check if product is in cart if ($cart->in_cart('42')) { echo "Product is in cart"; } // Get product quantity $quantity = $cart->get_quantity('42'); // Returns: 2 // Update product quantity $cart->update_quantity('42', 5); // Remove product from cart $cart->remove('42'); // Get all cart products with details $products = $cart->get_products(); foreach ($products as $product) { echo $product['name'] . ": " . $product['quantity'] . " x " . $product['final_price']; } // Calculate and show cart total $cart->calculate(); $total = $cart->show_total(); // Returns calculated total $weight = $cart->show_weight(); // Returns total weight // Count total items $item_count = $cart->count_contents(); // Returns: 5 // Clear entire cart $cart->reset(true); // true = also delete from database ``` -------------------------------- ### Define osCommerce v2 Products Table Schema Source: https://github.com/oscommerce/oscommerce2/blob/master/catalog/includes/OSC/Schema/products.txt This SQL statement defines the 'products' table for osCommerce v2. It includes columns for product ID, quantity, model, image, price, dates, weight, status, tax class, manufacturer, order count, and GTIN. It also sets the primary key, defines indexes for efficient querying, and specifies the InnoDB engine with UTF8 character set. ```sql CREATE TABLE products ( products_id int NOT NULL AUTO_INCREMENT, products_quantity int(4) NOT NULL, products_model varchar(255), products_image varchar(255), products_price decimal(15,4) NOT NULL, products_date_added datetime NOT NULL, products_last_modified datetime, products_date_available datetime, products_weight decimal(5,2) NOT NULL, products_status tinyint(1) NOT NULL, products_tax_class_id int NOT NULL, manufacturers_id int, products_ordered int DEFAULT 0 NOT NULL, products_gtin char(14), PRIMARY KEY (products_id), KEY idx_products_model (products_model), KEY idx_products_date_added (products_date_added) ) ENGINE=InnoDB CHARACTER SET=utf8 COLLATE=utf8_unicode_ci; ``` -------------------------------- ### PHP Define Function for Language Definitions Source: https://github.com/oscommerce/oscommerce2/blob/master/catalog/admin/includes/languages/english/define_language.txt Demonstrates how to use the PHP define() function to set language-specific text strings in osCommerce. It highlights that single quotes within the defined string must be escaped with a backslash. This method is essential for internationalization. ```php define('TEXT_MAIN', 'This text can be edited. It\'s really easy to do!'); ``` -------------------------------- ### osCommerce v2 Orders Table SQL Schema Source: https://github.com/oscommerce/oscommerce2/blob/master/catalog/includes/OSC/Schema/orders.txt Defines the 'orders' table structure for osCommerce v2. It includes columns for order identification, customer information, addresses (delivery and billing), payment details, order status, and timestamps. Key constraints like primary key and indexes are also specified. ```sql CREATE TABLE orders ( orders_id int NOT NULL AUTO_INCREMENT, customers_id int NOT NULL, customers_name varchar(255) NOT NULL, customers_company varchar(255), customers_street_address varchar(255) NOT NULL, customers_suburb varchar(255), customers_city varchar(255) NOT NULL, customers_postcode varchar(255) NOT NULL, customers_state varchar(255), customers_country varchar(255) NOT NULL, customers_telephone varchar(255) NOT NULL, customers_email_address varchar(255) NOT NULL, customers_address_format_id int(5) NOT NULL, delivery_name varchar(255), delivery_company varchar(255), delivery_street_address varchar(255), delivery_suburb varchar(255), delivery_city varchar(255), delivery_postcode varchar(255), delivery_state varchar(255), delivery_country varchar(255), delivery_address_format_id int(5), billing_name varchar(255) NOT NULL, billing_company varchar(255), billing_street_address varchar(255) NOT NULL, billing_suburb varchar(255), billing_city varchar(255) NOT NULL, billing_postcode varchar(255) NOT NULL, billing_state varchar(255), billing_country varchar(255) NOT NULL, billing_address_format_id int(5) NOT NULL, payment_method varchar(255) NOT NULL, cc_type varchar(20), cc_owner varchar(255), cc_number varchar(32), cc_expires varchar(4), last_modified datetime, date_purchased datetime, orders_status int(5) NOT NULL, orders_date_finished datetime, currency char(3), currency_value decimal(14,6), PRIMARY KEY (orders_id), KEY idx_orders_customers_id (customers_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ``` -------------------------------- ### Manipulate Product IDs with Attributes in osCommerce Source: https://context7.com/oscommerce/oscommerce2/llms.txt Provides functions to extract a base product ID from a string that includes attribute information and to generate a unique product ID string incorporating product ID and attribute details. `tep_get_prid` cleans the ID, while `tep_get_uprid` constructs it. ```php // Get product ID from string (handles product IDs with attributes) $clean_product_id = tep_get_prid('42{1}3{2}7'); // Product 42 with attributes // Returns: 42 // Get unique product ID string with attributes $unique_id = tep_get_uprid(42, [1 => 3, 2 => 7]); // Returns: "42{1}3{2}7" ``` -------------------------------- ### Check for Product Attributes in osCommerce Source: https://context7.com/oscommerce/oscommerce2/llms.txt A simple function to determine if a product has any associated attributes or options, such as size or color variations. This is useful for conditional logic in product displays or cart additions. ```php // Check if product has attributes/options if (tep_has_product_attributes(42)) { echo "Product has options (size, color, etc.)"; } ``` -------------------------------- ### Define osCommerce v2 Address Book Table Schema Source: https://github.com/oscommerce/oscommerce2/blob/master/catalog/includes/OSC/Schema/address_book.txt This SQL statement defines the 'address_book' table for osCommerce v2. It includes fields for storing customer address details, constraints like NOT NULL and auto_increment, and specifies the storage engine and character set. ```sql CREATE TABLE address_book ( address_book_id int NOT NULL AUTO_INCREMENT, customers_id int NOT NULL, entry_gender char(1), entry_company varchar(255), entry_firstname varchar(255) NOT NULL, entry_lastname varchar(255) NOT NULL, entry_street_address varchar(255) NOT NULL, entry_suburb varchar(255), entry_postcode varchar(255) NOT NULL, entry_city varchar(255) NOT NULL, entry_state varchar(255), entry_country_id int DEFAULT 0 NOT NULL, entry_zone_id int DEFAULT 0 NOT NULL, PRIMARY KEY (address_book_id), KEY idx_address_book_customers_id (customers_id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.