Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

@@BrockleyJohn, I just added a column to the products table as it is just an attribute...probably a big no no for no core code change. A nice thing about the core code was that adding a column had never broke anything for me. Just a pain during upgrade time...

 

I run a stored procedure nightly to update the sort_analytic column...

Link to comment
Share on other sites

  • 3 months later...
  • Replies 55
  • Created
  • Last Reply

Hello, 

 

I was wondering if it was possible to have multiple drop downs rather than all the options being in just the one. for example:

 

[product name] - with a drop down for [A - Z] and [Z - A]

[Product Price] with a drop down for [low - high] and [high-low]

 

etc.. 

 

similar to this: 

https://www.dropbox.com/s/fsaqqcnvpzoewcz/product-sort.jpg?dl=0 

 

Thanks, 

Link to comment
Share on other sites

  • 5 months later...

For those of you that have this Products Sort feature installed.

There seems to be a problem with the sorting function when selecting a manufacturer from the manufacturers side box. Thanks to John for pointing this out. :thumbsup:

Please apply the following code change to fix this.

 

Open your product_listing.php and look for this code

	  echo (isset($_GET['cPath']) ? tep_draw_hidden_field('cPath', $_GET['cPath']) : '') ;
	  echo (isset($_GET['filter_id']) ? tep_draw_hidden_field('filter_id', $_GET['filter_id']) :'');

