i would like to be able to sort the way products are displayed in 'all products' page.
the only solution that i found around this subject is changing the creation date, what i dont see very professional to give to a client :)
i would like something like draggable views, but, at the moment, none of the modules that sort in views support entities...
i can sort creating an integer field on the product, but it is not very usable to have to enter numbers for a long list of products or if you need to rearrange, you have to edit many products.
i imagine that some of you had this need and i would apreciate if you tell to me how you solved it.
thanks a lot :)

Members fund testing for the Drupal project. Drupal Association Learn more


jsacksick’s picture

Are you looking for something like this ? http://drupal.org/project/weight

candelas’s picture

thanks @jsacksick :)
i looked yesterday on it, but it uses the sticky field to weight and i use sticky in other thing, so i cant use it.

today i spoke with pcambra in the chat and he told to me that the draggable views works for him with commerce kickstart (edit: he tells to me that it was with commerce).
but he orders using tabledrag [1] for ordening.
i didnt know about this possibility, but monday i have a meeting with the client and i am very late.
so, depending on the meeting, i will see if i can give more time now to this or we can go at the moment with my simple solution (they have a fixed amount of products).

since, i think, new people using kickstart may want to sort these views, i try to document in this issue how i resolve it.
also, i think that in chat it is difficult to explain and maybe i got something wrong o explain bad when i talk with pcambra :)
any help on this is wellcome :)

how i am now:

i have an integer field in the product to order.
in views, in "products" "products/list"and "collection/%" i use it in the sort criteria and everything works perfect.
draggable views ok

as soon i try to use draggable views, i get this errors:

Notice: Undefined index: sorts in options_form() (line 32 of /xxx/sites/all/modules/draggableviews/handlers/draggableviews_handler_fieldapi.inc). => 

Warning: Invalid argument supplied for foreach() in options_form() (line 32 of /xxx/sites/all/modules/draggableviews/handlers/draggableviews_handler_fieldapi.inc). => 

draggable views problem

i am following a issue in draggable views with this error https://drupal.org/node/1751610 (i searched for the error but there are few results).

edit: i have tried with draggable views 7.x-2.0, 7.x-2.0-beta1 (pcambra told to me he was using this one in commerce (not in kickstart) and 7.x-2.x-dev

thanks for any input :)

[1] http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_tabledrag/7

candelas’s picture

if in the second image i select as handler the FieldAPY and choose as a field my integer field, i get the same errors.

cn313’s picture

Commerce Kickstart has a sort method installed by default (powered by Search API), the sort block appears on the all products page.

See it for yourself http://demo.commerceguys.com/ck/products

candelas’s picture

@cn313, i know, thanks.
but what i need it is to be able to sort with a mechanism similar to draggable views, which means that the products can be rearranged by Drag'n'Drop in a view similar to the products management.

joshmiller’s picture

Assigned: Unassigned » joshmiller

Documentation Tasks Cleanup. This is on my list and will be done soon.

candelas’s picture

thanks @joshmiller, thanks for assigning yourself this task.

i have also tried to put draggable views in admin/commerce/products/list in the view Commerce Backoffice: Products. i dont get any error but it doesnt work.

in this draggable views issue , one of the maintainers is studding how to solve it. maybe you can collaborate.

thanks :)

bojanz’s picture

While this is a fun problem to solve, it shouldn't be a priority in the docs queue (we need to cover the functionality that we do have first)

iStryker’s picture

I am the co-maintainer of draggableviews. I have taken a look at this issue. If you create a product field called 'weight' then use FieldAPI. If you do not want to, then use Native.

The problem is with the sort field.

On the order sort page/block, you should see:
Draggableviews sort handler correct
But with commerce kickstart I see:
Draggableviews sort handler options removed

On the display page with this sort order you will see "Display sort as" like this:
Display page draggableviews UI

Commerce Kickstart removes the option_form settings, that is what is cause this error, and preventing draggableviews from working. I don't understand how it removes it, hopefully someone can shine a light on this.

candelas’s picture

thanks @iStryker for giving time to this issue. i neither know how they take away that...

iStryker’s picture

Ok, scratch my #9 comment. I got FieldAPI, Native handler and the way to sort them confused.

