Vendor upload: file is uploaded then removed

  • Posts: 126
  • Thank you received: 2
9 years 3 months ago #210960

-- HikaShop version -- : 2.5.0
-- HikaMarket version -- : 1.6.5
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.5.2
-- Browser(s) name and version -- : Chrome 43

Hello,

I found a strange situation. I'm logged in as vendor and i try to upload the files for downloads for each variants .

I can upload the file for a variant (is visible on the server) - but when i press the "Save" button, the file is deleted from server and from hikamarket. That happen with every type of file for any variant available. But this happen only for the variants, there is no problem uploading and displaying the file for the main product . Also, i don't see any error message, not even in the PHP log.

What could be the problem?

Thank you

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #210966

Hi,

Thanks for the report. It is something we already fixed but the patch is not release yet.
In the file "components/com_hikamarket/views/productmarket/view.html.php", replace

	if(!empty($file_id)){
		$fileClass = hikamarket::get('shop.class.file');
		$element = $fileClass->get($file_id);
	}
	$element->product_id = $product_id;
By
	if(!empty($file_id)){
		$fileClass = hikamarket::get('shop.class.file');
		$element = $fileClass->get($file_id);
	}
	$element->product_id = $product_id;

	if(!empty($element->product_id)) {
		$productClass = hikamarket::get('shop.class.product');
		$product = $productClass->get((int)$element->product_id);
		$element->product_type = $product->product_type;
	}

Then, in the view "productmarket / form_file", you can replace
750, 460, 'onclick="return window.productMgr.addFile(this);"', '', 'link'
By
750, 460, 'onclick="return window.productMgr.addFile(this, '.(int)$this->product->product_id.',\''.$product_type.'\');"', '', 'link'
And also
window.productMgr.addFile = function(el, pid, type) {
	var t = window.hikamarket;
	if(type === undefined || type == '') type = 'product';
By
window.productMgr.addFile = function(el, pid, type) {
	var t = window.hikamarket;
	if(type === undefined || type == '') type = 'product';
	if(type == 'variant') type = 'product_variant';

It will fix the loading of the product type and provide a more valid data for the variant saving.

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.
Last edit: 9 years 3 months ago by Jerome. Reason: fix file name

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

  • Posts: 126
  • Thank you received: 2
9 years 3 months ago #210969

Thank you, Jerome, but the modifications are already applied in Hikamarket 1.6.5 (your link send to the hikashop but i couldn't find those files there) and the problem still exist.

Now i have found another interesting thing: i can Save a file just for a single variant (i have 3 variants applied to the product). I don't understand why it's working only for one variant (isn't the default one or the first one in list..)

Last edit: 9 years 3 months ago by mett.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #210970

Hi,

My bad, the file is in com_hikamarket and not com_hikashop ; I edited my previous message.

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: 126
  • Thank you received: 2
9 years 3 months ago #210996

ok..but the problem still exist, how can i solve it? :)

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211021

Hi,

I can't reproduce your issue in my side ; so I'll need some accesses to your website in order to see the issue directly.
You can use the contact form for such private information.

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: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #211996

Hi,

We received your accesses and I was able to take a look at your front-end.
You still have the main issue because the patch I gave you are not applied due to an existing view override.
You modified directly the file for the "productmarket / file" view and forgot the override.

So I removed your view override from HikaMarket 1.6.2 and I recreate a new one ; I also re-apply your patch to remove the "toolbar" in the file uploader.

Then, I added an extra patch for the "form_file" view in order to force the "variant" even if there is no params passed.
I replaced

$product_type = (!empty($this->params->product_type) && $this->params->product_type == 'variant') ? 'variant' : 'product';
By
$product_type = ((!empty($this->params->product_type) && $this->params->product_type == 'variant') || !empty($this->editing_variant)) ? 'variant' : 'product';

And now, the upload is working (thanks to the previous patch) and when you re-edit an existing variant, the form data is also correct.

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: 126
  • Thank you received: 2
9 years 3 months ago #212069

Many thanks, Jerome, work fine now :)

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

  • Posts: 7
  • Thank you received: 0
9 years 2 months ago #215031

I am also having a similar issue with the "Vendor Image" under the "Edit your vendor details" on the front-end editor. Whenever i upload from local hard drive or select an image on file (server side) The vendor image will not save.
After the upload i click on "save" ( top right corner) the image is removed and no image is saved for the "vendor image";
The only way to save the vendor image via the front-end is to click "Back" (top left corner)

I also tried to enter a custom text field above the "Vendor image" upload section notifying the end-user to click back rather than save if updating the vendor image, but i am unaware on how to place such a custom field in between the divs/blocks Vendor image and Contact E-mail under the "Edit your vendor details".

I had read another post regarding custom field but only being able to do so in the business version, so i upgraded from essential to business hoping i would at the very least be able to apply a notice not to click save. plus it was a good reason to upgrade to business version for all the other benefits ;)

Any advice you could give me would be greatly appreciated. Also, i am running a test server locally; so it is not live until i am able to sort out the few issues i am facing.

p.s I have tried the edits you suggested to Mett to no avail.



Thank you for your time.
-Ray

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 month ago #215082

Hi,

Which HikaMarket version number are you using ?
Do you have an override for the view "vendormarket | registration" (made by you or your template) ?

I think it will be better to fix the saving issue than placing some custom text for explanations.
About the custom fields ; HikaMarket provide "vendor custom fields".
It won't provide "product / item / order" custom fields which are provided by commercial editions of HIkaShop but it provides the feature for his own tables.

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.081 seconds
Powered by Kunena Forum