Author Topic: Show me specific custom field list, when i select another custom filed...  (Read 2467 times)

Alexikakos

  • Beginner
  • *
  • Posts: 12
hi all,
I have virtuemart (v3.4.2) shop which sell cars.

I have 4 customs fields:
1. manufacture (in costum field, not virtuemart manufacture. It is String type and list, so in add new product process, in backend you select from drop down list the manufacture)
2. model (String type and list with cars model)
3. cc
4. year

I am try to find a way, in backend, when i add a new product and i choose, in custom field manufacture "BMW", in model drop down list to show me only BMW models. Not from other manufacture.

ps i use "vm custom Filters PRO" for filtering the results.

Any idea??? :P

Δήμητρα Ροδοστόγλου

  • Beginner
  • *
  • Posts: 5
  • A beginner
Hello,
I have the same problem. I've been searching for a solution but i have found nothing.

I am also using the custom fields PRO plugin. Is there any other plugin that can help?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4381
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
You can certainly verify if manufacturer is selected and hide or nor render the second list using javascript or php if the list is not dynamic rendered using ajax.

Alexikakos

  • Beginner
  • *
  • Posts: 12
I created a custom field (string - list) for every car brand and in list i have assign all model of specific brand , separating with ( ; ). The name of custom field, for brand models, is the same with manufacturer. eg i have a custom field named "BMW" and inside i have in list all BMW models. (same name for vm manufacturer and model custom field)

Remember i have also custom fields "year" and "cc", which are used in every product - car.

I try to find a solution (i suppose java) which when i select from virtuemart  manufacturer "BMW" in custom filed area, i want to appear custom field "BMW", "cc", "year". if a select from vm manufacturer "Fiat"  i want to appear custom field "Fiat", "cc", "year".

i just dont know how...

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4381
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
I have understand the problem. This need to modify the PHP or Javascript.
I dont know exactly the code of vm custom Filters PRO, so i cannot write the code without access to the site and some time to develop it.
PM me or use any contatct form in my website, if you dont find a solution, so i can do the Job.

Δήμητρα Ροδοστόγλου

  • Beginner
  • *
  • Posts: 5
  • A beginner
Could we possibly have all the custom fields appear in the Add Product page (without clicking on each custom field) and then, when the user adds a Manufacturer, only the Manufacturers model will remain open (the rest will be hidden) using some javascript.

E.g.
I am creating a new product that is Fiat (manufacturer),  Punto (model - custom field) and 2001(year-custom field). So, when the page opens, all the custom fields are open (models and years, including BMW and Toyota models).  When I enter the manufacturer (Fiat), the custom fields Year and Fiat Models remain visible while the rest hide.

Is there a way we could do this?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4381
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Could we possibly have all the custom fields appear in the Add Product page (without clicking on each custom field) and then, when the user adds a Manufacturer, only the Manufacturers model will remain open (the rest will be hidden) using some javascript.

E.g.
I am creating a new product that is Fiat (manufacturer),  Punto (model - custom field) and 2001(year-custom field). So, when the page opens, all the custom fields are open (models and years, including BMW and Toyota models).  When I enter the manufacturer (Fiat), the custom fields Year and Fiat Models remain visible while the rest hide.

Is there a way we could do this?
Certainly, but this need some custom code. I cannot answer you with a generic solution.

diri

  • Jr. Member
  • **
  • Posts: 117
  • VirtueMart Version: most recent dev version (trunk)
This problem is old. I tried different ways to overcome some of the limits of VM without changing code or development. Best result I achived with grouping custom fields. But: It's no fun to work with it the way it is implemented. Eg automatic assignement to specified categories is missing in core to be able to manage products in an easy and effective (=productive) way.

Using manufacturer as product and model (= product) as custom field is no real solution. Because of structure of DB custom fields impose to many limits especially when there are many products and attributes.

Even with car manufacturers (eg Fiat) there are many models and spare parts as well as many other products being related. Here one should be able to assign manufacturer (eg Fiat) to multiple categories to have chance to select or add parts related to Fiat in any product category being available. You might describe it with original and 3rd party products.

The basic most limiting factor for such problems I encountered in real world scenario is VM's limit to assign a manufacturer to one product category only. This is a limit is far from reality since many years. Removing this limit is kind of basic in core to use product categories and custom fields more efficient. Fixing DB structure not only but also in relation to custom fields is overdue as well.

In case you have multiple manufacturers offering products in multiple categories this limit being imposed causes a real nightmare at the end. Sorry.

Onliest solution I see at the moment is an own backend with extra tables (might be in extra DB) which transfers data to VM tables while taking VM's limits into account. Missing import / export capability of VM is another missing core feature which forces to develop some own extension or depend on products like CSVI.

cu, diri

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 744
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates