Order listing filter - unable to show all vendors.

  • Posts: 56
  • Thank you received: 2
10 years 1 week ago #152249

-- url of the page with the problem -- : dshop.se
-- HikaShop version -- : 2.2.3
-- HikaMarket version -- : 1.3.2
-- Joomla version -- : 3.1.0
-- PHP version -- : 5.4.6
-- Browser(s) name and version -- : Safari 6.0.5


I can not reset the order listing filter to list all orders from all vendors. When I click the (x) near the vendor name nothing happens. The url suggests the filter is reset to show all vendors but unfortunately no orders get listed.

Attachments:

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

  • Posts: 56
  • Thank you received: 2
10 years 1 week ago #152250

...and yes, there should be plenty of confirmed sales that should be listed. :-)

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 1 week ago #152268

Hi,

In the file "administrator/components/com_hikamarket/types/vendor_selection.php" please replace

window.localPage.fieldSetVendor = function(el, name) {
	window.hikamarket.submitFct = function(data) {
		var d = document,
			vendorInput = d.getElementById(name + "_input_id"),
			vendorSpan = d.getElementById(name + "_span_id");
		if(vendorInput) { vendorInput.value = data.id; }
		if(vendorSpan) { vendorSpan.innerHTML = '.$vendor_format.'; }
	};
	window.hikamarket.openBox(el,null,(el.getAttribute("rel") == null));
	return false;
}
window.localPage.fieldRemVendor = function(el, name) {
	var d = document,
		vendorInput = d.getElementById(name + "_input_id"),
		vendorSpan = d.getElementById(name + "_span_id");
	if(vendorInput) { vendorInput.value = ""; }
	if(vendorSpan) { vendorSpan.innerHTML = " - "; }
}
';
By
window.localPage.fieldSetVendor = function(el, name) {
	window.hikamarket.submitFct = function(data) {
		var d = document,
			vendorInput = d.getElementById(name + "_input_id"),
			vendorSpan = d.getElementById(name + "_span_id");
		if(vendorInput) { vendorInput.value = data.id; }
		if(vendorSpan) { vendorSpan.innerHTML = '.$vendor_format.'; }
	};
	window.hikamarket.openBox(el,null,(el.getAttribute("rel") == null));
	return false;
};
window.localPage.fieldRemVendor = function(el, name) {
	var d = document,
		vendorInput = d.getElementById(name + "_input_id"),
		vendorSpan = d.getElementById(name + "_span_id");
	if(vendorInput) { vendorInput.value = ""; }
	if(vendorSpan) { vendorSpan.innerHTML = " - "; }
	return false;
};
';
It will fix the javascript problem when clicking on the "delete" button for the filter.

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: 56
  • Thank you received: 2
10 years 3 days ago #153077

Hi Jerome,

Sorry for the long response time. I did this modification but the problem stays the same, no change.

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 3 days ago #153099

Hi,

So, if you think that the patch does not work, would it be possible to have some information or details in order to understand what can be the source of your trouble ? Like some javascript errors in the javascript console for example.
In my side, the patch works and solved the problem in the website where I tested it and I can't fix a problem I can't see.

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: 56
  • Thank you received: 2
10 years 2 days ago #153185

Hi Jerome!
Here is the output of the javascript console. The bottom two rows are the result of me clicking the (x) trying to clear the vendor filter. If there is anything else you require from me just let me know.

Use of getAttributeNode() is deprecated. Use getAttribute() instead. mootools-core.js:38
TypeError: d.adminForm is undefined index.php:82
Use of attributes' specified attribute is deprecated. It always returns true. jquery.min.js:2
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. jquery.min.js:2
TypeError: window.localPage.filterSetVendor is not a function index.php:1
Empty string passed to getElementById().

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 2 days ago #153206

Hi,

Thanks.
So the javascript error in line 82 stop the script so the declaration of the function filterSetVendor is not made.
I will investigate around it but if you can give me more details about the line 82 (and the content just above and below) it will help me to find the source faster.
The problem could be in HikaMarket but it could be in the HikaShop scripts too.

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: 56
  • Thank you received: 2
10 years 2 days ago #153211

Hi

I attach the whole contents of the index.php file where error is on line 82.

File Attachment:

File Name: h7d30dd8.txt
File Size:54 KB

Attachments:

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 2 days ago #153228

Hi,

Thanks :)

I don't know why I can't reproduce your problem in my test website, I should have something different in the page.
But the error with the code help me to point the problem.
Please edit once again the file "administrator/components/com_hikamarket/types/vendor_selection.php"

And edit the "$js = ....." in the function initJs.

	protected function initJs() {
		static $jsInit = null;
		if($jsInit === true)
			return;

		$vendor_format = 'data.vendor_name';
		if($this->app->isAdmin())
			$vendor_format = 'data.id + " - " + data.vendor_name';

		$js = '
if(!window.localPage)
	window.localPage = {};
/* rest of the script that you will have to replace */
';
		$doc = JFactory::getDocument();
		$doc->addScriptDeclaration($js);

		$jsInit = true;
	}

You will have to use this code instead :
		$js = '
if(!window.localPage)
	window.localPage = {};