I managed to get this working for both FieldAPI and Native handlers using Draggableviews-7.x-2.x-dev and Commerce Kickstart 7.x-2.0-beta2 (sorry beta2 is the only test enivornment I have).

In the image above you have Native selected, but you do not have "Draggableviews: Weight", You need this to use Native handler.
In the image I see you have "Content: Product order". If this is a field, then you need to use the FieldAPI handler.

candelas’s picture

Issue summary: View changes

Hello again

After a year my client asked to add 2 new products. Since I had to reorder the product list in Commerce Kickstart, I tried again to add Draggable Views, but now it is not possible to add this kind of field. It doesn't appears in the field list to add. I imagine that is because it is an entity or something with Search Appy. If I create a view from 0 in the same installation Commerce Kickstart I could.

I used the last dev version in Draggable Views and the last stable distribution on Commerce Kickstart 7.x-2.12.

Any idea on how I can get it? I searched in internet but I didn't find any solution :)

candelas’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Category: Support request » Feature request
lsolesen’s picture

Category: Feature request » Support request
Status: Active » Closed (won't fix)

We are not going to include draggable views or other sort of manual sorting modules in CK 2.x. You need to implement this yourself. If you ever do, you are more that welcome to document your efforts here.

S@ilor’s picture

Hi Lars,

I quite frankly do not understand such a statement. Draggable Views is mentioned in several pages as the recommended method to make life a little easier for content managers in Commerce/Commerce Kickstart (see here: https://drupalcommerce.org/site-builders-guide/click-and-drag-manual-mer...)

I would personally be happy to be faffing about, and set this up myself, but like @candelas, I also do not get the options to add sorting with Draggable Views, when editing the Product Display view. It simply does not appear as an option. However, it does so in other views. So there must be something blocking in this particular view.

I will be greatly appreciated, if this issue could be solved, as there are no other viable method to my knowledge.

MrPaulDriver’s picture

I'd like to chime in with S@ilor because from a merchandising angle, displaying products is fundamental to the running of a shop.

Draggable views is the 'go to' solution with Views and that it is incompatible with commerce product displays is very disappointing indeed.

The sorting block provides some very limited utility for buyers, but is pretty useless for shop owners who need 'easy to use' granular control for product placement.

In the real world shop owners want to promote top sellers, loss leaders and sale items. A shop owner instinctively knows this stuff and should not be forced into complicated or abstract workarounds for something they ought to be able to do with their eyes shut.

A review of this important functionality would be most welcome, as would a change of status to 'should fix'.

MrPaulDriver’s picture

Component: Documentation » Code
MrPaulDriver’s picture

Title: Sort on 'All Products' page » Provide Draggable Views compatibility for product display views
jeffschuler’s picture

I had to recreate my view that lists Product Displays, choosing (on the initial View creation page) Show: Content instead of Product display.

Then you can easily add DraggableViews sorting to your displays.

hevmills’s picture

Is there any progress / update on this issue? I have just been informed that the project we are working on needs to support the sorting of products on a per-category basis. I have been working for some time with nodeorder and draggable views in order to get them working with Commerce Kickstart with no success. My client is getting rather impatient as they assumed this functionality would be in the core offering.

The main problem is that neither the weight fields from the nodeorder or the draggableviews modules are available in the sort order section of the product views in CK 2.x. Try as I might I can't seem to find a way around this.

I am very happy to put time into this, I just need a bit of help being pointed in the right direction. As jeffschuler points out, you can create your own views which then support sorting, but then you loose (afaics) the factets, and I am assuming there is a reason why these fields are not appearing - it would just be good to know why and if there is a way round this. There has obviously been a huge amount of work put into CK but this surely must be a core requirement for any modern e-commerce site.

Any help would be gratefully recevied.

macman911’s picture

I could also really do with being able to manually sort my products. Hevmills, did you find a solution?

hevmills’s picture

I am afraid I haven't yet, but my customer is turning up the heat so I will have to jump in shortly once I have sorted out a VAT / shipping issue on the same site :(

I will let you know if I get anywhere.

argiepiano’s picture

@hevmills, perhaps creating a custom module based on the Tabledrag example in the examples module?

candelas’s picture

@jeffschuler thanks for your solution :) Works perfect!