replace with this

	  echo (isset($_GET['cPath']) ? tep_draw_hidden_field('cPath', $_GET['cPath']) : '') ;
	  echo (isset($_GET['filter_id']) ? tep_draw_hidden_field('filter_id', $_GET['filter_id']) :'');									
	  echo (isset($_GET['manufacturers_id']) ? tep_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']) :'');

That's it already. Now you should be able to sort the products no matter if you select the manufacturer from the side box or if you browse through the categories.

Link to comment
Share on other sites

  • 1 year later...

I'm using the products specifications filter module, it's not working with this sorting module, when I choose a sorting option, the specification filter reset. anyone know how to make the 2 modules work together ?

Link to comment
Share on other sites

  • 3 weeks later...

@Tsimi Hi Lambros this sort filter works wonderfully well on my site.  Thank you very much!  My question though is not really related to this feature - I am trying to add the text "Sort By" in front of the filter dropdown (we have TEXT_SORT_BY ready in the language definitions), but this text and the dropdown box break into two lines.  How do I align them?

Thanks in advance, Eddy

 

 

Link to comment
Share on other sites

@Moxamint

Please try the following.

Open your includes/modules/product_listing.php file

FIND:

echo tep_draw_pull_down_menu('sort', $products_sorter_array, '', 'onchange="this.form.submit()"');

REPLACE WITH

echo TEXT_SORT_BY . '<span style="display: inline-block">' . tep_draw_pull_down_menu('sort', $products_sorter_array, '', 'onchange="this.form.submit()"') . '</span>';

Does this work for you?

Link to comment
Share on other sites

@Tsimi 

I had to change the following line of code as well:

<div id="sort" class="col-xs-8 col-sm-4 col-md-3 pull-right">

and replace it with 

<div id="sort" class="pull-right">

Now they align properly:

59bb3e41af57c_Image2.png.993e84b70c64739462a0c955105d2c17.png

Would my changes ruin anything?

Thanks, Eddy

Link to comment
Share on other sites

@Tsimi Here is the code:

      <div id="sort" class="col-xs-8 col-sm-4 col-md-3 pull-right">
      <?php
        echo tep_draw_form('sort', $PHP_SELF, 'get');
        echo (isset($_GET['cPath']) ? tep_draw_hidden_field('cPath', $_GET['cPath']) : '') ;
        echo (isset($_GET['filter_id']) ? tep_draw_hidden_field('filter_id', $_GET['filter_id']) : '');
        echo (isset($_GET['manufacturers_id']) ? tep_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']) : '');
        echo '<strong>' . TEXT_SORT_BY . '</strong>' . '<span style="display: inline-block">' . tep_draw_pull_down_menu('sort', $products_sorter_array, '', 'onchange="this.form.submit()"') . '</span>';
        echo tep_hide_session_id() . '</form>';
      ?>
      </div>

Thanks, Eddy

Link to comment
Share on other sites

I don't know your whole file but usually 

There is a layout like this for example

<div class="row">

<div class="col-sm-6">

</div>

<div class="col-sm-4">

</div>

</div>

You have to make sure both col-xx-xx add up to total of 12.

If you need more space on the right for the dropdown change the col-sm- numbers. 

For example col-sm-4 for left and col-sm-6 for right side.

Link to comment
Share on other sites

I think you simply don't have enough space to fit the dropdown with Sort by text in there at certain views.

The display:inline-block code has to stay since that makes it possible for the text to sit next to the dropdown.

I would love to show you more examples but writting code with a phone is a PITA. (pain in the... ) 

Worst case, backup your shop and bring the data home if you can then we can look at it closer once I get back from work tonight.

Link to comment
Share on other sites

  • 2 weeks later...

@Tsimi Hi Lambros - now is it possible to make this sort filter work on the search result page <<advanced_search_result.php>>?  This file is quite different from specials and products_new.  Made a few attempts with no joy...

Thanks, Eddy

Link to comment
Share on other sites

  • 4 weeks later...

Hello I'm using the v2.3.4, but I'm difficults in the code:

     <!-- BOF ADDITIONAL FILTER //-->      
      <div id="sort" style="padding-top: 5px;">
    <?php
    include(DIR_WS_MODULES . 'product_listing_sort.php');
    echo tep_draw_form('sort', $PHP_SELF, 'get'); 

    echo (isset($_GET['cPath']) ? tep_draw_hidden_field('cPath', $_GET['cPath']) : '') ;
    echo (isset($_GET['filter_id']) ? tep_draw_hidden_field('filter_id', $_GET['filter_id']) :'');                  
    
    echo tep_draw_pull_down_menu('sort', $products_sorter_array, '', 'style="width: 100%;" onchange="this.form.submit()"');
    echo tep_hide_session_id() . '</form>';
    ?>
      </div>
   <!-- EOF ADDITIONAL FILTER //-->

Because I've the a dropdown for max products per page and it uses ?mppp=50&sort=1a, if using the filter for example to products name Z-A it sets ?sort=2.

I don't have this by default I'm trying to insert it but this filter to sort by name, price, best sellers, etc isn't working, any solution?

 

Link to comment
Share on other sites

1 hour ago, sinopia said:

Hello I'm using the v2.3.4, but I'm difficults in the code:


     <!-- BOF ADDITIONAL FILTER //-->      
      <div id="sort" style="padding-top: 5px;">
    <?php
    include(DIR_WS_MODULES . 'product_listing_sort.php');
    echo tep_draw_form('sort', $PHP_SELF, 'get'); 

    echo (isset($_GET['cPath']) ? tep_draw_hidden_field('cPath', $_GET['cPath']) : '') ;
    echo (isset($_GET['filter_id']) ? tep_draw_hidden_field('filter_id', $_GET['filter_id']) :'');                  
    
    echo tep_draw_pull_down_menu('sort', $products_sorter_array, '', 'style="width: 100%;" onchange="this.form.submit()"');
    echo tep_hide_session_id() . '</form>';
    ?>
      </div>
   <!-- EOF ADDITIONAL FILTER //-->

Because I've the a dropdown for max products per page and it uses ?mppp=50&sort=1a, if using the filter for example to products name Z-A it sets ?sort=2.

I don't have this by default I'm trying to insert it but this filter to sort by name, price, best sellers, etc isn't working, any solution?

 

Try this: add after the line about filter_id

    echo (isset($_GET['mppp']) ? tep_draw_hidden_field('mppp', $_GET['mppp']) : '') ;

 

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

Hello @BrockleyJohn thank you for your reply.

I'm insert it but doesn't seems to works, The dropdown for quantity works fine but the sorter filter to order it by A-Z, Z-A, Lower Price, Higher Price, etc...

I've follow everything but isn't working, the options are fine but after selecting one it changes to ?sort=1 but nothing happens.

Sem Título.png

Link to comment
Share on other sites

@sinopia in your admin panel, configuration / product listing, what settings do you have?

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...