window.localPage.filterChooseVendor = function(el, name) {
	window.hikamarket.submitFct = function(data) {
		var d = document,
			vendorInput = d.getElementById(name + "_input_id"),
			vendorSpan = d.getElementById(name + "_span_id");
		if(vendorInput) { vendorInput.value = data.id; }
		if(vendorSpan) { vendorSpan.innerHTML = '.$vendor_format.'; }
		if(d.adminForm)
			d.adminForm.submit();
		else {
			var f = d.getElementById("adminForm");
			if(!f) f = d.getElementById("hikamarketForm");
			if(!f) f = el.form;
			if(f) f.submit();
		}
	};
	window.hikamarket.openBox(el,null,(el.getAttribute("rel") == null));
	return false;
};
window.localPage.filterSetVendor = function(el, name, value) {
	var d = document,
		vendorInput = d.getElementById(name + "_input_id"),
		vendorSpan = d.getElementById(name + "_span_id");
	if(vendorInput) { vendorInput.value = value; }
	if(vendorSpan) {
		if(value == 0)
			vendorSpan.innerHTML = "'.JText::_('NO_VENDOR', true).'";
		else
			vendorSpan.innerHTML = "'.JText::_('ALL_VENDORS', true).'";
	}
	if(d.adminForm)
		d.adminForm.submit();
	else {
		var f = d.getElementById("adminForm");
		if(!f) f = d.getElementById("hikamarketForm");
		if(!f) f = el.form;
		if(f) f.submit();
	}
};
';
I added some extra checks to prevent several different kind of trouble.

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: 56
  • Thank you received: 2
10 years 2 days ago #153238

Ok, I did the changes you asked me but unfortunately the issue is pretty much the same still. Here is the output on javascript console:

Use of getAttributeNode() is deprecated. Use getAttribute() instead. mootools-core.js:38
TypeError: d.adminForm is undefined index.php:176
Use of attributes' specified attribute is deprecated. It always returns true. jquery.min.js:2
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. jquery.min.js:2
TypeError: window.localPage.filterSetVendor is not a function index.php:1
Empty string passed to getElementById().

Attaching the php file as well.

File Attachment:

File Name: hf4264c7.txt
File Size:52 KB

Attachments:

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 2 days ago #153247

Hi,

No you did not the changes.
I don't know what you have modified because if you followed my exact instructions, you edit the wrong file and the content I asked you to replace is just not there.

The real file for the modification I gave you in my previous post is : "administrator/components/com_hikamarket/types/filter_vendor.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: 56
  • Thank you received: 2
10 years 2 days ago #153268

Seriously? These are your exact instructions:

"Please edit once again the file "administrator/components/com_hikamarket/types/vendor_selection.php"


I followed your instructions to the letter. Now I need to revert 'vendor_selection.php' to it's initial state from my backup. It will therefore be in the initial state it was at the start of this thread. Then I will make the changes to filter_vendor.php.

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 2 days ago #153269

Hi,

Yes and I am see after that the filename is not the good one.
There is not "iniJs" function in the file "vendor_selection" but this function is in the file "filter_vendor".

That's why I am wondering how you modified the file "vendor_selection" because there is no the content to replaced.
Because the content is in the file "filter_vendor".

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: 56
  • Thank you received: 2
10 years 2 days ago #153271

This is copied from my unmodified copy of vendor selection.php, so yes there is a initJs() in there as well.

protected function initJs() {
		static $jsInit = null;
		if($jsInit === true)
			return;

		$vendor_format = 'data.vendor_name';
		if($this->app->isAdmin())
			$vendor_format = 'data.id + " - " + data.vendor_name';

		$js = '
if(!window.localPage)
	window.localPage = {};
window.localPage.fieldSetVendor = function(el, name) {
	window.hikamarket.submitFct = function(data) {
		var d = document,
			vendorInput = d.getElementById(name + "_input_id"),
			vendorSpan = d.getElementById(name + "_span_id");
		if(vendorInput) { vendorInput.value = data.id; }
		if(vendorSpan) { vendorSpan.innerHTML = '.$vendor_format.'; }
	};
	window.hikamarket.openBox(el,null,(el.getAttribute("rel") == null));
	return false;
}
window.localPage.fieldRemVendor = function(el, name) {
	var d = document,
		vendorInput = d.getElementById(name + "_input_id"),
		vendorSpan = d.getElementById(name + "_span_id");
	if(vendorInput) { vendorInput.value = ""; }
	if(vendorSpan) { vendorSpan.innerHTML = " - "; }
}
';

Anyway, I did the modification to filter_vendor.php and it appears to be working now, I'll let you know if any issue comes up. Thanks!

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 2 days ago #153274

Hi,

Sorry, I really need some sleep.
Glad to know that the fix is working well.

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: 56
  • Thank you received: 2
10 years 2 days ago #153275

Hey, no worries mate. I always get good help from you guys.

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

  • Posts: 4
  • Thank you received: 0
10 years 1 day ago #153339

What is the correct fix for this issue? Do you have a patch?

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
10 years 1 day ago #153340

Hi,

Please wait for the release of HikaMarket 1.4.0, it will contain this fix.

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: 4
  • Thank you received: 0
9 years 11 months ago #153685

When is the release?

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
9 years 11 months ago #153690

Hi,

Before the end of this month.
We already put the changelog, I am finishing the tests and the script of the install.
I also put some extra things, some hidden features which will be soon there with the next HikaShop release.

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.

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