VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: psm on October 09, 2019, 18:17:23 PM

Title: Change "Orderby menu" to list of items
Post by: psm on October 09, 2019, 18:17:23 PM
Hello,
please how is it possible to change "Orderby" menu to list of items via "Select" command in html? Example is in attachment.

I think it is more user friendly solution.

Thank you very much
Title: Re: Change "Orderby menu" to list of items
Post by: psm on October 14, 2019, 22:50:32 PM
 :-[
Title: Re: Change "Orderby menu" to list of items
Post by: psm on October 16, 2019, 19:43:01 PM
Really nobody?
Title: Re: Change "Orderby menu" to list of items
Post by: AH on October 16, 2019, 21:10:35 PM
Do not bump!

This is a free forum where people answer and it they have the time.

If your request is important to your business use your tech support or ask via your VM membership to ask for help
Title: Re: Change "Orderby menu" to list of items
Post by: psm on October 16, 2019, 21:43:54 PM
How can I ask VM membership?

Thanks
Title: Re: Change "Orderby menu" to list of items
Post by: GJC Web Design on October 16, 2019, 22:49:28 PM
At the top of this page!

'Support the VirtueMart project and become a member'

http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail
Title: Re: Change "Orderby menu" to list of items
Post by: psm on November 03, 2019, 19:54:56 PM
From my point of view I would like to suggest that this thing is important to solve in core of VM, because I do not see this solution in another CMS systems and it is not practical solution.

Control of page should be simple as it can be.

Thanks
Title: Re: Change "Orderby menu" to list of items
Post by: AH on November 04, 2019, 16:25:40 PM
Looks like others are not of the same opinion based on the number of posts in this thread
Title: Re: Change "Orderby menu" to list of items
Post by: Ventsi Genchev on November 05, 2019, 06:50:00 AM
Or they do not complain because they have found a solution. Like me, for example.  ;)

I also don't like the original sorting method.
Title: Re: Change "Orderby menu" to list of items
Post by: AH on November 05, 2019, 18:15:42 PM
Nice to know you have made something work the way you desire it

Maybe you could share your solution with the dev team, it may be useful.
Title: Re: Change "Orderby menu" to list of items
Post by: Ventsi Genchev on November 06, 2019, 08:46:19 AM
Unfortunately, the solution is not universal. It is tailored to my site according to the sorting methods I use. If other sorting is used, other changes must be made.
The only changes are in the file: \templates\your_theme\html\com_virtuemart\category\default.php

Title: Re: Change "Orderby menu" to list of items
Post by: AH on November 07, 2019, 16:05:46 PM
So the current answer to the original poster seems to be - do it yourself to meet your own needs
Title: Re: Change "Orderby menu" to list of items
Post by: psm on November 10, 2019, 11:16:45 AM
Ventsi Genchev:
I asked programator and he told me there must be made changes also in database. And it is work for 5 hours ate least. So can you please share your solution with us please?
I am very interesting about it.


Thank you
Title: Re: Change "Orderby menu" to list of items
Post by: Studio 42 on November 11, 2019, 13:17:29 PM
@psm
Can you please send the list in english ?
If the sort order is in the config, then you dont need database changes(it only need to wirte code for the list itself).

And it do not need DB changes only perhaps in the product model to add the new valid order by options.
Title: Re: Change "Orderby menu" to list of items
Post by: psm on November 11, 2019, 22:17:52 PM
I am sending you picture how I would like to have it. If it is not possible to add order by "reviews" then use just order by "product name".

Thank you very much
Title: Re: Change "Orderby menu" to list of items
Post by: GJC Web Design on November 11, 2019, 22:48:49 PM
the info is there but in an awful format..

<div class="orderlist collapse">
<div><a title="Product Name" href="/shop/by,product_name?keyword=" class="btn btn-xs btn-default btn-block">Product Name</a></div>
<div><a title="Product SKU" href="/shop/by,product_sku?keyword=" class="btn btn-xs btn-default btn-block">Product SKU</a></div>
<div><a title="Category" href="/shop/by,category_name?keyword=" class="btn btn-xs btn-default btn-block">Category</a></div>
<div><a title="Manufacturer name" href="/shop/by,mf_name?keyword=" class="btn btn-xs btn-default btn-block">Manufacturer name</a></div>
<div><a title="Ordering" href="/shop/by,ordering?keyword=" class="btn btn-xs btn-default btn-block">Ordering</a></div>
</div>


you need to parse the html to get the titles and links, then construct a select from it.. with some JS to document.location.replace(this.value); on change
this can be done with a function called from the cat template

