Logo image won't upload or show

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #140813

-- HikaShop version -- : 1.3.2
-- Hikashop version --: 2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.4

Hi I have a logo field for the vendor as i would like to display this at the top of their page however when i browse and upload an image it says it has saved with success however i cannot see any sign of the image on the front end or backend so i am not sure how to tackle it without looking to you guys to advise?

Thanks

Attachments:

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 3 months ago #140818

Hi,

You have some javascript errors in your page.
You should have the dynamic uploader and not see this HTML upload input field.

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: 377
  • Thank you received: 7
10 years 3 months ago #140839

Hi Jerome,

I am not sure how you know the errors? This is the Joomla backend i haven't changed anything? I do not know how to fix javascript error on the Joomla backend? This is a custom field not the image one at the top, I shall attach full screen shot. As you can see the image for the vendor uploaded ok but i want another field for the logo so i can have a picture of the person and then their business logo.

Kind regards

Alex

Attachments:

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 3 months ago #140844

Hi,

Oh, I see.
I though you were talking about the "vendor image" which is above in the vendor page.

Could you please provide the screenshot of the custom field configuration ?
Maybe using the new custom field type, "ajax upload image", could be useful.
But the original "file" custom field should work so having your configuration will help us to try to reproduce your problem.

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: 377
  • Thank you received: 7
10 years 3 months ago #140848

Sure please find attached i have tried the ajax uploader which looks better anyway but just seems to stop once uploaded.

Kind regards

Attachments:

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 3 months ago #140972

Hi,

I reproduced the problem and I was able to made a fix.
I will need more test in order to be sure that it is the right solution.

First, in HikaMarket, in the view "administrator/components/com_hikamarket/views/vendormarket/tmpl/form.php" replace

	$oneExtraField->field_table = 'vendor';
	$oneExtraField->field_required = false;
By:
	//$oneExtraField->field_table = 'vendor';
	$oneExtraField->field_required = false;
In HikaShop, for the class field ( administrator/components/com_hikashop/classes/field.php ) replace for "hikashopFile"
		if(!empty($value)){
			$html.=$this->show($field,$value,'hikashop_custom_file_upload_link');
		}
		$map = $field->field_table.'_'.$field->field_namekey;
		$html.= parent::display($field,$value,$map,$inside,$options,$test,$allFields,$allValues);
By
		if(!empty($value)){
			$html.=$this->show($field,$value,'hikashop_custom_file_upload_link');
		}
		$map = str_replace('.','_',$field->field_table).'_'.$field->field_namekey;
		$html.= parent::display($field,$value,$map,$inside,$options,$test,$allFields,$allValues);
