Jump to content


Multiple Storefronts Off The Same Database


  • Please log in to reply
14 replies to this topic

#1 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 15 December 2009 - 10:54 AM

Hello dear webmasters! This may be a somewhat hidden feature (and it's not in much use) but Avactis actually does support multiple storefronts. In this post I'll do my best to show you how it works.

First off, here's the process of a store page generation:

When your browser opens one of Avactis store pages, the first thing that's happening is that your web server includes (reads and executes) init.php. That's of course because <?include("init.php")?> is (and should be) the first line of every Avactis storefront file.

Now, if you look into init.php, you will see that it does just two things:

1. Sets the name of the layout file that will be used during generation of this page;

2. Includes (loads and executes) avactis-system/store.php which starts system initialization.

Then the system initializes itself. It reads configuration files, cookies (if any), connects to the database, reads settings, all the necessary data, creates core system objects, looks for available modules, and stuff like that.

Somewhere in the middle of this process it reads the specified layout file. From the settings in this file, the system learns where it should look for all the necessary files and folders: templates, categories, product pages, cart, checkout pages, customer login/password/orders pages, etc. This information is used throughout the whole system to answer 2 main questions:

a. Where to read templates to generate storefront blocks from?

b. Which pages link to from the storefront (what to put in the hrefs)?

It's also used to generate .htaccess rewrite rules for SEO URLs feature.

Then the system processes all necessary actions. For example, if you added a product to cart, the system actually updates the cart, sets variables in user session, decreases the product's stock level, adds data to reports, etc.

Note that all this stuff takes place at the very first line of the page: <?include("init.php")?>.

When all the necessary work is done, PHP continues processing the page after init.php. Most often it starts to output page header: DOCTYPE, html, head, etc.

Then it encounters an Avactis tag like <?Breadcrumb()?>. So what does it do? Not much: just calls the function Breadcrumb. This function already exists in memory, because it has been created somewhere in the process of system initialization. This function reads various variables to determine what is the current path, reads its templates from avactis-templates/catalog/breadcrumb/default/, composes the corresponding HTML code, and outputs it. Of course it generates its links according to layout file settings.

That's basically it.

So, the whole process is ruled by two files: init.php and storefront-layout.ini. They determine what is used and what is not.

To create a new storefront for the same product catalog (database), you need to do the following:

* Make a copy of the old storefront and template directory in a different location;
* Make a copy of the old storefront-layout.ini file in the same directory (avactis-layouts), under a new name;
* Edit it to specify the correct location of the new storefront files and templates;
* Edit init.php in the new storefront to specify the new layout file name.

Example:

We have a storefront at www.oldstore.com. Layout:

SiteURL = "http://www.oldstore.com/"
SitePath = "/var/www/vhosts/oldstore.com/httpdocs/"

TemplateDirectory = avactis-templates

init.php:

$layout_file_path = 'storefront-layout.ini';
include('/var/www/vhosts/oldstore.com/httpdocs/avactis-system/store.php');

I want to make a new store at www.newstore.com with a different design.

I create a new domain newstore.com.

I copy all .php files, storefront-files and avactis-templates directories from /var/www/vhosts/oldstore.com/httpdocs/ to /var/www/vhosts/newstore.com/httpdocs/

I copy storefront-layout.ini to newstore-layout.ini
(it is done in oldstore.com/httpdocs/avactis-layouts/)

I edit newstore-layout.ini:

SiteURL = "http://www.newstore.com/"
SitePath = "/var/www/vhosts/newstore.com/httpdocs/"

I edit newstore.com/httpdocs/init.php:

$layout_file_path = 'newstore-layout.ini';
include('/var/www/vhosts/oldstore.com/httpdocs/avactis-system/store.php');

That's it.

When your browser opens www.newstore.com, the first line of index.php includes init.php, which sets layout to newstore-layout.ini, which sets templates and other files to newstore.com, and uses the system from oldstore.com.

You should always access Admin Area from oldstore.com.

You may also rename avactis-templates to just templates and reflect this change in layout.ini. Or rename any file listed there as well.

Having several .ini files in avactis-layouts will make your admin area display several "Storefront" links and several sections of settings (for each storefront) in several places.

I would like to emphasize: this feature is experimental and you may encounter bugs. Please don't hesitate to contact us to resolve any.

#2 wbd

wbd

    Expert

  • Members
  • PipPipPipPipPip
  • 235 posts
  • Gender:Male
  • Location:Melbourne, Australia
  • v1.8.3 Build 6950

Posted 28 May 2010 - 08:27 AM

Hello David, thank you for taking the time to share this information. I see that this document is based on v1.8.x of the Avactis Shopping Cart. Is it possible to update (or publish a new post) so that it reflects the current v1.9.1 Avactis Shopping Cart? Alternatively, is there documentation already available which describes how to achieve this functionality for the current version?

#3 Guest_David Frost_*

Guest_David Frost_*
  • Guests

Posted 28 May 2010 - 09:37 AM

Now that the root .php files do not contain that dirty HTML anymore :) the process is still the same: system initialization, then processing all tags on a page. The tags just aren't taken from the page itself but rather from the corresponding section of map.ini. So the process isn't much different.

