Closed (works as designed)
Project:
UC Multiprice
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Jul 2009 at 03:54 UTC
Updated:
7 Oct 2014 at 14:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Docc commentedTry this patch. It uses hook_views_data_alter to alter the price data.
Based on latest uc_views.
Remember to clear your cache after you applied the patch.
Comment #2
davemybes commentedFantastic! Works like a charm, thanks.
Comment #3
Docc commentedCommited to HEAD
Comment #5
bartezz commentedHey Docc,
Question on this; I see that the inc file is still there. But the implementation of hook_views_data_alter is gone from the .module file. Now I also do see that things are still working when using row style fields in a view. So somehow views now calls hook_nodeapi:load, right?!
Now here's a popquiz question ;)
The following code (starting at #318) of course sets some variables which are used in hook_nodeapi:view (second code example)
Ofcourse this doesn't work in views, or should it? Can you point me in a direction on how to achieve this for a row style fields kinda view. (It probably should work with a row style node view but I can't use this row style).
Cheers
Comment #6
bartezz commentedPossible solution might be this module;
http://drupal.org/project/viewsnodefield
Cheers
Comment #7
bartezz commentedHi Docc,
I added a line of code to set the sell price of a product to NULL when a product is disabled. This is a patch for 2.x-dev. With this sell_price set to NULL it helps creating and theming row style - fields displays as this is done in hook_nodeapi:load which Views uses.
Cheers
EDIT: please see http://drupal.org/node/1348096
Comment #8
bartezz commentedI'm having problems with views when usinig row style fields in stead of node and with caching.
For now the solution would be to use row style node or with row style fields and using the viewsnodefield module. The latter will allow you to use views add on modules like views_hacks (Views Selective Exposed Filters) etc.
Caching is another problem I think. For now I'm not caching my views.
Docc can you tell me why the hook_views_data_alter is gone from the module?
I will do some testing over the next weeks on a clean install to see if I these issues are reproducable and if I can come up with patches.
Cheers
Comment #9
Docc commentedBecause its using the price_alter function. Wich should work with views.
I used hook_views_data_alter before that.
I didnt try, but it should work with views if you select the altered state.
Comment #10
hixster commentedI am experiencing some issue with a view which is sorting products based on price (ascending). Everything works fine in the default currency (£), but when in my non default country, (US), sorting on price doesn't seem to work, my products are jumbled in order: ie:
$59.99
$29.99
$19.99
$54.99
Could it be related to this issue?
Comment #11
hixster commentedupdate - just tried printing the (numeric) price as a field in the view and it's just printing the unmodified default currency price.
My view was looking o.k because I was grabbing the themed price.
So how could i sort based on price? This is essential for me to fix. Could a CCK computed field be used a a hack?
Comment #12
Docc commentedBasicly the problems occurs when using the sort filter on a price field.
The price handler does not affect this data as the sort is based on the mysql query, ex: "ORDER BY uc_products_sell_price ASC"
So this is more a ubercart issue then multiprice?
I suggest using your own views alters to get the sorting right after the query. (just like the table style does)
Other options are replacing the (sort)handlers for the current uc_product views fields.
Or writing a custom views_data schema for multiprice.
Comment #13
Docc commentedBack to the original issue. Since the introduction of the price_handler this has been fixed.
If you want sort support either use the table row style or another style that allows sorting on a render level.
Comment #14
bartezz commentedAlso see: http://drupal.org/node/1348096