MENU

Reuse of CGEcommerceBase address data

  Previous article Next article  

When 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:

{* +++ https://cmscanbesimple.org/blog/reuse-of-cgecommercebase-address-data +++ *}

{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:

{Products summarytemplate='cgecomm_company_address'}

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}


Buy Me A Coffee


  Comment Form

ReviewManager

Click here to open the form

ReviewManager

  1 Comment

Buy Me A Coffee

CMS Made Simple - Tutorials, Tips and Tricks - CMSMS

Reuse of CGEcommerceBase address data

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.19
  Last updated: 06-07-2018
  Comments: 1
  http://cms.ms/Ir5q


Buy Me A Coffee




Advertisement


Ads help me to help you! Thanks!

Ads help me to help you! Buy products from these advertisers!