Skip to Content Skip to Menu

Solution for auto synchronize CB e virtuemart

  • vipzeus
  • vipzeus
  • OFFLINE
  • Posts: 54
  • Thanks: 3
  • Karma: 0
13 years 8 months ago #150275 by vipzeus
Hi all

Im create this thread for everybody who does not use the CB login module for many reasons.

One of them is the on-line stores made by virtuemart where registration must be with vm login for the invoices and shipping field.

For every new registration i need to go at CB tools and syncronize manually the database but with 1 small hack everything works properly for me.

First of all must bypass the registration form with this plug-in where i public at my old post.
www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,13/id,129371/#129371

After install or ftp this plug-in, each registration request by-pass the CB registration form and gone at joomla or virtuemart registration form.

Use the standard login module and at mod_login.php add these lines:
[code:1]$sql_sync = "INSERT IGNORE INTO #__comprofiler(id,user_id) SELECT id,id FROM #__users";
$database->setQuery($sql_sync);
$database->query();[/code:1]

Thats work perfectly for me and i use at my main site joomla 1.5.22 with sync component for my subsites and work biderectional.

From the first login i have the user panel without any manually synchonization.

The code i found it here www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/id,77352/catid,29/limit,6/limitstart,0/ so, before do any modify at your site, read con attention.

I repeat, for my site its work perfectly but each site has own configuration;)

Good luck

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48323
  • Thanks: 8254
  • Karma: 1443
13 years 8 months ago #150285 by krileon
I don't really recommend this approach. While it will work it causes you to have an incomplete CB installation. This is due to using Joomlas login module and not CBs. Using CB isn't as simple as doing an insert query, that's not how it works. In addition to this you implemented a hack you'd lose with every release of Joomla.

I HIGHLY recommend using our documentation subscriber incubator project CB VirtueMart, which is availalble to all documentation subscribers here .

This will allow you to use CBs Login module and setup synchronizations TO VirtueMart (instead of FROM) at various triggers (you customize the triggers, such as after login or profile update). This allows 100% synchronization with CB. It's also possible to combine with CB Triggers so you can redirect FROM VirtueMarts registration to CBs. Additionally you can assign users to VirtueMart groups based off the trigger and even usergroup (so moderators can be made store managers!).

Please note if you choose to use CB VirtueMart and need help please post on the projects forums in the incubator.

Post edited by: krileon, at: 2011/01/06 21:40


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: scubabyss

Please Log in or Create an account to join the conversation.

13 years 8 months ago #150394 by wernerdohna
Replied by wernerdohna on topic Re:Solution for auto synchronize CB e virtuemart
Hi,
the method of vipzeus seems to be the only suitable solution for me, as I need to synchronize from Virtuemart to CB, not CB to VM.
I have CB 1.2.3 and because I have installed some hacks I cannot change to CB 1.3.1.

I entered the modification in mod_login but it still doesn't work.
Does the code need to be adjusted for CB 1.2.3 ?
Where exactly do I have to copy this code segment ?
Please help.

Post edited by: wernerdohna, at: 2011/01/08 21:26

Please Log in or Create an account to join the conversation.

  • vipzeus
  • vipzeus
  • OFFLINE
  • Posts: 54
  • Thanks: 3
  • Karma: 0
13 years 8 months ago #150401 by vipzeus

the method of vipzeus seems to be the only suitable solution for me, as I need to synchronize from Virtuemart to CB, not CB to VM.

Yes, it is very importand for commercial sites to use the vm or other system login module.

I have CB 1.2.3 and because I have installed some hacks I cannot change to CB 1.3.1.

There is NOT any hack of CB core or plugins.

I entered the modification in mod_login but it still doesn't work.

Does the code need to be adjusted for CB 1.2.3 ?

First of all, did you bypassed the registration for by 2 plugins found here?
www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,13/id,129371/ #129371

Then you have to use the joomla login module and add at mod_login.php the code

$sql_sync = "INSERT IGNORE INTO #__comprofiler(id,user_id) SELECT id,id FROM #__users";
$database->setQuery($sql_sync);
$database->query();

Here is an example from my 10 first lines of my mod_login.php

<?php
/**
* @version $Id: mod_login.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
$sql_sync = "INSERT IGNORE INTO #__comprofiler(id,user_id) SELECT id,id FROM #__users";
$database->setQuery($sql_sync);
$database->query();

I tried many ways, but its the only way who does work perfect.
The following user(s) said Thank You: wernerdohna

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48323
  • Thanks: 8254
  • Karma: 1443
13 years 8 months ago #150461 by krileon
Very well, use at your own risk. Again, using CB is not a simple insert query. Your user information WILL go out of sync. The idea of the incubator project is to keep VM in sync with CB allowing you to use all of CB (including its login module).

I am also aware the hack is not a CB hack, but it is a Joomla hack.. however it's a hack none the less, which should never be performed and instead done by way of extension as Joomla does have authentication API for providing a plugin to fire after login.

At any rate, best of luck. Please keep in mind if you have an issue in the future we can not help you as you've an incomplete installation with hacks in place.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #151029 by wernerdohna
Replied by wernerdohna on topic Re:Solution for auto synchronize CB e virtuemart
Hello all,

thanks for your hints and helps.
I do now use the VM Login.
I edited the controller.php of the VM Login and inserted the sync-query.

It works perrfect for me.
Thanks !

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum