Reuse of CGEcommerceBase address data
Previous article Next articleWhen building a webshop in CMS Made Simple Calguy's e-commerce suite is a great choice. A pack of modules that provide all needed features!
One of them, the CGEcommerceBase module let you fill in your companies address data, that will be used in other e-commerce modules.
But at your website you also have the same contact information at your contact page and (probably hard coded) in your page footer.
Manage them at THREE different areas? Or just ONE!!!
With this method you can use the data of the CGEcommerceBase module all over your website!
How to use
In Design Manager you create a new Products::List View template, named cgecomm_company_address. In the content area you put the following code:
{cgecomm_company_address assign=cgecomm_company_address}
{$cgecommercebase_company = $cgecomm_company_address->company scope=global}
{$cgecommercebase_firstname = $cgecomm_company_address->firstname scope=global}
{$cgecommercebase_lastname = $cgecomm_company_address->lastname scope=global}
{$cgecommercebase_address1 = $cgecomm_company_address->address1 scope=global}
{$cgecommercebase_address2 = $cgecomm_company_address->address2 scope=global}
{$cgecommercebase_city = $cgecomm_company_address->city scope=global}
{$cgecommercebase_state = $cgecomm_company_address->state scope=global}
{$cgecommercebase_postal = $cgecomm_company_address->postal scope=global}
{$cgecommercebase_country = $cgecomm_company_address->country scope=global}
{$cgecommercebase_phone = $cgecomm_company_address->phone scope=global}
{$cgecommercebase_fax = $cgecomm_company_address->fax scope=global}
{$cgecommercebase_email = $cgecomm_company_address->email scope=global}
At the top of your Core::Page template before the <head> area you call the Products module once:
Now you have access to the CGEcommerceBase address data on all pages and templates like:
Company Name: {$cgecommercebase_company}
First Name: {$cgecommercebase_firstname}
Last Name: {$cgecommercebase_lastname}
Address 1: {$cgecommercebase_address1}
Address 2: {$cgecommercebase_address2}
City: {$cgecommercebase_city}
State: {$cgecommercebase_state}
Postal Code: {$cgecommercebase_postal}
Country: {$cgecommercebase_country}
Phone Number: {$cgecommercebase_phone}
Fax Number: {$cgecommercebase_fax}
E-mail Address: {$cgecommercebase_email}
Comment Form
ReviewManager
ReviewManager
1 Comment
Notice: Undefined variable: my_addr in .../CGEcommerceBase/lib/class.smarty_plugins.php on line 120
Bug report and fix:
http://dev.cmsmadesimple.org/bug/view/11843