#4 brewster

brewster

    Newbie

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Brisbane AUS
  • 1.9.1

Posted 21 June 2010 - 07:37 PM

Hi David, Is this possible if stores are on 2 different servers? ie one in Australia and the other in the US

#5 Guest_Ilya Vassilevsky_*

Guest_Ilya Vassilevsky_*
  • Guests

Posted 26 July 2010 - 11:23 AM

No, no way to do this remotely, only on the same server.

#6 Lavern

Lavern

    Expert

  • Members
  • PipPipPipPipPip
  • 306 posts
  • Gender:Male

Posted 11 August 2010 - 04:44 PM

Does this require more than one license? And when I use one installation for two storefronts, they share the same customer list and settings under Store Settings > Customer Account Settings, right? I have two installations of Avactis on the same domain (one is on a subdomain) because we want to have a retail and a wholesale site. The wholesale storefront requires that an admin verifies customer accounts before they can purchase. I don't think I can do this with one installation of Avactis, but I am wondering if it's possible to use one Avactis license for these two installations since they both sit on one domain. That is probably a silly question, but I just wanted to check.
Lavern Gingerich
New Creation Designs
Website and Graphic Design Services

#7 Guest_Ilya Vassilevsky_*

Guest_Ilya Vassilevsky_*
  • Guests

Posted 11 August 2010 - 06:43 PM

Dear Lavern, You can't use a single license for both stores because technically they are 2 separate installations, with 2 different databases. The method described by David allows creation of different "faces" of the same installation - single database, product catalog, customer list. Equal prices. So far, Avactis does not support customer groups with different pricing for each group, so your setup is not possible with a single installation of Avactis. Please ask more questions and don't be afraid of their nature. It is always better to over-explain :)

#8 Lavern

Lavern

    Expert

  • Members
  • PipPipPipPipPip
  • 306 posts
  • Gender:Male

Posted 12 August 2010 - 07:18 AM

Thanks for your kind help, Ilya.
Lavern Gingerich
New Creation Designs
Website and Graphic Design Services

#9 Tom S

Tom S

    Novice

  • Members
  • PipPip
  • 12 posts

Posted 20 September 2010 - 12:49 AM

did not know this till now. thanks!

#10 peteVA

peteVA

    Devotee

  • Members
  • PipPipPipPip
  • 102 posts

Posted 22 September 2010 - 05:52 PM

Would this work for setting up affiliates each with their own "home" page? They could have their own "welcome to Marys shop", welcome to Janes shop, etc. while in reality it's all one deal. They would simply direct traffic to "their" cart which would also have their affiliate code embedded.

#11 BoL

BoL

    Newbie

  • Members
  • Pip
  • 1 posts
  • 1.91 8356

Posted 09 November 2010 - 01:28 AM

Dear Lavern,

You can't use a single license for both stores because technically they are 2 separate installations, with 2 different databases.

The method described by David allows creation of different "faces" of the same installation - single database, product catalog, customer list. Equal prices.

So far, Avactis does not support customer groups with different pricing for each group, so your setup is not possible with a single installation of Avactis.

Please ask more questions and don't be afraid of their nature. It is always better to over-explain :)


Any update on this question of multistore functionality?

