Post by xbs » Tue Dec 01, 2020 4:02 am

Hi All,

I have question about multi-domain installation for v3.0.3.6.

I'm new in OpenCart and I'm trying to solve next goals:
* we need single store for multiple domains
* each domain is linked with specific language
* one general main domain still can handle several languages
* we want code customization of observable view part for every domain
* we want single DB and single file storage for whole multi-domain project
* we want single source of logic for admin, catalog, extension, system code bases for whole multi-domain project
* we want single public web access point for images

As result of my analysis of v3.0.3.6 version, I made file structure adjustments and changed it this way:

Code: Select all

\src
  \admin  (moved from /upload/admin)
  \catalog (moved from /upload/catalog)
  \extension (moved from /upload/extension)
  \system (moved from /upload/system)
\var
  \storage (moved from /storage)
\public
  \admin
    \view (moved from /upload/admin/view)
     ...
  \site.fr
    \catalog
      \view\{image,javascript,stylesheet,template} (moved from /upload/catalog/view for .fr view customizations)
     ...
  \site.us
    \catalog
      \view\{image,javascript,stylesheet,template} (moved from /upload/catalog/view for .us view customizations)
    \image\{cache,catalog} (moved from /upload/image)
See, here business-domain, infrastructure and application logic is located in /src
In /public/site.fr, /public.us we locate view-part of open-cart platform. These are web roots and /site.us comprises image folder for originals and caches.

To make it work, I've performed few manual customizations in OpenCard code base.

1. Since '/extensions' now is not located in public web root, I need to consider its folder in twig's constructor - `\Opencart\System\Library\Template\Twig::__construct()`:

Code: Select all

// #mod, add path for extension twigs
// $this->loader = new \Twig\Loader\FilesystemLoader('/', $this->root);
$paths = ['/', '../../src/extension'];
$this->loader = new \Twig\Loader\FilesystemLoader($paths, $this->root);
2. Since we want the single image source for all domains, I located them in `site.us\image`. Probably, we can create separate domain for them in further.
I added global constant for defining image source host/url path - IMAGE_URL. And performed manual customization in `\Opencart\Application\Model\Tool\Image::resize()`

Code: Select all

// #mod #IK, 2020-11 - Link images to single domain
// return $this->config->get('config_url') . 'image/' . $image_new;
return IMAGE_URL . 'image/' . $image_new;
---

Could you please review and express your opinion regarding this solution? Please point me to weak sides and what I did right.
My big concern is the fact, that we are moving code away from original structure of OpenCart project. This will complicate framework later updates.
I believe, this friendly OpenCart community could help to find a better way on base of your wide experience.
Shouldn't I review some of my goals?

---

Updated:
Need to say, that I've found multi-domain facility that allows to link categories and products from single store to different domains. This means we can keep all logic on the same domain in orginal platform structure.
I believe, we will be able to adjust styles for each domain. But I'm not sure, what should we do, if we need custom adjustments for pages layouts.
How could we separate them in recommended true way?

xbs
Newbie

Posts

Joined
Mon Nov 30, 2020 11:54 pm

Post by cedcommerceteam » Tue Dec 01, 2020 11:50 am

Hello,

Hope you are doing well.

We can help you with this, please let us know if we can discuss it in detail.

Thanks!!!

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

Post by TrishL » Tue Dec 01, 2020 2:10 pm

Hello,
I'd love to help you.
Please reach m eon my skype or Email.
BR
Trish

Professional Open cart Developer
Email - trish.c@talentsfromindia.com
Skype - live:.cid.baff7c7dd9471b54 | Phone: +13056004562


New member

Posts

Joined
Mon Nov 09, 2020 5:39 pm

Post by deepvyas » Tue Dec 01, 2020 6:36 pm

xbs wrote:
Tue Dec 01, 2020 4:02 am
Updated:
Need to say, that I've found multi-domain facility that allows to link categories and products from single store to different domains. This means we can keep all logic on the same domain in orginal platform structure.
I believe, we will be able to adjust styles for each domain. But I'm not sure, what should we do, if we need custom adjustments for pages layouts.
How could we separate them in recommended true way?
Hi there ,
Good to hear update regarding job post.
Further, you can find the option in setting to map specific language with sub-domain.

Please let me know, If need any custom development help.

Regards
Deep

Expert Opencart Developer & Designer | S: deepvyas71 | E: deepvyas71@gmail.com


Active Member

Posts

Joined
Thu Jan 12, 2017 7:04 pm
Who is online

Users browsing this forum: Baidu [Spider] and 9 guests