Product Creation form does not store info

  • Posts: 58
  • Thank you received: 2
6 years 10 months ago #285691

-- url of the page with the problem -- : www.litterpicks.com
-- HikaShop version -- : 3.2.2
-- HikaMarket version -- : 2.0.1
-- Joomla version -- : 3.8.3

Hi, using Hikamarket Multivendor 2.0.1 and have an issue with vendors creating new product on front end. This is what happens:
1) Vendor is logged in to front end
2) Create a new product
3) When filling in product fields, if they forget to enter info in a required field and then hit "Save", all info filled in disappears
4) The page reloads and tells them which required fields they forgot (as it should), BUT all the information that they entered previously has disappeared from the form

Info should be stored in the form. I can not reproduce this on the back end of the site and I've tried multiple browsers (Firefox and IE) with the same issue. I've tried your DEMO site and it seems fine. It only happens with a logged in vendor trying to enter info into a front end vendor form on my site.

Any thoughts?

Last edit: 6 years 10 months ago by Jerome. Reason: removing credentials

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #285696

Hello,

I performed few test in my local website and I cannot reproduce your issue.
What required field are you talking about exactly ?
Do you have view override ? A custom plugin ?

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: 58
  • Thank you received: 2
6 years 10 months ago #285739

Perhaps it's our custom plugin. We wanted to use vendor reviews instead of product reviews so we had JLexArt create a custom vendor review plug in for us since Hikamarket didn't have that capability. Seems like the problem started around time of adding that. Is there something we need to do in order to make them compatible? Or something I need to ask them to fix in order to make the form not store temporary data?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #285742

Hello,

Without knowing how the plugin is working it will be difficult to say.
If it's a custom field ; there is the "check" function and it's directly handle by HikaShop/HikaMarket ; but if the plugin is using the "onBefore..." ; it might generate unwanted side effect depending it react. Afterwards it is still possible to push the data into the session "fail" variable in the custom plugin... But once again, without knowing the plugin we can't be sure.

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: 58
  • Thank you received: 2
6 years 10 months ago #285764

We tried disabling the custom plugin but that did not solve the issue. Data still lost. And their tech support says the plug in does not use "on Before".

Any other thoughts on how to investigate a solution?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #285786

Hello,

So we still have some pending questions :

What required field are you talking about exactly ?
Do you have view override ? A custom plugin ?


Please understand that in order to reproduce the error I need to perform the exact same action that you do.
Without these details ; I can't perform an investigation.

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: 58
  • Thank you received: 2
6 years 10 months ago #285817

We have disabled our one custom comment plug in and we still have the issue.

We don't see any customization on the vendormarket view form files.

I'm attaching a screenshot showing the custom fields that we have created in the "product" table. Some are required and some are not. It does not matter which of the required fields are left blank when a vendor is creating a new product. If ONE or MORE required fields is skipped, when the "SAVE" button is pressed, the page reloads and all of the fields (both core fields and custom fields) are blank.

This only happens on front end and does not happen with any other contact forms on our site (we have a few Breezing Forms which we have disabled and tried as well). It is just the vendormarket form.

You can log in as a breeder to test if you'd like. user name is "testbreeder" and pw is "tester". If you go to My Account and then Create New Litter, you should be able to replicate the issue.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #285824

Hello,

I think I see what is different in your website and in our test websites.
You're using product templates and a recent patch in the system makes the template write its content after the loading of the failed product.

I see two different ways for a fix and I would need to perform more tests to decide which one would be the best.
For the moment, please edit the file "components/com_hikamarket/views/productmarket/view.html.php" and replace the code

	if(!empty($fail) && isset($fail->product_id) && $product->product_id == $fail->product_id) {
		foreach($fail as $k => $v) {
			$product->$k = $v;
		}
	}
By
	if(!empty($fail) && isset($fail->product_id) && ($product->product_id == $fail->product_id || ($fail->product_id == 0 && !empty($template_id)))) {
		foreach($fail as $k => $v) {
			$product->$k = $v;
		}
		$template_id = 0;
		$product_id = (int)$fail->product_id;
	}
