VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: bboom on December 06, 2014, 19:33:17 PM

Title: Use multiple category selections one page
Post by: bboom on December 06, 2014, 19:33:17 PM
Hi,

I'm developping an extension to sync a POS system with VirtueMart. I created a config page with multiple category selections on one page (the POS system has 99 hardcoded category id's and cannot export categories).

When I change the first category everything is displayed as the first one. I can solve the problem with ading self::$categoryTree = null; to the function categoryListTree in shopfunctions.php. I don't like core hacks, is there another option to use the vmcategory field mutliple times on one page?

I'm using:
VM 3.02
Joomla 3.3.6
Title: Re: Use multiple category selections one page
Post by: Milbo on December 11, 2014, 13:39:09 PM
If you call it with another category Id, you should get another instance. Is the cache hash missing something?
Title: Re: Use multiple category selections one page
Post by: bboom on December 11, 2014, 18:28:42 PM
I use the default joomla config xml, all fields have different names, I think the joomla config is working well. It could be that the cache hash is missing something.

Can I check that? how?
Title: Re: Use multiple category selections one page
Post by: Milbo on December 12, 2014, 22:55:24 PM
I need to have more info to understand what you wanna do.
Title: Re: Use multiple category selections one page
Post by: bboom on December 13, 2014, 11:22:31 AM
I created a config file for my component like:

<fieldset
name="artikelgroepen"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEPEN_LABEL"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEPEN_DESC"
addfieldpath="/administrator/components/com_virtuemart/fields"
>
<field
name="groep-nul"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_00"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_00_DESC"
default=""
></field>
<field
name="groep1"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_01"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_01_DESC"
default=""
></field>
<field
name="groep2"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_02"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_02_DESC"
default=""
></field>
<field
name="groep3"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_03"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_03_DESC"
default=""
></field>
<field
name="groep4"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_04"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_04_DESC"
default=""
></field>
<field
name="groep5"
type="vmcategory"
label="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_05"
description="COM_VIRTUEMARTBRONBOEK_ARTIKELGROEP_05_DESC"
default=""
>
...


When I change a category in the settings, it is correctly saved in the database, but when I reopen the config page I get all category dropdowns with the same value as the first one.

I this enough information?
Title: Re: Use multiple category selections one page
Post by: Milbo on December 18, 2014, 22:02:23 PM
maybe it is easier if you send me your component per pn.
Title: Re: Use multiple category selections one page
Post by: bboom on December 18, 2014, 22:39:26 PM
I sent a PM
Title: Re: Use multiple category selections one page
Post by: Milbo on January 22, 2015, 13:27:51 PM
btw, the problem is fixed.