Here is our situation: We are looking to have multiple storefronts at different domains that offer different selections of products from the same database (e.g., one master store would have all products, but then there may be a separate domain (or subdirectory) that is specialized and only offers some of the products. As far as I can tell from the initial post in this thread, this should be possible, but I don't see any clear confirmation of this. I understand that each may need its own license, but I am not sure as they will share a database - can you clarify this?

Thanks for your input.

#12 Guest_Ilya Vassilevsky_*

Guest_Ilya Vassilevsky_*
  • Guests

Posted 09 November 2010 - 10:33 AM

Unfortunately, we cannot guarantee stable operation of Avactis with multi-domain setup. You can try it out, and there's a high chance that it'll work, but there is no guarantee. We plan to do a major rewrite of URL-mapping subsystem, with multi-domain in mind, in Avactis 3.0 only. Avactis 2.0 due to be released very soon, has native support for multiple customer groups. You will be able to set different prices for each group and hide any products from any groups. Update from 1.x to 2.0 will be ready ASAP - somewhere in December.

#13 zorgster

zorgster

    Newbie

  • Members
  • Pip
  • 8 posts
  • Gender:Male

Posted 27 February 2012 - 12:13 PM

Hi

I have successfully created a multistore - a second front running off the same backend database - using Avactis 2.1.1

I copied the main root php files, and the themes folder. I had trouble with the page not loading... and I ended up copying a lot of the admin folder over, admin/modules, admin/core, admin/conf, created a new cache and backup folder under admin.. ajax_actions_maps... basically almost a reproduction of the avactis-system folder.

I copied and renamed the layouts.ini ... and edited the Store Path within that... as was suggested above.

I was still having trouble with the site not loading past a few lines - part of the header etc - and tried so much to fix - looking at the templates and so on.. I couldn't figure it out... until I simply deleted the new store's cache folder and then everything came online... so if you are having trouble setting up the store and you've tried everything, maybe just delete the contents of the cache folder - just in case...

Once the new store was up and running, I can see Storefront 1 and Storefront 2 buttons in Admin. On some pages I can see a few more doubled entries for the two layouts.

I cannot edit pages in Page Manager ... for that I had to load up admin from the other domain... and edit the layouts from that admin interface... I also had to be careful that I didn't edit our 'Welcome Text' on one, because it is global content.... I had to create a new set of content and menus for the new storefront... then work through all the pages in page manager (from admin in the new domain) and set the menus to the copied version... and set the content to the copied content.

Once that is done, there is no daily need to enter Admin from the new domain. You can alter the Products and Categories using the main admin interface and the content is pulled from one single database...

Another requirement I have was that users registering on the new website, were added into a new Customer Group.

This requires a modification at code level...

<pre><code>
function addAccount($account, $password, $aff_id="", $group_id=2)
{
global $application;
$tables = $this->getTables();
$customers_table = $tables['ca_customers']['columns'];

$query = new DB_Insert('ca_customers');
$query->addInsertValue($account, $customers_table['customer_account']);
$query->addInsertValue(md5($password), $customers_table['customer_password']);
$query->addInsertValue($aff_id, $customers_table['affiliate_id']);
$query->addInsertValue(modApiFunc('MultiLang', 'getLanguage'), $customers_table['customer_lng']);
$query->addInsertValue(modApiFunc('MultiLang', 'getLanguage'), $customers_table['notification_lng']);
$query->addInsertValue($group_id, $customers_table['group_id']);
$application->db->PrepareSQL($query);
return $application->db->DB_Exec();
}
</code></pre>

On one storefront I have set the default value of $group_id to 1 and on the other to 2... Ideally I could then add $group_id to the RegisterCustomer code... and then to the HTML_Form ... etc... and perhaps add it in as a hidden field to a template...

I have edited Product List on both stores to point to a SubCategory below Home. So products assigned to one store can be kept separate from Products in the second store. Visitors in either store could be directed to the other store and the purchases would all use the same Cart... my client packs all Products from the same location anyway... All Product Types can also be assigned to a specific Customer Group. Ideally I would like to remove 'Home' from the Breadcrumbs... but I've set the Home category to only show items in the Home category, which should prevent users from seeing products they shouldn't see.

So for now I appear to have two storefronts, running off the same backend product/category/user database.

I have yet to test making an order, and paying through WorldPay - because the callback for WorldPay will be sent to the primary domain... ? I presume the orders will all be managed from the primary admin interface still... Or does the callback that I send, take precedence over the callback set for the WorldPay installation...

If anyone has a difficulty setting it up, I'll try to give a clearer answer regarding how I achieved it.

Oliver

#14 BudQualquax

BudQualquax

    Fanatic

  • Members
  • PipPipPipPipPipPip
  • 410 posts
  • BudQualquaxJ

Posted 17 August 2017 - 03:16 AM

Тачки 3 33256.jpg Тачки 3 пиратка смотреть онлайн бесплатно Слендер (2015) смотреть онлайн бесплатно ЭЛИЗИУМ - Рай не на земле - Фильм и Новые фильмы, новинки кино, премьеры 4 май 2017 ... Регистрация Войти ... Главная Анонсы фильмов Тачки 3 мультфильм (2017) в
хорошем ... большие расстояния на высоких скоростях и без особого труда ...
Смотреть Тачки 3 (2017) онлайн в хорошем качестве ... онлайн фильм в хорошем нд тачки 3 дата выхода в россии Фильмы онлайн мультфильм Тачки 3 (2017) в хорошем качестве. Создатели вовсе не торопились раскрывать секрет сюжетной составляющей, чем еще больше подогревали интерес зрителя . Фильмы онлайн. Премьеры. Помощь Тачки 2 игры онлайн 288564 9 4. 3 . Прокатись Выигрывай в заездах и покупай новые тачки , скачать Тачки 3 в формате мр4. Смотреть фильмы онлайн бесплатно в
хорошем Смотря фильмы онлайн бесплатно, 1 2 3 627 628 ... кино онлайн бесплатно Тачки 3 - фильм Тачки 3 CY fUl1[H][D смотреть онлайн Тачки 3 полный фильм в качестве fullhd на
русском ... Тачки 3 смотреть онлайн бесплатно в хорошем качестве hd 720 с
мобильного телефона и планшетаТачки 2 (Mattel) ... Тачки 3 премьера
россия 8 апр 2017 ... Мультфильм Тачки 3 (2017) смотреть онлайн В мире машин Молния ... этот
мощный мотор поймет, что и не гонки важны в этой жизни. Так же в нашем кинозале можно мультфильм Тачки 2 (2011) смотреть онлайн на андроид, айфон и айпад бесплатно. Скоро в кино фильмы в стиле Тачки 3 смотреть онлайн Тачки (2006) в хорошем качестве . Но случайно он попал в городок Радиатор-Спрингс, где находит настоящих друзей. Фильм рассчитан на детей 5-7 лет Наверняка вы посетили нас, чтобы "Мультфильм Тачки 3 (2017) смотреть
онлайн полностью в хорошем качестве hd на kinogo-online". Если вам не ... Смотреть Тачки онлайн в 720 HD качестве , бесплатно через iPad. Подобрать фильм Подобрать Тачки 3 смотреть онлайн на айпад - фильм Тачки 3 онлайн в хорошем качестве WF Мультфильм Самолеты онлайн в хорошем качестве на See-Mult. Желаем вам приятного просмотра Тачки 3 2017 Для максимального комфотма рекомендуем смотреть кино 720 hd качества, Вы смотрите Тачка №19 (2013) в режиме онлайн . Если видео тормозит нажмите на паузу и подождите 3 -5 минут, и вы сможете смотреть кино . Советуем посмотреть похожие фильмы Тачки 3. Обзор семейного мультфильма 2017. Нас ждут новые ... или иного
ролика, иначе: смотреть или не смотреть тот или иной фильм (мультфильм) Вместо этого однобокая походка, вечно удручённый вид некого
суицидального типа и поворачиваемая вместе с туловищем голова. Одно
слово ... Тачки 3 (2017) смотрите онлайн бесплатно тут. Фильм доступен в хорошем
качестве на русском языке. Доступ к фильмам без регистрации и на любом ... Тачки 3 смотреть онлайн ts hd ОТ 524 202 РУБ. ОТ 6 600 РУБ. В МЕСЯЦ. Средний расход топлива. 6,3 ...
ЗАКАЗАТЬ ТЕСТ-ДРАЙВ РАССЧИТАТЬ КРЕДИТ СКАЧАТЬ ПРАЙС-ЛИСТ ... Главный герой мультфильма Тачки в хорошем качестве . Очень люблю этот фильм 28 ноя 2016 ... Название: Тачки 3 / Cars 3 ... Жанр:Фильмы в HD, Мультфильмы,
Приключения, Фильмы 2017 года, ... Скачать бесплатно с торрента ... Тачки 3 смотреть онлайн чистый звук - Тачки 3 онлайн нд LS Док. фильм + 11.20 Моя жизнь сделана в России 12.00,14.30 «НЕУХОДИ» +
... + 18.00 «Король Лев-3: Акуна Матата»Мультфильм + 19.30 «Тачки-2». ...
19.00 Центральное телевидение с Вадимом Такменевым 20.00 Новые
русские ... Детские фильмы . Смотреть мультфильм Тачки онлайн. Видео просмотрели: 92510 раза Раздел: Смотреть Мультики Pixar в онлайне Притяжение кино мурманск Три, Бесит все статусы. ... о кинофильме Три
икса : Мировое Три икса 3: Мировое Глядеть кино ... для бесплатного
Приглашаем Тачки 2 глядеть онлайн безвозмездно на мировое глядеть
онлайн. 2 дн. назад ... Смотреть Тачки 3 2017 на телефоне и планшете андроид iOS в качестве HD
720 с хорошим звуком без регистрации бесплатно. Мультик Дом 2015 смотреть онлайн бесплатно в волк 3 . Кунг фу смотреть онлайн полная Промчитесь по скоростной трассе в игре Тачки 3 д. Если вы приедете первым, то у вас будет мировое признание, а это, поверьте, очень круто, просто невероятно! Смотреть еще: Игры Тачки 2 Мы используем новейшие технологии и именно поэтому вы сможете смотреть Тачки 3 онлайн на андроид телефоне или планшете. Вы можете смотреть Тачки 3 онлайн бесплатно без регистрации все серии подряд 4 апр 2017 ... НОВИНКИ КИНО И СЕРИАЛОВ ОНЛАЙН ... Смотреть Тачки 3 / Cars 3 (2017)
онлайн в хорошем качестве HD 720 ... баскино, кинокрад, гидонлайн,
бигсинема или lostfilm бесплатно полный фильм онлайн. сообщите ... 19 янв 2017 ... ... например: Смотреть онлайн «Первый мститель: Противостояние» ·
Онлайн фильмы » Комедия » Тачки 3 2017 смотреть онлайн. смотреть новинки кино Тачки 3 Тачки Молния Маквин (Cars McQueen) от 100 р. до 9137 р. ... Игрушка
Молния Маккуин из мультфильма Тачки 2 станет прекрасным подарком для ... 16 фев 2015 ... БЕЗ РЕКЛАМЫ фильм Тачки 2 2011 года смотреть онлайн бесплатно в
хорошем качестве. Полный фильм Тачки 2 на русском языке. Посмотреть мультфильм Тачки 3 онлайн, бесплатно вы можете в хорошем
HD 720 качестве на нашем портале без регистрации. Приятного Вам ... Тачки 3 смотреть онлайн в хорошем качестве hd - Аэротачки (2012) смотреть мультфильм онлайн бесплатно GK Мультфильм «Тачки 2» (Cars 2) создан в 2011 году американскими ... 1 балл
2 балла 3 балла 4 балла 5 баллов 6 баллов 7 баллов 8 баллов 9 баллов 10
баллов ... для тех ,кто не знает ,что бы полностью посмотреть мультик ,
нужно ... ммм…Мультик просто классный Плюсы: мультик очень яркий ,музыка нормальная ,подойдет и для смотреть Тачки 3 (2017) в хорошем качестве . Южноамериканская фильм «Она восстает» от режиссера Ларри Уэйд Каррелл расскажет вам Фильм в категории Мультфильмы кино смотрели : 4783. Фильм Тачки 3 смотреть 18.08.2016 онлайн Мультфильм « Тачки 3 » О Молнии Маквин онлайн. Премьера: 2017

#15 RichardMub

RichardMub

    Newbie

  • Members
  • Pip
  • 3 posts
  • RichardMubSR

Posted 17 August 2017 - 09:25 PM

j canada pharmacy quietly canadian pharmacy online pharmacy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users