And
	function check(&$field,&$value,$oldvalue){
		$class = hikashop_get('class.file');
		$map = $field->field_table.'_'.$field->field_namekey;
By:
	function check(&$field,&$value,$oldvalue){
		$class = hikashop_get('class.file');
		$map = str_replace('.','_',$field->field_table).'_'.$field->field_namekey;
And it will work for the classical file/image custom fields.
The Ajax custom fields have another problem related to the upload path. I already submit a patch for it, patch which is currently under testing and which will be in the next release (which should be in a "short" time).

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: 377
  • Thank you received: 7
10 years 2 months ago #144789

Sorry for the delayed response we have been on other projects. I have tried your implementation however it just displays the filename not the image. This is when i set the field type to 'image' and/or 'file' and as you mentioned ajax doesn't work either.

www.warestreetmarket.com/newsite/Artist/...w/2-alex-dibben.html

Then when i click on it it takes me to the orders page which is very strange behavior.

I am pretty sure i copied all your code correctly.

Kind regards

Alex

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 2 months ago #144843

Hi,

Regarding the generated link, I can tell you that you didn't put all modifications that I wrote in the post before.

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: 377
  • Thank you received: 7
10 years 2 months ago #144850

I am pretty sure i have done them all, i have attached screen shots of all the changes according to your 3 you mentioned previously. Please let me know if i have missed anything by mistake?

Thanks

Attachments:

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 2 months ago #144864

Hi,

Right !
Since my latest post (around 4 weeks ago) I made other modifications for the custom fields in HikaShop, these modifications are include into HikaShop 2.3.0
Thanks to it, you should be able to upload and see the image once upload. But other users might not be able to see the image without a patch into HikaMarket (I am working on the next build so I can't update the package like that).

The system use the "order | download" task but because it told him that the destination table is "plg.hikamarket.vendor", it uses the plugin system to determine where it have to find the image.
The missing trigger in HikaMarket allow HikaShop to know if there is an existing entry with the targeted image, if the first part is working find for you, I can provide you the code for HikaMarket.

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: 377
  • Thank you received: 7
10 years 2 months ago #144924

Hi Jerome,

Thanks for looking into this, so is my next step to:
1. upgrade hikashop version?
2. you supply temporary patch for hikamarket?
3. Some time in future this is a new release for hikamarket which i can upgrade to which will contain the fix?

Kind regards

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 2 months ago #144961

Hi,

Yes. First let me know if the upload is working better using HikaShop 2.3.0
The Patch for HikaMarket is just two files, I am still making some tests to confirm this modification.

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: 377
  • Thank you received: 7
10 years 1 month ago #148244

Hi Jerome,

This still isn't working, I have updated both hikashop and hikamarket, and I am worried this is taking quite a while to fix, is there anything we can do to get this one sorted?

Thanks

Alex

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #148248

Hi,

First let me know if the upload is working better using HikaShop 2.3.0

And I sorry but without your feedback it is difficult to know the answer to my previous question.
HikaShop 2.3.0 is really closed to the auto-update status so it is now or the next release for the introduction of this patch.

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: 377
  • Thank you received: 7
10 years 1 month ago #148253

Aha i needed to re-patch after the upgrade again, so now i can get it to display the image! :)
Just a couple of things, I have hidden the label using label[for="foo"] { display:none; } in css as i cannot see an option to do this otherwise.

I have also set the image size in css using this:

.hikashop_custom_image_link {
width:180px!important;
}

I dont think this will affect other hikashop images.

Thanks for your prompt reply.

Alex

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #148280

Hi,

The lastest HikaShop 2.3.0 package should contain the patch that I gave several weeks ago.
The HikaMarket patch is not include and like I said, two other modifications are missing in order to have the full complete feature.

In the plugin "plugins/hikashop/market/market.php" add the new function in the class object

	public function onFieldFileDownload(&$found, $name, $field_table, $field_namekey, $options) {
		if(substr($field_table, 0, 15) != 'plg.hikamarket.')
			return;
		if(!$this->init())
			return;
		$fieldClass = hikamarket::get('class.field');
		$fieldClass->fieldFileDownload($found, $name, $field_table, $field_namekey, $options);
	}
And in the class field (administrator/component/com_hikamarket/classes/field.php), replace
			'struct' => array(
				'text' => 'HIKAMARKET_VENDOR',
				'table' => 'vendor',
				'columns' => array('vendor_params')
			),
By:
			'struct' => array(
				'text' => 'HIKAMARKET_VENDOR',
				'table' => 'vendor',
				'id' => 'vendor_id',
				'columns' => array('vendor_params')
			),
And add this new function:
	public function fieldFileDownload(&$found, $name, $field_table, $field_namekey, $options) {
		if(substr($field_table, 0, 15) != 'plg.hikamarket.')
			return;
		$table = substr($field_table, 15);

		$query = '';
		foreach($this->fields as $key => $field) {
			if(empty($field['struct']))
				continue;
			if($key == $table) {
				$query = 'SELECT '.$field['id'].' FROM '.$field['table'].' WHERE '.$field_namekey . ' = '. $this->db->Quote($name);
			}
		}

		if(!empty($query)) {
			$this->db->setQuery($query);
			$result = $this->db->loadResult();
			if($result)
				$found = true;
		}
	}

With these modifications in HikaMarket, the vendor image will be accessible for everyone not only the vendor who upload his image.

About the CSS modification, we do not include options for everything (there is already a lot of options in HikaMarket) so the best is sometime the CSS or the view modification.
To have a custom design for your vendor page or other, the view modification will be the best.
It is totally safe and recommended, specially if you want to add some special content.

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: 377
  • Thank you received: 7
10 years 1 month ago #148386

Thanks Jerome

It is all working now.

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

  • Posts: 377
  • Thank you received: 7
10 years 1 month ago #148532

I have had another bug show up on this. If i upload the image and save it works great. But now i have added a second custom field, what happens is i edit that field and save it however it deletes the image also. This means if the vendor edits information about delivery, after saving it removes their logo so they need to upload it everytime the profile is edited... Please see the fields i mean with attached screen shot...

Attachments:

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

  • Posts: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #148553

Hi,

Right, I can reproduce your problem in HikaMarket.
Could you please use an "ajax image" custom field instead of an "image" custom field ?
I have to make some debug on the "image" custom field but the modification will impact I guess HikaShop, and not really HikaMarket.
I test with the "ajax image" custom field and I didn't have trouble with it (HikaShop 2.3.0 & HikaMarket 1.3.2)

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: 26025
  • Thank you received: 4005
  • MODERATOR
10 years 1 month ago #148555

Hi,

Nevermind, the patch is only in HikaMarket and seems to work fine.
In the file "administrator/components/com_hikamarket/classes/vendor.php" please replace

		$oldVendor = null;
		$fieldsClass = hikamarket::get('shop.class.field');
By:
		$oldVendor = null;
		if(!empty($vendor_id))
			$oldVendor = $this->get($vendor_id);
		$fieldsClass = hikamarket::get('shop.class.field');
It will load the previous upload custom field value and keep it.
I have to continue my tests in order to see if it won't have side effects, but for what I saw, it's good.

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: Dibben

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

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