but maybe it would be better to ask the devs to return this in a nicer format
Title: Re: Change "Orderby menu" to list of items
Post by: Studio 42 on November 11, 2019, 22:50:01 PM
Yes, you can change this, but it need a Product model class override to include sort by reviews
And of course a template overide to modify the order by list options.
You can contact me in my shop https://shop.st42.fr/fr/vendor/joomla-download-shop/contact (https://shop.st42.fr/fr/vendor/joomla-download-shop/contact) if you want hire me.
Title: Re: Change "Orderby menu" to list of items
Post by: psm on November 30, 2019, 19:56:18 PM
Hello, it is not importnat to sort it according to reviews. Just change current design to suggest one.

But I do not know JS well, can you please advice me more deeply?

Thank you very much
Title: Re: Change "Orderby menu" to list of items
Post by: GJC Web Design on December 01, 2019, 11:13:18 AM
I really doubt you are going to get someone to code this for you for free... either u know how to do this or you don't
Title: Re: Change "Orderby menu" to list of items
Post by: psm on February 05, 2020, 16:11:08 PM
I found out that it is ok for me to have it in this form:

<div class="orderlist collapse">
<?php  
$uri = & JFactory::getURI();
$absolute_url = $uri->toString();
?>

<div><a title="Product Name" href="<?php echo $absolute_url?>/by,product_name?keyword=" class="orderbynew_name">Zoradiť podľa názvu</a></div>
<div><a title="Product Price" href="<?php echo $absolute_url?>/by,product_price.html?keyword=" class="orderbynew_price">Zoradiť podľa ceny</a>
</div>
<div><a title="Product Price" href="<?php echo $absolute_url?>/by,product_price/dirDesc?keyword=" class="orderbynew_price">Zoradiť od najdrahšieho</a></div>
</div>


Problem is that when I use one of this options, my absolute adres contains also condiotion /by.product.... Can you please help me how to fix it?

Thank you
Title: Re: Change "Orderby menu" to list of items
Post by: GJC Web Design on February 05, 2020, 17:41:09 PM
str_replace ?

https://www.w3schools.com/php/func_string_str_replace.asp
Title: Re: Change "Orderby menu" to list of items
Post by: psm on February 06, 2020, 14:13:16 PM
Can you explain me me how do you think it please?
Title: Re: Change "Orderby menu" to list of items
Post by: GJC Web Design on February 06, 2020, 14:59:30 PM
remove  /by.product.... from $absolute_url?
Title: Re: Change "Orderby menu" to list of items
Post by: psm on February 07, 2020, 11:15:26 AM
Thank you very much, it is done already.
Title: Re: Change "Orderby menu" to list of items
Post by: psm on April 11, 2020, 17:43:29 PM
Hello,
I find one more problem and it is that when I choose that I want to show more products per page, for example 60, I cannot use order by form correctly.

It is caused due to change in URL:
Correct: https://smartobchod.sk/mobilne-telefony-a-tablety/mobilne-telefony.html/by,product_price.html?keyword=
If I change q-ty --> Incorrect: https://smartobchod.sk/mobilne-telefony-a-tablety/mobilne-telefony.html?limit=60/by,product_price.html?keyword=

There is "limit=60" but this I cannot remove.

Can you please advice me how to fix it?

My code is:
$uri = & JFactory::getURI();
    $absolute_url = $uri->toString();
$appended_path = array("/by,product_price/dirDesc.html?keyword=", "/by,product_price.html?keyword=", "/by,product_name.html?keyword=");
$absolute_url_final = str_replace($appended_path,"",$absolute_url); ?>

    <div><a title="Product Name" href="<?php echo $absolute_url_final?>/by,product_name.html?keyword=" class="orderbynew_name">Podľa názvu</a></div>
<div><a title="Product Price" href="<?php echo $absolute_url_final?>/by,product_price.html?keyword=" class="orderbynew_price">Najlacnejšie</a></div>
    <div><a title="Product Price" href="<?php echo $absolute_url_final?>/by,product_price/dirDesc.html?keyword=" class="orderbynew_price">Najdrahšie</a></div>
Title: Re: Change "Orderby menu" to list of items
Post by: pinochico on April 11, 2020, 19:04:33 PM
As sad Patrick - this is custom developping, you can sent email him, I think is not solution for free forum  :)

Every new eshop for client we customized, in this eshop we added sort by stock:
https://www.kolo-park.cz/obchod/kola-a-elektrokola/radit_podle,stav_zasob?keyword=