It should avoid the loading of the product template data when a failed product is extracted.

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: 6 years 10 months ago by Jerome. Reason: fix

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

  • Posts: 58
  • Thank you received: 2
6 years 10 months ago #285826

Thanks for all the investigating Jerome. I found the file and the location in the file and replaced the code. Cleared cache and browser and still have some issue with fields going back to the "template" form. Any other thoughts? Suppose for now I can just not have any of the fields required, or tell vendors to be really careful about not forgetting a field...but that probably isn't the best solution.

Let me know if you have anything else for us to try.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #285880

Hello,

We are working on a bigger modification which would require some time.
Since that patch cannot be provided in a short period ; you can see to use that code in the mean time

		if(!empty($fail) && (isset($fail->product_id) && ($product->product_id == $fail->product_id) || (empty($fail->product_id) && (empty($product_id) || $product_id == $template_id)))) {
			foreach($fail as $k => $v) {
				$product->$k = $v;
			}
			$product_id = (int)@$fail->product_id;
			$template_id = 0;
		}
I tested it in a local website and it gave me results but there is still a side effect regarding characteristics ; so it won't be the final patch.
It's just something to wait.

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: 58
  • Thank you received: 2
6 years 10 months ago #285955

Thanks Jerome. That seems to fix it. We haven't tested it when creating variants, but it works when saving the main product. We'll let you know if we have more issues with it. Thanks again.

The following user(s) said Thank You: Jerome

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

  • Posts: 58
  • Thank you received: 2
6 years 10 months ago #286022

We just noticed another big issue since upgrade. We had configured the ACL so that a logged in vendor would not create a price for the main product, but just the price field of the variants for that product. It worked fine as a vendor would create a main product, save it, then create variants of that product and give each a price.

To do that, we had the "product / edit / price / value" box unchecked in the ACL default store access and the "product / variant / price / value" checked. That way the price field on the main product would not show up and it would with the variants. It worked fine.

HOWEVER, since upgrading, this same ACL configuration does not allow a logged in vendor to enter a price for the variant. The text is still there that says "Price" but the actual field to enter the price is hidden. There is no way to enter variant price. And any variant that was created previously and resaved in the front end loses the price. I'm attaching a screen shot showing the missing field with this ACL configuration.

If we go back and change the ACL configuration and CHECK the "product / edit / price / value" box in the ACL, then the main product price field shows up AND the variant price field does as well.

We aren't sure what has changed since the upgrade--it worked fine before. But now the variant price field has disappeared. Is there a different way then that we now need to configure ACL so that a vendor can create variant prices but does not give a price to the main product?

And BTW, what is the "New" folder that is in the ACL under "product" (between "edit" and "variant"? We don't remember that before?

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #286030

Hello,

Please edit the file "components/com_hikamarket/views/productmarket/view.html.php" and replace

	if($vendor_id <= 1)
		$useNewACL = false;
By
	if($vendor_id <= 1)
		$useNewACL = false;
	if(!empty($this->editing_variant))
		return hikamarket::acl('product/variant/' . trim($action, '/') );
And it should fix the reading of the "product / edit / price" instead of "product / variant / price".

The "product/new/" has been added in order to allow you to configure different ACL depending if the vendor is creating a product or editing one.
So if you're using "waiting approval" system, you can see to give more access during the creation than after the approval.
Please note that if you do not set anything for "product/new/", it will use "product/edit/" rules instead.

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: 58
  • Thank you received: 2
6 years 10 months ago #286038

That fixed the issue. Will that "fix" be overwritten when we upgrade or should we not have to worry about it again?

Thanks as always for the great support.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 10 months ago #286040

Hello,

That patch I gave you has been integrated into HikaMarket and will be include in the next release.
For the previous one, the final patch would be slightly different but the fix would be the same at the end.

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