# Features — farmtrade (FarmTrade / AgMarket)

Evidence date: 2026-10-15. Source: `git@bitbucket.org:overdrive/farmtrade.git`.

Status words used here:

- **Current on master** — present on `master` at `f4f46ea9` (2020-07-03).
- **Current on product line** — present on `prod` at `429b1564` (2020-09-15) and on `qa` at `a755fe81` (2020-09-16), unless a row says otherwise.
- **Stock** — shipped with CS-Cart Multi-Vendor 4.11.4.SP3, not written for this marketplace.
- **Commented out** — the file remains, and the markup or statement is inside a comment.
- **Not in git** — named by the task-creation scan, and no tracked file exists at that path.

`qa` is one merge ahead of `prod` (`tokenMan`). The files compared for this list did not show a feature that exists only on `prod`.

## Current on master and on the product line

### Marketplace shell

| Feature | Location | Notes |
|---|---|---|
| Customer storefront | `index.php` | `AREA` C. PHP below 5.6.0 is rejected. |
| Admin panel | `admin.php` | `AREA` A, `ACCOUNT_TYPE` admin. |
| Vendor panel | `vendor.php` | `vendor_index` in config. |
| REST API | `api.php` | `Tygh\Api`, `NO_SESSION`. |
| Closed-store page | `store_closed.html` | Disallowed in `robots.txt`. |
| Robots rules | `robots.txt` | Disallow `/app/` and `/store_closed.html`. |
| PHP probe file | `phptest.php.txt` | Prints `test`. Not an entry script. |

### Stock Multi-Vendor capabilities

The tree includes the stock catalogue, cart, checkout, orders, shipments, companies (vendors), profiles, pages, promotions, and the add-on set listed in the technical document. Themes on disk: `design/themes/responsive` and `design/themes/bright_theme`.

Which of those capabilities are switched on is stored in MySQL. **Unknown / Requires Confirmation** for every add-on except where this document says the manifest or a template change is visible in git.

### CodeDeploy

| Feature | Location | Notes |
|---|---|---|
| AppSpec | `appspec.yml` | Destination `/var/www/html/farmtrade.co.za/`, owner `apache`. |
| Install httpd | `scripts/install_dependencies` | `yum install -y httpd`. |
| Start httpd | `scripts/start_server` | `service httpd start`. |
| Stop script | `scripts/stop_server` | Not hooked from `appspec.yml`. Bash assignment is written with spaces around `=`. |
| Archive cleanup | `scripts/remove_archives.sh` | ApplicationStop hook. Deletes old CodeDeploy revision directories. |
| Deploy helper | `codedeploy_deploy.py` | Invoked by the pipeline. |
| Prod pipeline | `bitbucket-pipelines.yml` | Branch `prod`. Python 3.5.1, `boto3==1.3.0`, zip the tree, run the helper. |

## Current on the product line only

### Parcel Perfect

| Feature | Location | Notes |
|---|---|---|
| Add-on manifest | `app/addons/sil_parcel_perfect/addon.xml` | Id `sil_parcel_perfect`, version 1.0.0, supplier Silicon Overdrive cc. |
| Token table | same | `?:sil_parcel_perfect_data`. |
| Settings | same | API URL, username, password, timeout, token expiry days. |
| Auth client | `app/Tygh/ParcelPerfectAuth.php` | Salt, secure token, stored token, cURL. |
| Earlier auth class | `app/addons/sil_parcel_perfect/func.php` | Second class `ParcelPerfectAuth`, not namespaced. Not what `addressing.php` instantiates. |
| Shipping service | `app/Tygh/Shippings/Services/Parcelperfect.php` | `STOREFRONT` constant `AgMarket`. Cheapest rate. Tracking URL `https://epx.pperfect.com/`. |
| Place-order hook | `func.php`, `init.php` | Writes quote id into `orders.fax` for non-parent orders. |
| Unhooked helpers | `func.php` | `fn_sil_parcel_perfect_get_delivery_quote` and `fn_sil_parcel_perfect_create_managed_pickup`. Not registered in `init.php`. Each sets a static Basic Authorization header that is not the add-on password setting. |
| Checkout autocomplete | `js/addons/sil_parcel_perfect/parcel_perfect_address.js`, `addressing.php`, `js/tygh/checkout/lite_checkout.js` | Town lookup against the same origin. |
| Loader image | `images/loadinfo.gif` | Shown beside the city field while the lookup runs. |
| Collection on status A | `app/controllers/backend/orders.php` | `Collection.quoteToCollection`, then a shipment row with the waybill number. |

`qa` (`a755fe81`) contains the token-manager cleanup that `tokenMan` merged. `prod` (`429b1564`) already has the shipping service and the status-A collection path. The three files that differ between `prod` and `qa` in the custom tree are `ParcelPerfectAuth.php`, `Parcelperfect.php`, and `config.local.php`.

### PayFast

| Feature | Location | Notes |
|---|---|---|
| Processor | `app/payments/payfast.php` | PayFast plugin 1.0.0. Sandbox and live hosts. |
| Shared checks | `app/payments/payfast/payfast_common.inc` | Signature, source IP, amount, server validate. |
| Install SQL | `sql/payfast_mysql_install.sql` | Inserts processor row and language strings, including the passphrase warning. |
| Complete sets status P | `payfast.php` | `fn_change_order_status(..., 'P')` on `COMPLETE`, in addition to the status map. |
| Parent-order return | same | Child orders left incomplete are set to `O` when the buyer returns. |

