This was original requested by shimodart in #449324: Add support for uc_attributes.

To avoid loosing it in that long thread I have recreated it here as a feature request.

I'm now in urgent need for uc_views_attribute help.

I think at the moment I can put the filter for "Order Product: Attribute: (attr name)",
but it's not possible that putting the filter by "Product: Attribute (attr_name)", is this right?

I'd like to let users choose products by attribute regarding stocks where they are purchased or not.
The functionality I'm going to achieve is the searching function like http://www.lafraise.com/ .
(please refer the attachment file)

Very appreciated if anyone can provide the patch for this.
Thanks!

Comments

selinav’s picture

subscribe

shimodart’s picture

Does anyone have even any tips for this?
Thanks!!

sgriffin’s picture

subscribing. It appears possible to filter by attributes ordered, but not the products themselves.

hanoii’s picture

I took a quick look at this, and tried to do some testings but I haven't gone further enough with it, I might get to do some work into this soon, but not sure how soon.

kmonty’s picture

Subscribe

sgriffin’s picture

I found a good way to do this. Simply duplicate each attribute as a term.

melon’s picture

@sgriffin This is not really an option when you have hundreds of attribute options and and counting.

Anybody looking at this? I'd love to hear about some progress :)

Emma’s picture

I could really do with this as well...

I sell bras so would like to offer the option to customers to search by sizes available.

patchak’s picture

