News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

featured VirtueMart Products module

Started by tonnick, December 18, 2014, 20:17:44 PM

Previous topic - Next topic

tonnick

Hello

If I'm not wrong, the module VirtueMart Products displaying the feature products show randomly the products. maybe I'm wrong but I did not find in forum how to change that. As far as I see, there is no option to change that.

how can we sort featured products by SKU ir ID for exemple ? thx for your help !

tonnick

hello

any idea about it ? Am I wrong somewhere ?

tonnick

hello

nobody from virtuemart team here ? :'(

CasperH

#3
I made another topic just now, basically asking the same thing, but I think I'm halfway there.

http://forum.virtuemart.net/index.php?topic=127530.0

In your case, you can probably just use this extension: http://extensions.joomla.org/extensions/extension/extension-specific/virtuemart-extensions/extended-products-for-virtuemart by using the filter product ID setting.

Owh.. I realise, in combination with MetaMod I could probably also use that extension, haha. Problem solved?  ;D

Edit*

Or this one: http://codeboxr.com/product/virtuemart-product-display-for-joomla

tonnick

Well, I try to display the featured product, but not in random order ! I don't know why it seems that virtemart team choose to display featured in random order without other option :(

all the module that I found are not related to featured product :( I'm still stuck here, and no reply from virtuemart team about that ! this is quite disappointing...

tonnick

Finally, thx to this post : http://forum.virtuemart.net/index.php?topic=119323.msg405835#msg405835

I made a little hack
in administrator/components/com_virtuemart/models/product.php

around line 406, after :

$latest_products_days = VmConfig::get ('latest_products_days', 7);
$latest_products_orderBy = VmConfig::get ('latest_products_orderBy','created_on');


add :

$product_sku_orderBy = VmConfig::get ('product_sku_orderBy','product_sku');



and around line 411,


case 'featured':
$where[] = 'p.`product_special`="1" ';
$orderBy = 'ORDER BY RAND()';
break;
               

replaced by


case 'featured':
$where[] = 'p.`product_special`="1" ';
$orderBy = 'ORDER BY p.`' . $product_sku_orderBy . '`';
$this->filter_order_Dir = 'DESC';
break;


Note: I'm on a quite old version of virtuemart, not sure that this can be applied on latest 3.x, and in my opinion, this is not a real solution. Virtuemart team should improve the way of displaying product in this module.

jenkinhill

Don't know what you mean by "team". We have a very small number of program developers and a few user volunteers.  Somewhat naturally the devs are now concentrating on the VM3 core.

VirtueMart is a project in which all users can contribute. Extended module function has always been an area where third party developers have contributed, hence the relatively large number of minicart, scroller, products anywhere and similar modules currently available, most for a small charge, some for free.  I do not recall anyone else asking for what you seem to require, which is additional product filtering within a module? If you believe there is a market for this then why not develop it further yourself (or hire an experienced coder) and release it for use by any others that may require such function, or donate it to the project.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

tonnick

if you have a quick look on forum, you'll see a lot of people asking why ordering using featured product is in random mode ! and if you search as well, you'll see that noboby gave a clear answer.

I understand that the people behind virtuemart (this is what I call a team) is looking for V3, but, as least some answer should be provided. why did they choose to order by random the featured products ?! filtering tools is not enough, a lot of people shout it on forum. So I hope this little hack will help people, but usually, hacking source code of a component is not a good practice. and the people behind virtuemart should answer cleary about that. A great job has been done, there is no doubt about it. So just maybe some clarification would be great at some point about the options chosen to make it work ;)

mhshakouri

Well as a supporter of virtuemart, the team you say and a few people they say, they are, great people doing great job.
I think you folks having problems with virtuemart default shipped modules, should do something about your needs. I'm sure there is plenty of free and payed extensions out there, and as one of the team members said, if you can't find it, fork it!
Make an extension for your needs.
In my recent projects, Since VM 2.9 beta, I choose to migrate to the latest version, and the result was that in my country, Iran, I was the first one to release a Payment Plugin for VM3 and I also managed to develop some slider, scroller, carousel, and so many other modules.
So the answer to your question is,
RANDOM FEATURED PRoducts is a must, in my opinion! It's so usefull when you have aroun 40 featured products and you want a random slideshow of 10 on each visit!
So I think instead of asking nonsense question On why You did this, why not that, Just Engage your self to the project!
I mean if you really don wanna contribute to the project and donate your extensions too, just go deep in to their codes. See how clearly coded they have coded the applications and how it's easy for you to get what you need out of the default shipped files. Even if you do not have enough php knowledge you still can do what you want around with virtuemart. That's been my experience since 6 years ago with VM!

creatifpresence

@tonnick - Brilliant, thank you for your hack it worked lovely.

Can this not be changed in core virtuemart? as it makes more sense than random :)