### Vendor registration and vendor login

| Feature | Location | Notes |
|---|---|---|
| Webkul add-on | `app/addons/wk_vendor_custom_registration/` | Version 2.0. Admin menu item. Frontend and backend controllers. |
| Demo fields | `database/demo.sql` | 14 company and contact fields. See the PRD for which are required in the seed. |
| Install SQL copy | `sql/vendor_custom_reg_install.sql` | Present beside the add-on's own `database/demo.sql`. |
| Vendor terms checkbox | `design/backend/templates/views/auth/login_form.tpl` | Vendor account type only. Required checkbox. Link to AgMarket page id 31 with `action=preview`. No `name` on the input. |

### Product import

| Feature | Location | Notes |
|---|---|---|
| Add-on | `app/addons/product_import/addon.xml` | Name "Product Import", version 1.0, priority 100500, status active in the manifest. Setting `tags_for_products` default Y. |
| API entity | `Tygh/Api/Entities/ImportProducts.php` | Create, update, category create for admins, root-only disable. |
| Empty hook | `func.php` | Hook `import_products` reads the session and does not import. |
| Empty controller | `controllers/index.post.php` | Assigns an empty string. |

### Mail, admin URL, and storefront presentation

| Feature | Location | Notes |
|---|---|---|
| Admin front controller name | `config.local.php`, `fa-admin.php` | `admin_index` is `fa-admin.php`. `admin.php` is still in the tree. |
| Fixed from-strings | `app/Tygh/Mailer/AMessageBuilder.php`, `PhpMailerTransport.php` | `setFrom('AgMarket', 'noreply@agmarket.co.za')`. |
| SES SMTP | `PhpMailerTransport.php` | Hardcoded `eu-west-1` endpoint when mailer method is `smtp`. Admin SMTP settings commented out. Credentials omitted from this document. |
| Newsletter block | responsive `subscribe.tpl` | Markup commented out. |
| Call-request block | responsive `call_request.tpl` | Markup commented out. |
| Payment icons | responsive and `bright_theme` `payment_icons.tpl` | Mastercard and Visa. 2Checkout and PayPal spans removed from the responsive file. |
| Greeny body text | `design/themes/responsive/styles/data/Greeny.less` | `@font` changed from `#585858` to `#000000`. |
| SEO toggle | `app/addons/seo/schemas/settings/actions.functions.post.php` | Function returns true immediately. |
| Storefront relations | `app/Tygh/Storefront/RelationsManager.php` | Unknown-relation exception commented out. |
| Privacy policy PDF | `FarmTrade-Privacy-Policy-4-08-2020.pdf` | Committed 2020-08-04. No template link found. |
| Host and database | `config.local.php` | `prod`: `agmarket.co.za` / `db_agmarket`. `qa`: `qa.agmarket.co.za` / `db_agmarket`. |

### QA pipeline

`bitbucket-pipelines.yml` on `qa` adds a "Deploy on QA" step for branch `qa`, using `QA_*` variables. `master`'s copy of the file has the prod step only.

## Commented out or bypassed

| Item | Where | What remains |
|---|---|---|
| Company from-address | `AMessageBuilder.php` | The lookup is commented. Fixed strings are used instead. |
| SMTP settings from admin | `PhpMailerTransport.php` | Commented. Hardcoded SES settings are used when method is `smtp`. |
| Newsletter subscribe form | `subscribe.tpl` | HTML comment. Add-on files still in `app/addons/newsletters`. |
| Call request block | `call_request.tpl` | HTML comment. Add-on files still in `app/addons/call_requests`. |
| SEO activation body | SEO settings action | Unreachable after `return true`. |
| Unknown storefront relation exception | `RelationsManager.php` | Commented. The schema index still runs. |
| Stock sample hosts | `config.local.php` | `www.yourcompany.com` and `secure.yourcompany.com` stay as comments. |

## Removed on the product line

| Item | Evidence |
|---|---|
| `install.html` | `git diff --name-status master...origin/prod` shows `D install.html`. The file is on `master`. |
| 2Checkout and PayPal icon spans | Removed from the responsive payment-icons template. The payment processors themselves are still in `app/addons` and `app/payments` as stock files. |

## Not in git

| Item | Evidence |
|---|---|
| `sonar-project.properties` | Task-creation scan listed it. Not tracked on `master` or `qa`. |
| `sonarqube_scan.bat` | Same. |
| Catalogue, vendors, orders, pages, active add-ons | Database. `var/` holds cache and runtime files; it is not a product catalogue export. |
| Bitbucket pipeline variable values | Referenced as `$PROD_*` and `$QA_*`. Not stored in the YAML. |
| Page 31 terms body | Linked from the vendor login form. Page content is not in git. |

## Not a feature of this repository

- A written roadmap or a version newer than the 2020-09-16 tip.
- A project-specific automated test suite. Stock CS-Cart unit tests live under `app/Tygh/Tests/`. No farmtrade test file was found.
- A mobile client. Stock add-on `mobile_app` is in the tree. No app binary or store URL is referenced.
