### Joomla Plugin Installation Files Source: https://github.com/j2commerce/guide/blob/master/integrations/integrations/zoo.md This snippet lists the core plugin packages that need to be installed via the Joomla Extension Manager for the Zoo J2Store integration. Ensure these are installed and enabled to activate the e-commerce functionality for Zoo items. ```xml plg_itemjtwostore.tar.gz plg_system_zooj2store.tar.gz ``` -------------------------------- ### J2Store Donation Option Setup Source: https://github.com/j2commerce/guide/blob/master/frequently-asked-questions/frequently-asked-questions/frequently-asked-questions.md Instructions for setting up a donation option type within J2Store. This involves creating a new option and associating it with a product. ```php /* * Step 1: Create a new option with type 'donation' * Navigate to: j2store -> catalog -> options * Create New -> Choose option type as 'donation' -> Save */ /* * Step 2: Associate the Donation option to a product * Open your product (e.g., a simple product) * Go to J2Store Cart - Options tab * Search for the donation option you just created * Add it and save the product */ ``` -------------------------------- ### J2Store Payment Plugin Class Example (PHP) Source: https://github.com/j2commerce/guide/blob/master/developer-guide/developer-guide/payment-plugin.md Demonstrates the structure of a j2store payment plugin class. It includes methods for rendering payment forms (`_renderForm`), preparing payment data (`_prePayment`), and processing payment results (`_postPayment`). This example utilizes Joomla's JFactory and J2Store components for core functionalities. ```PHP loadLanguage('', JPATH_ADMINISTRATOR); } /** * Prepares variables for the payment form. * Displayed when customer selects the method in Shipping and Payment step of Checkout * * @return unknown_type */ function _renderForm($data) { $user = JFactory::getUser(); $vars = new JObject(); $vars->onselection_text = 'You have selected this method. You will be redirected.'; //if this is a direct integration, the form layout should have the credit card form fields. $html = $this->_getLayout('form', $vars); return $html; } /** * Method to display a Place order button either to redirect the customer or process the credit card information. * @param $data array form post data * @return string HTML to display */ function _prePayment($data) { // get component params $params = J2Store::config(); $currency = J2Store::currency(); // prepare the payment form $vars = new JObject(); $vars->order_id = $data['order_id']; $vars->orderpayment_id = $data['orderpayment_id']; F0FTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/tables'); $order = F0FTable::getInstance('Order', 'J2StoreTable')->getClone(); $order->load(array('order_id' => $data['order_id'])); $currency_values = $this->getCurrency($order); $vars->currency_code = $currency_values['currency_code']; $vars->orderpayment_amount = $currency->format($order->order_total, $currency_values['currency_code'], $currency_values['currency_value'], false); $return_url = $rootURL . JRoute::_("index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=" . $this->_element . "&paction=display"); $cancel_url = $rootURL . JRoute::_("index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=" . $this->_element . "&paction=cancel"); $callback_url = JURI::root() . "index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=" . $this->_element . "&paction=callback&tmpl=component"; $orderinfo = $order->getOrderInformation(); $vars->invoice = $order->getInvoiceNumber(); $html = $this->_getLayout('prepayment', $vars); return $html; } /** * Processes the payment form * and returns HTML to be displayed to the user * generally with a success/failed message * * @param $data array form post data * @return string HTML to display */ function _postPayment($data) { // Process the payment $app = JFactory::getApplication(); $paction = $app->input->getString('paction'); $vars = new JObject(); switch ($paction) { case "display": $vars->message = 'Thank you for the order.'; $html = $this->_getLayout('message', $vars); //get the thank you message from the article (ID) provided in the plugin params $html .= $this->_displayArticle(); break; case "callback": //Its a call back. You can update the order based on the response from the payment gateway $vars->message = 'Some message to the gateway' //process the response from the gateway $this->_processSale(); $html = $this->_getLayout('message', $vars); echo $html; $app->close(); break; case "cancel": //cancel is called. $vars->message = 'Sorry, you have cancelled the order' $html = $this->_getLayout('message', $vars); break; default: $vars->message = 'Seems an unknow request.' $html = $this->_getLayout('message', $vars); break; } return $html; } /** * Processes the sale payment * */ private function _processSale() { $app = JFactory::getApplication(); $data = $app->input->getArray($_POST); //get the order id sent by the gateway. This may differ based on the API of your payment gateway $order_id = $data['YOUR_PAYMENT_GATEWAY_FIELD_HOLDING_ORDER_ID']; // load the orderpayment record and set some values $order = F0FTable::getInstance('Order', 'J2StoreTable')->getClone(); if ($order->load(array('order_id' => $order_id))) { $order->add_history(JText::_('J2STORE_CALLBACK_RESPONSE_RECEIVED')); //run any checks you want here. ``` -------------------------------- ### J2Store App Structure Example Source: https://github.com/j2commerce/guide/blob/master/developer-guide/developer-guide/app-for-j2store.md Illustrates the standard directory and file structure for a J2Store app plugin. This structure is crucial for J2Store to recognize and load the plugin correctly. ```text ├── app_example/ │ ├── app_example.php │ ├── app_example.xml │ ├── languages/ │ │ ├── en-GB.plg_j2store_app_example.ini │ ├── app_example/ │ │ ├── tmpl/ │ │ │ ├── form.php │ │ │ ├── default.php │ │ ├── controller.php │ │ ├── models/ │ │ │ ├── appexample.php ``` -------------------------------- ### J2Store Product Object Methods Source: https://github.com/j2commerce/guide/blob/master/developer-guide/creating-an-integration-plugin-for-your-component.md This section lists example methods available on the J2Store product object for retrieving related product information. These include getting the main image, cross-sell products, and up-sell products. ```php // To get the main image $product->get_product_images_html('main'); // To get cross sell products $product->get_product_cross_sells_html(); // To get up sell products $product->get_product_upsells_html(); ``` -------------------------------- ### Install and Enable EU VAT Plugin Source: https://github.com/j2commerce/guide/blob/master/tax-configuration/a-simplified-guide-for-new-eu-vat-rules-2015-for-digital-goods-and-setting-them-up-in-j2store.md Instructions for downloading, installing, and enabling the European VAT plugin within the J2Commerce/Joomla! environment to automate VAT rule implementation. ```APIDOC Install EU VAT Plugin: 1. Download the plugin from: http://j2store.org/extensions/general-plugins.html 2. Navigate to System > Install > Extension. 3. Upload the downloaded plugin file. Enable EU VAT Plugin: 1. Navigate to System > Manage > Plugin. 2. Search for "EU VAT". 3. Enable the EU VAT plugin. ``` -------------------------------- ### Joomla Admin Navigation for J2Store Setup Source: https://github.com/j2commerce/guide/blob/master/setting-up-european-vat-rules-for-selling-physical-goods-with-j2store.md Provides step-by-step instructions for navigating the Joomla administration panel to configure J2Store settings, including store profiles, geozones, tax rates, and tax profiles. ```APIDOC Joomla Admin Navigation: 1. Store Profile Setup: Go to Joomla admin – J2Store – Set up – Store Profiles - > Your store profile. - Set the Default Country to United Kingdom. - Set your Default Zone to Bristol. 2. Geozone Creation (Home VAT Zone): Go to Joomla admin – J2Store – Localization – Geozones – New. - Name: Home VAT Zone (Reference name). - State: Published. - Add country / Zone: Choose United Kingdom and add it. - Save and close. 3. Tax Rate Creation (Home VAT Rate): Go to Joomla admin – J2Store – Localization – Tax Rates – New. - Name: Home VAT Rate. - Tax Percent: 21. - Geozone: Home VAT Zone. - Status: Published. 4. Geozone Creation (Germany VAT Zone): Go to Joomla admin – J2Store – Localization – Geozones – New. - Name: Germany VAT Zone (Reference name). - State: Published. - Add country / Zone: Choose Germany and add it. - Save and close. 5. Tax Profile Creation (Digital Goods Tax Profile): Go to Joomla admin → J2Store → Localization → Tax profiles → New. - Tax Profile Name: Digital Goods Tax Profile. - State: Published. - Tax Rates Mapping: - Choose Home VAT Rate 21 % and associate with Billing Address. - Choose the Germany VAT Rate 25 % and associate with Billing Address. - Save. ``` -------------------------------- ### J2Store Sub-template File Structure Source: https://github.com/j2commerce/guide/blob/master/developer-guide/developer-guide/sub-templates.md Overview of the files within a J2Store sub-template folder. Files starting with 'default_' control the product list view, while files starting with 'view_' control the detail product view. Specific master files exist for different product types. ```APIDOC Sub-template File Organization: Within a J2Store sub-template directory (e.g., /templates//html/com_j2store/templates/foo): - List View Files: - Files prefixed with 'default_*' control the product list view layout. - Detail View Files: - Files prefixed with 'view_*' control the single product detail view layout. - Master Files for Product Types: - default_simple.php: Controls list view for simple products. - default_configurable.php: Controls list view for configurable products. - default_variable.php: Controls list view for variable products. - default_downloadable.php: Controls list view for downloadable products. - view_simple.php: Controls detail view for simple products. - view_configurable.php: Controls detail view for configurable products. - view_variable.php: Controls detail view for variable products. - view_downloadable.php: Controls detail view for downloadable products. - Child Templates: - Master files may call child templates which are common across multiple product types. ``` -------------------------------- ### J2Store App Model Class (PHP) Source: https://github.com/j2commerce/guide/blob/master/developer-guide/developer-guide/app-for-j2store.md Example of the model class for a J2Store app. It should extend J2StoreAppModel and define the $_element property. ```php defined('’_JEXEC’') or die('’Restricted access’'); require_once (JPATH_ADMINISTRATOR . ‘/components/com_j2store/library/appmodel.php’); class J2StoreModelAppExample extends J2StoreAppModel { public $_element = 'app_example'; ``` -------------------------------- ### Set up Tax Profile for Digital Goods Source: https://github.com/j2commerce/guide/blob/master/tax-configuration/a-simplified-guide-for-new-eu-vat-rules-2015-for-digital-goods-and-setting-them-up-in-j2store.md Instructions for creating a unified tax profile that can associate multiple tax rates, simplifying the application of different VAT percentages to digital products. ```APIDOC Set up Tax Profile: 1. Navigate to Components > J2Commerce > Localization > Tax profiles > New. 2. Tax Profile Name: Digital Goods Tax Profile. 3. Status: Enabled. 4. Tax Rates Mapping: - Choose 'Home VAT Rate 21%' and select 'Billing Address' as the Associated Address. - Choose 'Germany VAT Rate 25%' and select 'Billing Address' as the Associated Address. 5. Save. ``` -------------------------------- ### Secure Trading Notification Setup in MyST Source: https://github.com/j2commerce/guide/blob/master/payment-methods/secure-trading-plugin.md Guides through setting up notifications in the MyST portal to update order information in the J2Store backend after a payment is made via the SecureTrading Payment Gateway. ```APIDOC MyST Notification Setup: 1. Notifications -> Add Filter: - Description: Recognizable name. - Requests: Auth - Payment Types: Select all accepted card types. - Error Codes: All Error Codes 2. Add Destination: - Description: Recognizable name. - Notification Type: URL - Process Notification: Online - Security Password: Your chosen notification password. - Security Algorithm: sha256 - Fields: - errorcode - orderreference - securityresponseaddress - securityresponsepostcode - securityresponsesecuritycode - status - transactionreference - Custom Fields: None 3. Link Filter and Destination: Select created filter and destination, then Save. ``` -------------------------------- ### Multi-lingual Site Configuration Example Source: https://github.com/j2commerce/guide/blob/master/sermepa-payment-plugin.md Demonstrates how to use language constants for dynamic text display in a multi-lingual environment, allowing for localized messages on selection, before payment, after payment, on error, and on cancellation. ```APIDOC Configuration Parameter: Display Text on Selection Description: Enter a language constant here for multi-lingual support. Example Value: J2STORE_TEXT_TO_DISPLAY_ON_SELECTION To implement: Go to Joomla admin -> Language Manager -> Overrides and create overrides for the language constant in all your languages. Example Override (English): J2STORE_TEXT_TO_DISPLAY_ON_SELECTION = "Pay securely with Sermepa" Example Override (Spanish): J2STORE_TEXT_TO_DISPLAY_ON_SELECTION = "Pague de forma segura con Sermepa" ``` -------------------------------- ### J2Store App Controller Class (PHP) Source: https://github.com/j2commerce/guide/blob/master/developer-guide/developer-guide/app-for-j2store.md Example of the controller class for a J2Store app. It must extend J2StoreAppController and set the $_element property. ```php defined('’_JEXEC’') or die('’Restricted access’'); require_once(JPATH_ADMINISTRATOR.’/com_j2store/library/appcontroller.php’); class J2StoreControllerAppexample extends J2StoreAppController{ var $_element = 'app_example'; ``` -------------------------------- ### Multi-lingual Site Configuration Example Source: https://github.com/j2commerce/guide/blob/master/payment-methods/payment-methods/sermepa-payment-plugin.md Demonstrates how to use language constants for dynamic text display in a multi-lingual environment, allowing for localized messages on selection, before payment, after payment, on error, and on cancellation. ```APIDOC Configuration Parameter: Display Text on Selection Description: Enter a language constant here for multi-lingual support. Example Value: J2STORE_TEXT_TO_DISPLAY_ON_SELECTION To implement: Go to Joomla admin -> Language Manager -> Overrides and create overrides for the language constant in all your languages. Example Override (English): J2STORE_TEXT_TO_DISPLAY_ON_SELECTION = "Pay securely with Sermepa" Example Override (Spanish): J2STORE_TEXT_TO_DISPLAY_ON_SELECTION = "Pague de forma segura con Sermepa" ``` -------------------------------- ### Stuck at Shipping Step / Cannot Proceed to Payment Source: https://github.com/j2commerce/guide/blob/master/troubleshooting-guide/troubleshooting-checkout-issues.md Guides users on how to resolve issues where the checkout process gets stuck at the shipping step and cannot proceed to payment. This typically involves checking for old template overrides. ```APIDOC Template Override Check: Navigate to: /templates/YOUR_TEMPLATE/html/com_j2store - If a folder named 'checkout' exists, rename it to 'old_checkout' to test. ``` -------------------------------- ### Set Up and Enable SSL in Joomla Source: https://github.com/j2commerce/guide/blob/master/troubleshooting-guide/troubleshooting-guide/troubleshooting-common-issues.md Details the process of setting up and enabling SSL (Secure Sockets Layer) for a Joomla website, ensuring secure connections for users. ```configuration Configure your web server and Joomla settings to enable SSL and enforce HTTPS connections. ```