Developer forum

Forum » Development » Load eCom product groups into dropdown combobox

Load eCom product groups into dropdown combobox

Dmitrij Jazel
Reply
Hello everyone,

I have a small problem here, I was wondering how could it be possible to achieve this. Since the UI in this project is really top notch, I would really like to know what is the best practice here, rather than using tons of Ajax calls.
I would need to load categories (as custom field I understand) into the other dropdown combobox that will be repopulated depending on the group that was chosen.

I hope you got the point, was wondering what can you suggest I should do in this situation.
First off I would like to load the list of groups and be able navigate to it.
As easiest solution that I am working on is creating a Combobox, and read the value selected and include it into the url.

Is there any other less javascript dependent approach I could/should go with?
function viewGroup() {
    
    var fullurl=window.location.search
    var param=(fullurl.slice(1));
    
    var pairs = param.split("&")
    var targetvar = "GroupID";

 alert(pairs[0]);
        
    for(var i = 0; i < pairs.length; i++)
          {
          var pos = pairs[i].indexOf('=')
          if (pos == -1) continue
          var argname = pairs[i].substring(0,pos)
          var value = pairs[i].substring(pos+1)
        etc...
}       
   
  }


The reason why I am still a bit in doubt, it is because the UI will be quite complex, and I would like to reuse this code on other pages if possible to keep the template as clear as possible.
Maybe I should go with some custom module controll?

-Dmitrij

Replies

 
Morten Snedker
Reply
 Hi Dmitrij,

Just to be clear on this:


What you want, is to have a dropdown, in which you have you ecom-groups...yes?

Regards /Snedker

 
Dmitrij Jazel
Reply
 Hello Morten,

The issue actually is a part of a custom control that I need to have on the solution frontend :)
Since the paging possibilities in the eCom catalog are rather limited. I have a need for something like this (see the attachment).

And I was thinking should I choose to go with frontend js/css approach, or that can it be achieved only with custom module.

And when I made this thread, I was thinking about js/css approach, I was not sure how can you load the list of groups and categories based on groups without custom module.

Or should forget about frontend approach, and go with custom module right from the start. To make sure that I could reuse this module on other custom solutions and keep the template clean from any additional js and css so to speak...

But than, I don't know how can you provide that products-per-page feature to the frontend.

And all I wanted to know is simply which approach would be the best for this kind of situation.

I hope this brings more light regarding the issue.

Regards,
Dmitrij
productPager.png
 
Pavel Volgarev
Reply
Hi Dmitrij,

Take a look at the template tags for the product list: Dynamicweb templates - Product list.

-- Pavel
 
Dmitrij Jazel
Reply
 Hello Pavel,

Thanks for the info... I will try to dig into those particular tags. But as far as I remember, those tags are standard eCom template tags.
I have tried to use those (if not those exactly), and I couldn't make the navigation pager with page numbers and products/page option.

And as I can understand, you are suggesting to take front-end approach towards this particular situation. So I will give it a try :)

Regards,
Dmitrij

 

You must be logged in to post in the forum