Same thing is needed here : we would like to work on this, but not sure about the best approach, any tips or directions`?
Thanks

Emma’s picture

Have just added this module by ddagradi and seems to be working...

http://www.ubercart.org/contrib/3960#comment-43532

melon’s picture

@Emma: this module is great, thanks for the tip. However it has a limitation: it doesn't work with two attributes (e.g color and size) together.
However I hope a maintainer checks this module out, it might help implementing this functionality into uc_views.

Emma’s picture

@Melon - Yes I found that problem too. Am now looking at faceted search but again no product attributes functionality but at least can add a keyword search to the filters that does pick up on the product attributes.

Surely any decent e-commerce solution needs a way for customers to be able to search/filter products by attributes such as size colour etc.....

Let me know if you get any further.

rootwork’s picture

Status: Active » Needs review

Tried as well and it works with the limitation.

Can we get this integrated into uc_views dev and start working out some of these bugs?

patchak’s picture

We need this for a client, so this feature should be made available in the coming days!!
I'll keep you guys posted.

tjjacobsen’s picture

re: #10: I'd love to try this, but the link (http://www.ubercart.org/contrib/3960#comment-43532) only takes me to the contrib home. Not the specific module mentioned. Thoughts?

rootwork’s picture

checker’s picture

+1

philipjterry’s picture

can we achieve precisely what Amazon are offering? Any progress?

monotaga’s picture

I installed the module at http://www.ubercart.org/comment/43532, but I didn't get any new filter options under "Product" (or anything similar). Where are you folks seeing the new attributes show up?

monotaga’s picture

I disabled uc_views_attributes, and "Product Attributes" showed up. There must be a conflict between the two.

zkrebs’s picture

How do you set up the view filters to show attributes that are in stock only? with #16 module. Willing to put a $50 bounty on getting this solved.

I need a list of my products of a particular size, ONLY if they are in stock. The stock of that size.

http://www.ubercart.org/forum/bounties/19282/views_filter_product_attrib... added a bounty.

UPDATE: I see that I can also use a filter of stock, but the #16 module does not seem to respect that. Any ideas?

Also considered de-activating the attribute when it goes out of stock, but there seems to be no rule for this, and of course this removes the adjustment SKU from the system and that is unacceptable.

sgriffin’s picture

Use a views template so that the output isn't displayed when its out of stock.

zkrebs’s picture

#22, could you assist with what code would go in the views template? I found http://www.ubercart.org/comment/53025 which shows how to not show a field if a product is out of stock. How to move that up one level, to not show the node, if a field is 0?

The default view template seems to be:


<?php
// $Id: views-view-unformatted.tpl.php,v 1.6 2008/10/01 20:52:11 merlinofchaos Exp $
/**
 * @file views-view-unformatted.tpl.php
 * Default simple view template to display a list of rows.
 *
 * @ingroup views_templates
 */
?>
<?php if (!empty($title)): ?>
  <h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
  <div class="<?php print $classes[$id]; ?>">
    <?php print $row; ?>
  </div>
<?php endforeach; ?>

Is there a way to use a views argument handler or a phpviewsfilter to accomplish this?

sgriffin’s picture

phpviewsfilter could be a good way.
or you could create a global variable in the field template and access that in the the shown template and prevent any code from executing if it's not found.

zkrebs’s picture

I tried phpviewsfilter and it seemed to not work. I wasn't able to pass along the filter of the attribute to the stock filter.
Would you mind elaborating on your solution a bit more, for someone who is very new to PHP programming. Perhaps in a more step by step? If you're too busy or don't want to, that is understood.

sgriffin’s picture

Well you really have to learn views theming itself.
For your fields you have a template named views-view-fields--[viewname].tpl.php

global $global_fieldname;
$global_fieldname = $fields['fieldname']->content;

Then you can setup a page tpl based on the path and take direct control of output of your views by accessing this variable.
Your configuration/setup/theme could be all over the place so details are pretty useless to give. You'll have to brush up on php or hire a programmer.

summit’s picture

Hi, I have sort of the same request as http://drupal.org/node/651036#comment-2978504. Having attributes for color and for size.
Is this possible now with the current Ubercart Views? And does this view also have the option images?

greetings,
Martijn

mandreato’s picture

Subscribe

zkrebs’s picture

Is a developer interested in solving this as a paid project? This is a big need.

longwave’s picture

I haven't needed attributes support myself, but would be willing to implement this if people are offering to pay for this feature. Use my contact form to get in touch.

zkrebs’s picture

I submitted the contact form - was wondering what it would take to get this to work? Perhaps we could pool in some cash for you.

zkrebs’s picture

I submitted the contact form - was wondering what it would take to get this to work? Perhaps we could pool in some cash for you.

rootwork’s picture

Definitely, I think pooling cash for this would be doable.

Also, I never knew Slavoj Zizek was a Drupaler ;)

razorback’s picture

subscribe... i'm willing to pitch in some $ for this as well. Need asap. Thanks

Spider84’s picture

I need this feature very much.

mattcasey’s picture

Hi, I was able to return a particular attribute in its own field using PHP with Views Custom Field module installed. First add the field "Ubercart order product: Product attributes". Then add a custom PHP field. The trick is to first unserialize the product's information into an array. In my case, I only have two attributes so I created a custom field for each, using the following:

$product = unserialize($data->uc_order_products_data);
//uncomment the next line to find the attribute field
// print '<pre>'; print_r($product); print'</pre>'; 
$attribute = $product['attributes']['attribute_label'][0]; //attribute field
return $attribute;
 
summit’s picture

Hi,
referring to #36, you said "in my case, I only have two attributes so I created a custom field for each, using the following"
Do you mean your $attribute is now holding the attribute_label? and what is your other atrribute then?

I have attribute color and attribute size, how can I get to those 2 fields seperately please?
Thanks a lot for your reply in advance!
Greetings, Martijn

mattcasey’s picture

Well, first I should warn that my method in #36 uses information from processed Ubercart orders, so if you're looking to pull in all the default options for each attribute, regardless if they've been purchased, this may not work.

We sell subscriptions on our site, so my view needed to build a list of options selected by each customer. $attribute here is temporary, it could be called anything, and attribute_label should be changed in each field depending on the attribute you want. Note if you change the label as it appears on product pages, this will need to be changed as well! The [0] means there's one selected option for each attribute. If you let people choose multiple options for one attribute, you might want to put a loop here or something.

So, you have two attributes with the labels "Color" and "Size." You would copy the above code into a Views Custom PHP field, and change the fourth line to say $attribute = $product['attributes']['Color'][0]; and do the same for 'Size'. It would show you all the products bought and what color and size the customers selected.

zkrebs’s picture

Is there any way to add a filter that makes sure the attributes are also in stock, building on this code?

mattcasey’s picture

slavojzizek, it looks like Attributes already are supported in the Filters - I was able to add one from the group Ubercart order product: Attribute: "Attribute name" I'm using Ubercart Views 6.x-3.1

jerry’s picture

Subscribing.

jerry’s picture

I find that I will also shortly need the originally-described functionality: filters on (potentially multiple) product attributes, filtering against the product database rather than cart contents or previous orders. I will also need to be able to optionally filter for in-stock items (which the existing stock filter may or may not permit; I haven't dug into that yet). Before I extend the module to do this myself, has anyone already begun this work?

razorback’s picture

I need this feature too. I never could get anything to work.

ratinakage’s picture

Subscribing... seems like the biggest feature missing in Ubercart at the moment.

jerry’s picture

I plan to work on an implementation this week. I'll post something when it's done.

zdean’s picture

subscribe

zkrebs’s picture

#45 - Could you also implement an attribute stock filter? Or make the attribute filter work with the stock filtering already available?

I have a product with 3 sizes, S , M, L.

I would like the user to choose S, and then see all the S that are in stock. Not if the product node is in published or not, but if the attribute you selected is in stock.

EDIT: I see you already talked about this, would be nice, thanks.

jerry’s picture

StatusFileSize
new6.29 KB

OK, here's my first attempt at an attribute filter with inventory support. It's been tested only lightly thus far, but seems to work OK here with multiple attributes and multiple values per attribute. It skips the inventory check for a given SKU if its active flag has been cleared. Depending on your filter configuration, you may need to set the DISTINCT option for the query to reduce the results.

razorback’s picture

I am not sure how to install a patch. I tried a couple of programs (eclipse and some instructions i found here: http://drupal.org/node/75790#comment-2615716) but cannot seem to get it to work? Can someone provide the update files or help with how to install a patch on a windows machine? Thanks!!!

zkrebs’s picture

StatusFileSize
new31.72 KB

I haven't tested it, but I applied patch #48 to uc_views-6.x-3.x-dev.tar.gz and made a tarball for people who hate patching

razorback’s picture

I installed the patched files and everything is working great. It is also correctly filtering out products that are out of stock. I tried it in several pre-configured views I already have setup and have not ran into any issues at this point.

One question I have now that I have looked closely at the number of size options I have..... is there a way to link multiple options on the back end to a single option on the front end for the user to choose from. We sell children's clothing and each brand my classifiy the size a little differently. For example, if a user is looking for a shirt in a size 3M i need the view to return 0-3M, 3M, 0-6M, 3-6M. Would there be a way to do this? I dont want the user to have to select all 4 of the possible sizes. I want to keep it easy for them to only have to select one option. I don't know if that is possible with just the attribute views or not.

Thanks Jerry for your work on this. Let me know if I can help with anymore testing.

jerry’s picture

Thanks for the testing and the feedback. Glad to hear that it's working well for you.

With respect to grouping attributes in the way that you describe, I'm afraid that I don't have an immediate solution to suggest. Perhaps someone else here can help.

ratinakage’s picture

Does this patch make any changes to the database? Is it safe to test it on a live site?

Thanks!!

razorback’s picture

I don't think it makes any changes to the database.... i did test it on my production site in off line mode. I added to patched files and cleared the cache. THen went into the filter option in an existing view and set it up. Hope that helps.

jerry’s picture

razorback is correct; no database changes are involved. This file is modified:

  uc_views/uc_views_attribute/views/uc_views_attribute.views.inc

This one is new:

  uc_views/uc_views_attribute/views/uc_views_attribute_handler_filter_product_attr.inc
ratinakage’s picture

Just a quick test on my live site. It seems to be showing duplicate results where it wasn't doing so before.

Any ideas?

ratinakage’s picture

http://www.ecloset.co.za/shop/clothing - Reveal the filters on the right by clicking "Search eCloset" then when you select colour ranges (colour is an attribute for me), you get duplicate products. Whereas the rest of the filters are working properly.

ratinakage’s picture

OK. Changed my View to distinct and it fixed the problem.

So yah, I think its working nicely now!!

Thanks!!

zkrebs’s picture

what a cool views filter block/site btw

ratinakage’s picture

Thanks!!

Couldn't have done it without you.... ;)

By the way, any idea how I can order the filter attributes? The order they display there on the checkbox list is different to the (correctly configured) order that they appear in the attribute options page.

Thanks!

summit’s picture

@ratinakage, what do you use as lightbox module?
And how do do the selection of color and size, are those attributes?
greetings, Martijn

ratinakage’s picture

Ah, I fixed my problem.

In the file: uc_views_attribute_handler_filter_product_attr.inc

Changed: $result = db_query("SELECT name, oid FROM {uc_attribute_options} WHERE aid = %d ORDER BY ordering", $aid);

To: $result = db_query("SELECT name, oid FROM {uc_attribute_options} WHERE aid = %d ORDER BY name", $aid);

Not sure why you chose "ordering" or where that comes from but order by name makes more sense at least for my site.

Thanks again!

@Summit, I'm using MagicZoom

jerry’s picture

The 'ORDER BY ordering' clause allows the select list to honor whatever drag-order you specified for the options in the UC admin interface. I think that leaving it that way is more appropriate than assuming that everyone will want to use an alpha sort. If you do want an alpha sort, you can easily drag them into that order. Let me know if that doesn't make sense to you.

jerry’s picture

I should add that I missed your comment above about the order being different from what you see in the attribute options page. The point of confusion may be that there are two copies of this ordering: a default order per attribute, stored in the uc_attribute_options table, and a possibly-different product-specific order, stored in the uc_product_options table. The attribute filter uses at the former, not the latter, as you can see from the query. These are set in the UC admin interface by clicking the 'options' link for the attribute in question at Store administration -> Attributes.

ratinakage’s picture

Hi,

OK. Seems like I had to do one strange manual step.

I do go to the following page:

/admin/store/attributes/4/options - Where 4 denotes the 4th attribute in my system. When I view the attributes on that screen they are in the correct alphabetic order. Still, I clicked the first and swapped it with the second and then swapped them back (effectively making no change) and then hit save. This fixed the colour attribute. I did the same with size and it fixed the size attribute. Now they both work with your original code.

I guess ordering only really comes into effect when you manually force it to save an order. I guess this is an issue with attributes itself, if anything.

Oh well. Problem solved.

Thanks!!

jerry’s picture


I guess ordering only really comes into effect when you manually force it to save an order. I guess this is an issue with attributes itself, if anything.

Yes, if you've never arranged the options manually, and you created them all with the same "Order" value (which defaults to 0), they'll all have the same 'ordering' value in the database.

lanzs’s picture

seems to be working, thanks!

jbeuckm’s picture

I need attribute filtering in views but I'm running D6/Views 2. How can I swap in this version of views3?

jerry’s picture

The attribute filter patch is for use with D6/Views 2; it applies to Ubercart Views 6.x-3.x-dev. The Ubercart Views version number doesn't track that of Views.

Spider84’s picture

Hello!

Can you tell me for that versions of Views and Ubercart Views this patch is intended for?

jerry’s picture

The previous response answered that very question: Views 2.x (currently 2.12), Ubercart Views 6.x-3.x-dev

Maintainers: there are now several positive user reviews of this patch up-thread. Might one of you find some time to review it now, and, if it passes muster, commit it to the dev branch? Let me know if I can be of assistance with this.

mattkaneart’s picture

I was having difficulty making my views filter work for "Order Product: Attributes" and found a quick fix to the issue over here: http://drupal.org/node/780212

Seems like the change addressed over there might be relevant to include in the patch that began here-- but in any event, wanted to link it so that anyone else having this problem would find the answer a little quicker than I did.

*UPDATED THE LINK.

jerry’s picture

The link that you posted there actually points to this issue. Did you post to the wrong issue, or reference the wrong issue?

jerry’s picture

I don't believe that the patch for the order product attributes filter that you reference is relevant here, as the table in question (uc_order_products) isn't used by the product attributes filter discussed in this issue. There is no such ambiguity in the tables it references (uc_product_attributes, uc_product_adjustments, uc_attribute_options, uc_product_stock).

mjonesdinero’s picture

Hi everyone,

@ratinakage, how did you make a views out of that filter? did you use an argument?

Please help me with that.. thanks

any help will be welcome..

As of now, i will create a filter for the colors, and size how can i make it, such that after it select it will just load automatically and will not change the url thanks

mjonesdinero’s picture

how to do the selection of color and size, are those product attributes?

I have now a filter of the product like size and color but how can you combine it then how can you make a view out of it..please help me all..thanks

jerry’s picture


how to do the selection of color and size, are those product attributes?

Yes, that's typically how it's done. Configure these in the normal way. The patch I provided upstream allows you to create an exposed Views filter for each such attribute. These will appear in the list of available filters as "Product attributes: [attr-name]", where [attr_name] is whatever you named your attributes ("Color", "Size", etc.). Add and expose each one that you wish your users to be able to selectively filter by.

mjonesdinero’s picture

Thanks for the reply I mean how can you show this on your site? i have no idea to call it..

IS this has an argument?or what.. i am a new to ubercart.

Thanks in advance

jerry’s picture

No argument necessary, usually. This isn't so much an Ubercart configuration task as a Views one. If you're not familiar with creating exposed Views filters and/or displaying Views pages and exposed filter blocks, you should review the Views documentation. Those topics are a bit too broad to cover in this issue queue.

mjonesdinero’s picture

what i mean is how can you put those in your site how can you show it because it is juast a filre..fields are the one that is being show on the site..

dsdeiz’s picture

Hi, I can't seem to make this one work. I'm using Ubercart v6.x-2.4 and the patched Ubercart Views v6.x-3.x. One thing I noticed is that no data is inserted in uc_product_adjustments if the model in the adjustments tab of the product is equal to the product's sku...

jerry’s picture


what i mean is how can you put those in your site how can you show it because it is juast a filre..fields are the one that is being show on the site..

It occurs to me that you may be looking for product attribute fields for Views, not product attribute filters for Views. This patch doesn't provide that feature. There's a recent sandbox project, UC Views Attributes Work, which does. You might see if that will serve you better.

jerry’s picture


Hi, I can't seem to make this one work. I'm using Ubercart v6.x-2.4 and the patched Ubercart Views v6.x-3.x. One thing I noticed is that no data is inserted in uc_product_adjustments if the model in the adjustments tab of the product is equal to the product's sku...

That's correct. This patch provides an optional ability to filter by stock level, which requires use of the adjustments table to tie the attribute combination to the stock level via the alternate SKU. The assumption is that one would generally assign an alternate SKU, anyway. There's work being done to make the process of generating these more convenient; see this thread in the issue queue for UC Product Power Tools.

coolbits’s picture

Changed my View to distinct and it fixed the problem.

I do not understand how you did it. What is "Changed my View to distinct"??
I have duplicated items. And I do not know how to solve the problem. Help, please!

jerry’s picture

What is "Changed my View to distinct"?

Edit the view, and under "Basic settings", set the "Distinct" option to "Yes".

coolbits’s picture

Oh, thank you very much! I've found. I never used this option before.

jerry’s picture

If this patch is working for those of you who've applied it, I'd appreciate it if one of you would change the status to RTBC.

jasondecamp’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me. Thanks Jerry!

atilla’s picture

Version: 6.x-3.x-dev » 6.x-3.1

I was testing around with Product Attributes in UC_Views, though it didn't work well...
Yesterday I updated my Views from 6.12 to 6.14 and the UC_Views from 6.x-3x-dev to 6.x-3.1

I realized that the Product Attributes option in the Views filter has been disappeared since then. I tried disabling and re-enabling modules ad also checked permission. Do I have to use again UC_Views 6.x-3x-dev ?

Thanks for any reply.
Ati

jerry’s picture

Do I have to use again UC_Views 6.x-3x-dev ?

Yes. This patch has not been committed as yet, and it post-dates 3.1 anyway. You can either download the dev version and re-apply the patch, or install the copy of the dev version with the patch already installed supplied by slavojzizek.

Zakoomar’s picture

Thanks, works properly.

But stock level checking should be optional (in addition filter).

jerry’s picture

But stock level checking should be optional (in addition filter).

I agree that it be convenient to configure it that way, though I don't have time to evaluate such a change right now. In the mean time, I assume that you realize that turning off the SKU's active flag in the product stock configuration does disable stock checking by the filter.

Spider84’s picture

Can somwbody submit this patch to the module?

MattMoody’s picture

Assigned: Unassigned » MattMoody
Category: feature » support
StatusFileSize
new57.87 KB

I have an attributes 'Simple Price' and 'Unique Price'. Can this module help me to create filter by options in view? What I have now is just filter by type 'Simple Price' or/and 'Unique Price' not by it's value

jerry’s picture

Your options are the strings "Simple Price" and "Unique Price". It sounds as though you expect each of these options to have a value field as well, but it doesn't work that way. You could have two attributes, one for each of your existing options, which then had possible values as options. The attribute filter support would indeed allow you to filter by the values in that case.

Let me know if I'm misunderstanding what you're trying to do.

geefin’s picture

"I assume that you realize that turning off the SKU's active flag in the product stock configuration does disable stock checking by the filter"

I don't think it does? I've tried with the adjustment SKU in place, but the active flag off, and it still only shows items in stock... is there a way to show all items (in stock or otherwise)?

jerry’s picture

I've tried with the adjustment SKU in place, but the active flag off, and it still only shows items in stock...

I can't reproduce that behavior. With the active flag for a given alternate SKU disabled under the "Stock" tab, the filter selects an item whether or not its stock level is greater than 0. The query produced by Views should look something like this:

SELECT DISTINCT(node.nid) AS nid, node.type AS node_type, node.title AS node_title, uc_product_adjustments.model AS uc_product_adjustments_model, uc_product_adjustments.combination AS uc_product_adjustments_combination, uc_product_stock.stock AS uc_product_stock_stock FROM node node LEFT JOIN uc_product_adjustments uc_product_adjustments ON node.nid = uc_product_adjustments.nid LEFT JOIN uc_product_stock uc_product_stock ON node.nid = uc_product_stock.nid WHERE (node.status = 1) AND (node.type IN ('product','test_product')) AND ((uc_product_adjustments.combination LIKE '%i:3;s:1:"8";%')) AND (uc_product_stock.sku = uc_product_adjustments.model) AND ((uc_product_stock.active = 0) OR (uc_product_stock.stock > 0)) AND ((uc_product_adjustments.combination LIKE '%i:2;s:1:"3";%')) GROUP BY nid

You can see the stock check WHERE clause near the end - it ignores the stock level if the active flag is clear.

Splinter’s picture

May be someone help me. I downloaded patched module supplied by slavojzizek.
Add all field and all filter with 2 attributes (e.g. color and size).
All work i test in preview, and when i choose one or two filter in select, i can't get result, result is empty.

drupal 6.22
Ubercart 6.x-2.4
uc_views 6.x-3.x-dev (patched)

jerry’s picture

A couple of things to check:

  • Did you assign alternate SKUs to the product variations in the product "Adjustments" tab?
  • If stock checking for a given product variation is active, is its stock level above 0?
Splinter’s picture

To Jerry
No, i didn't assign alternate SKUs to the variations of product.
And stock level 0;

If i assign alternate SKUs and stock level be more than 0, it's work fine, But i my shop products more than 10000, and I do not keep level of product in stock.

Maybe this module can work if stock level equal 0 and no alternative SKU?
Thank you, sorry, my English ton so well

jerry’s picture

Maybe this module can work if stock level equal 0 and no alternative SKU?

As the filter is currently designed, you can disable the stock checking by clearing the active flag for that product variation, but a unique alternate SKU is still required to find and examine that flag. See this previous response for a possible solution.

While I haven't tested this myself, a quick review of the filter suggests that you may be able to successfully disable all stock checking and the need for alternate SKUs by removing or commenting-out these five lines from uc_views_attribute_handler_filter_product_attr.inc:

      if (is_null($this->query->get_table_info('uc_product_stock'))) {
        $stock_alias = $this->query->ensure_table('uc_product_stock');
        $this->query->add_where($this->options['group'], "{$stock_alias}.sku = {$this->table_alias}.model");
        $this->query->add_where($this->options['group'], "({$stock_alias}.active = 0) OR ({$stock_alias}.stock > 0)");
      }

These normally start at line 110 in that file.

longwave’s picture

Assigned: MattMoody » Unassigned
Category: support » feature
Status: Reviewed & tested by the community » Fixed

Committed #48. Sorry for the lack of responses, I just haven't had time to work on this module recently, but at least it's in there now!

jerry’s picture

Thanks, longwave!

heyyo’s picture

I am in the same case than Splinter, I'm not using stock and not using different sku for attributes.
I tried to comment the 5 lines mentionned by Jerry in #101, but it's the same behavior no result are returned when selecting an attribute.

Other bug the order of the attributes in the select box when filter exposed is not the same order defined in administration.

heyyo’s picture

Version: 6.x-3.1 » 6.x-3.2
jerry’s picture

I tried to comment the 5 lines mentionned by Jerry in #101, but it's the same behavior no result are returned when selecting an attribute

I've had an opportunity to test that now and concur. Commenting-out that section does disable the stock check, but it doesn't remove the requirement that an alternate SKU be assigned. Because the filter was designed to permit stock checking, it uses the uc_product_adjustments table to simplify the identification of matching attribute combinations. However, combinations without an alternate SKU don't appear in that table, and thus never match. (An alternate SKU is a requirement for stock level checking.)

Other bug the order of the attributes in the select box when filter exposed is not the same order defined in administration.

This is not a bug. Please review the previous discussion of select list ordering in this topic from response 60 to response 66.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pragna’s picture

Status: Closed (fixed) » Active

Hi All,

can anyone convert this patch into Drupal 7?

Many thanks,

rootwork’s picture

Ubercart Views doesn't have a D7 release. So much more than this one patch would need to be written...

halloffame’s picture

@jerry help!

I have 6 attributes, four textfield and the other two are select list. Using them as an exposed filter. I can filter the textfield alright in views but weirdly enough no result is being shown with the attribute that has a select list type. What gives?

Thanks.

jerry’s picture

Dunno, off the top of my head. Have you verified that you have alternate SKUs defined for each combination? Are using Views Hacks to do anything unusual with the filters? Is it an issue with stock levels? Does the preview query look OK to you? Is there anything of interest in the watchdog log?

Some details might help.

halloffame’s picture

Sorry I wasn't very specific... Nothing on the watchdog. Been monitoring that closely. Though, I would like to point out that those exposed filters were initially working but when I start adding alternate SKUs in the option it stopped working. However, created new products with no alternate SKU test it again but it is still not working. I commented out this one as per your instruction to no avail. Below is an example query that returned empty. I should've seen a lot of results like I used to whenever I enter 'Footer' in the exposed filter.

SELECT uc_order_products_uc_recurring_users.data AS uc_order_products_uc_recurring_users_data,
uc_order_products_uc_recurring_users.model AS uc_order_products_uc_recurring_users_model
 FROM uc_recurring_users uc_recurring_users 
 LEFT JOIN uc_order_products uc_order_products_uc_recurring_users ON uc_recurring_users.order_product_id = uc_order_products_uc_recurring_users.order_product_id
 WHERE (uc_order_products_uc_recurring_users.data)  LIKE ('%s:14:\"Link Insertion\";a:1:{i:0;s:6:\"Footer\";%')
jerry’s picture

Check your filter setup. It looks as though you may have selected ordered product filters, not (store) product filters.

halloffame’s picture

Does not make any difference no matter where I choose the attributes from. The thing is this view is based on 'ordered products'. As I pointed out it's working on all other attributes except these two which is a select list type. What's killing me is that it was working alright until I start adding alternate SKU. But I could not revert it back despite removing those alternate SKU. I even deleted all the products with alternate SKU.

jerry’s picture

The thing is this view is based on 'ordered products'.

I'm not fully clear on what you're doing, but I'm definitely not the expert on the ordered products attribute support. I added support for store product attributes, which is a different problem and the subject of this issue. You may find more knowledgeable advice by re-posting in a more relevant/new issue.