Vendor product listing problems

  • Posts: 2128
  • Thank you received: 732
  • Hikashop Business
7 years 6 days ago #206719

-- url of the page with the problem -- : local & live
-- HikaShop version -- : 2.5.0
-- HikaMarket version -- : 1.6.3
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5.3
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : JS error (see below)

Hi Jerome,

I've noticed it earlier, and am now reproducing it in my "clean" environment set up as described earlier.

Scenario:
Vendor has added products, looks them up in the vendor product listing.
In case it matters: Vendor has set the products to "published", but Admin has not approved them yet. Just FYI, his is what it looks like:




1.) Can not sort the list by clicking <th> items like ID or Name.
a.) Nothing happens, the order remains the same.
b.) Each click on such <th> throws a JS error:

You may know, but it's in /media/system/js/core.js

2.) Default list order:
By default, the list shows "Oldest item first", and I don't see an option to change this.
I strongly believe that "Newest item first" is the only default that makes sense (imagine vendors with long lists of products, eventually even spreading over multiple pages....!), and would appreciate if you changed the default list order accordingly, or - in case of protest from elsewhere - added an option to set the default order.

Thanks again!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 25343
  • Thank you received: 3922
  • MODERATOR
7 years 6 days ago #206725

Hi,

1) Great, they changed the core javascript again !

2) An option seems fair.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2128
  • Thank you received: 732
  • Hikashop Business
7 years 6 days ago #206745

1.) Why is it always ME being the first running into trouble and needing to write a (small) book to get things fixed? ;)

2.) An option is not the most urgent thing if the default were "Newest item first" to start with. Or at least the sorting thingy worked, hehe.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 25343
  • Thank you received: 3922
  • MODERATOR
7 years 6 days ago #206761

Hi,

1/ I don't know..
The fast solution will be to replace the form in the begin of the productmarket | listing view

<form action="<?php echo hikamarket::completeLink('product&task=listing'); ?>" method="post" name="adminForm" id="adminForm">
What I can tell you is the javascript modification is pretty recent in Joomla 3.

2/ For the moment the "getPageInfo" function is called with default arguments in the product listing function.
So you can change it by modifying a core file (view.html.php)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2128
  • Thank you received: 732
  • Hikashop Business
7 years 6 days ago #206802

1.) Changed name and id, and yes, sorting works now. Thanks.
Guess you'll have that in the next version? I'll find out.

2.) No qualms at all about changing a core file - it won't be the first, and I guess it ain't gonna be the last. When taking proper notes it's not a problem.
But again, in the name of all vendors with more than just a handful of products I'm urging you to make "Newest first" the default from next version on. If that'll be the case - wonderful. I can wait that long. If you don't plan to, or if it takes longer, I'll require the hack for the core file, and I'll be very thankful for the code as I don't see it being a simple ASC -> DESC change.

If you want to make it a configurable option, fine, but same applies: good if in next version, otherwise please provide hack code for view.html.php for the meantime.

If the hack is it for one reason or another, and you don't want to post it here publicly (core file - I understand), there's a link to "Private Messages" here in the upper right corner... ;)

Either way, thanks!

T


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 25343
  • Thank you received: 3922
  • MODERATOR
7 years 6 days ago #206808

Hi,

1/ That's right.

2/ You can edit the file "components/com_hikamarket/views/productmarket/view.html.php" and replace

		$pageInfo = $this->getPageInfo($cfg['order_sql_value']);
By
		$default_sort_value = trim($config->get('product_listing_default_sort_value', $cfg['order_sql_value']));
		if(empty($default_sort_value))
			$default_sort_value = $cfg['order_sql_value'];
		$default_sort_dir = trim($config->get('product_listing_default_sort_dir', 'asc'));
		if(empty($default_sort_dir) || !in_array($default_sort_dir, array('asc', 'desc')))
			$default_sort_dir = 'asc';

		$pageInfo = $this->getPageInfo($default_sort_value, $default_sort_dir);
Thanks to that, you will be able to add new entries in the table "hikamarket_config" in order to change the default value and the default direction for the sorting in the HikaMarket front-end product listing.
The code will be in the next release but the option will stay hidden for the moment.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lousyfool

Please Log in or Create an account to join the conversation.

  • Posts: 2128
  • Thank you received: 732
  • Hikashop Business
7 years 6 days ago #206826

Hi Jerome,

I am very thankful, indeed! Have to yet try it (have to overcome the other, bigger problem first), but trust it'll work just fine then.

Cheers!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 2128
  • Thank you received: 732
  • Hikashop Business
7 years 5 days ago #206853

Just tried:

As expected, code snippet in file, DB rows added, default sort value set to 0 and sort dir to desc = works! Brilliant!

FYI, the value must be 0 or empty, only then dir does what it's supposed to do, asc or desc across the whole table. If the value is anything else, e.g. 1, then it's strange: no "sorting", but the newest is pulled at the top of the list, the rest below is asc, no matter what dir is set to:
10 (= newest)
1 (= oldest)
2
3
4
...

Anyway, the basic functionality is there. Thanks again.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 7 years 5 days ago by lousyfool.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.081 seconds
Powered by Kunena Forum