eCommerce – CMS Made Simple
Order, Product, Cart, Payment Gateway – CMS MAde Simple
Notes for developers
PRODUCT module
- Category list cannot be sorted. (At this point )
There are 3 tables used: product (all data about products) , category (name, id) and categ-prod (link between these two based on product_id , categ id)
To have the list of category displayed sorted with here it is one fast solution:
Edit modules/Product/action.categorylist.php and change as following (begin with line 99 -aprox )
$params['category']=$row['name'];
/* ***OLALA change BEGIN */
$category[] = $row['name'].”|x|”.$prettyurl.”|x|”.$obj->count.$row['id'];
/* ***OLALA change END */
$obj->summary_url = …..
- Assign a specific page (and template) to a specifi Node (product in herarcy)
Take this line $urlfmt = ‘products/%d/’.($detailpage!=”?$detailpage:$returnid).’/%s’; and move beyond the line (aprox) #282 while ($dbresult && ($row = $dbresult->FetchRow())) inside teh loop.
It means the pretty url will be unique based on node (product) id.
To have “node” in the $row then replace this:
$query = “SELECT c.* FROM “.cms_db_prefix().”module_products c”; with this one : $query = “SELECT c.*, hr.hierarchy_id as lc_hrid FROM “.cms_db_prefix().”module_products c LEFT JOIN “.cms_db_prefix().”module_products_prodtohier hr ON c.id = hr.product_id”;
The last step is based on specific node $detail page will be diferent, for example:
switch($row['lc_hrid'])[
case 1: $detailpage = 71; break;
case 2: $detailpage = 64; break;
]
And now just under it will be your: as it was mentioned at the begining.
$urlfmt = ‘products/%d/’.($detailpage!=”?$detailpage:$returnid).’/%s’;Replace [ with big brackets....made simple
- Assign a attributes to more than one product
Tables involved into process:
_module_products_attribsets
_module_products_attributes
Insert an attribute set name and corresponding attribute options for any product needs it. Do it using admin area.
Using any tool (phpMyAdmin for example or just php code) assign to as many product as you wish the same attribute set inserting records into _module_products_attribsets. Keep the attribute_set_name and attribute_set_id the same fr all records, Change the product_id value.
What this website. It will be available an adsOn for this module. You will be able to use it like in ZenCart
-define an attribute set
-define options for that set (+ prices)
-assign that attribute to products or note hierarchy.
ORDERS module
- Step 1 - Billing form
All fields are defined in action.default.php
- Order tables updating flow
Once you click on NEXT in "Confirmation" page:
- order table is updated and records in order_item are deleted and inserted (actual one)
- all is happening in action.default (look for insert_order and update_order function
- email to admin and client
They are set up in action.gateway_complete.php. It is about emails sent when a payment has done via payment gateway
As it is now the email send to client and admin is using HTM Template but the mail is sent in plain text. You have two options:
- make the template plain text
- make the email to be sent in HTML. To do it insert in both area (admin and client email ) the follow in line:
$cmsmailer->IsHTML(true);
just under the
$cmsmailer =& $this->GetModuleInstance('CMSMailer');
- check all variables displayed in email template, there is and order[i] which may be replaced.
a) page responsable for payment via “money order”: action.invoice.php
b) page responsable for payment via “credit card”: action.gateway_complete.php
- – - – - – - – - – -
To get support for any issue related with CMS Made simple fell free to contact.
All is written here was tested and/or sometimes implemented in commercial environment.
This page is updated continuously .
Comments
Leave a comment Trackback