No Vendor Paypal email but customer can still buy

  • Posts: 108
  • Thank you received: 6
10 years 2 months ago #173138

-- HikaShop version -- : 2.3.3
-- HikaMarket version -- : 1.4.4
-- Joomla version -- : 3.3.3

Hi,
I have noticed that a customer can still attempt to purchase a product from a vendor who has not set a paypal account - naturally this causes a problem at checkout

In my login I have automatically made everybody a vendor, however I dont want to force everybody to have to enter all vendor details at registration

I am open for suggestions as to how to prevent this for example:

  • should everyone who registers just become a customer, and then there is a second step to be come a vendor?
  • or can I get creative and do something whereby if a customer does not have a paypal email, the add to cart button does not appear?
looking for the simplest method!

thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 months ago #173165

Hi,

The solution 1 is easy to do.

The solution 2 could be done using a custom plugin ; you can "say" that a vendor without a valid paypal email will be "deactivated".
So using the vendor triggers (onBeforeVendorCreate / onBeforeVendorUpdate) you can check the vendor and change the value of a custom field like "vendor_valid" depending the paypal email in the vendor.
And then, in the trigger "onBeforeProductListingLoad" you can replace the filter

$filters[] = '(hikam_vendor.vendor_published IS NULL OR hikam_vendor.vendor_published = 1)';
By
$filters[] = '(hikam_vendor.vendor_published IS NULL OR (hikam_vendor.vendor_published = 1 AND hikam_vendor.vendor_valid = 1))';
The "vendor_published" will block the HikaMarket interface, so using that field won't be useful because the user won't be able to access to his vendor panel to change his paypal email.
Adding some code with the trigger of the quantity check can be useful too, so it won't be possible to add products of the non valid vendors.

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

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

  • Posts: 108
  • Thank you received: 6
10 years 2 months ago #173176

awesome thanks Jerome,

I'll play around with solution 2 and see which one suits:)

with regards to solution 1, I set the registration to "automatic validation" which I assume automatically registers a vendor only when they have specifically asked to be a vendor

after a user registers on the site, I set up a menu item whereby a user could request to become a vendor using the "vendor edition" menu item type.

when a user clicks on that menu item it sends an error message saying you are not a vendor and do not have access.

have I got the logic right about how this works?
have I done something wrong?

cheers

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 months ago #173180

Hi,

The vendor edition is working fine during the latest tests.
When you test it, where you logged with an account ?
Does this account have a vendor assigned ? A unpublished vendor ?
Did you tried the page without being logged ?
What's your HikaMarket configuration for the vendor registration ?

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

When you test it, where you logged with an account ?

yes

Does this account have a vendor assigned ? A unpublished vendor ?

no & no - signed up a couple of new accounts with the same results

Did you tried the page without being logged ?

yes - same result. It currently tries to go to the "edit your vendor" page, but there is nothing there

What's your HikaMarket configuration for the vendor registration ?

attached: I have tried it with "Paypal account required" and "ask for a password" on too with the same result

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 months ago #173311

Hi,

Please edit the file "components/com_hikamarket/controllers/vendor.php" and replace

if($vendor != null && !hikamarket::acl('vendor_edit'))
By
if(!empty($vendor) && !hikamarket::acl('vendor_edit'))
f you will have the problem, please use the code
if(!empty($vendor) && !hikamarket::acl('vendor_edit')) {
	var_dump($vendor);
	exit;
	return hikamarket::deny('vendor', JText::sprintf('HIKAM_ACTION_DENY', JText::_('HIKAM_ACT_VENDOR_EDIT')));
}
It will display the debug of the vendor instead of redirect you.
Regarding the code, you can get the message only when the user have a vendor assigned so we have to know what data is return by the function loadVendor in your case.

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

thanks,

the error shows "please login as vendor"

so it doesnt take you to a vendor registration page, as I expected it would do if you are logged in as a user/customer

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #173363

Hi,

Pleae provide me some accesses ; you are not using the right menu, that's just not possible you got this message with the vendor edition menu. You're using the vendor cpanel or another view, but not the vendor edition...

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: 108
  • Thank you received: 6
10 years 1 month ago #173412

yes I know it sounds like that was what it is trying to do - so I checked and menu type is defnitely hikamarket/vendor edition

i'll send you admin thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #173441

Hi,

You got some view overrides.
I fixed one element in your views but I don't have a simple account to test the rest of the process.

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: 108
  • Thank you received: 6
10 years 1 month ago #173457

thanks,

I can apply to be a vendor now - what views were altered that affect vendor edition?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #173458

Hi,

The views were : "vendor | form" and "vendor | registration".
The fact is that the vendor registration has been improved in the latest version, it is now possible to register the user and the vendor in a single step.
If you want to manage the user+vendor registration, I will recommend you to save your view override, restore the original views and re-made your modifications. Otherwise, with the little modification I made, it should work.

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: 108
  • Thank you received: 6
10 years 1 month ago #173468

thanks,

I originally set the registration to include both but I want to have customers register first with minimal details, then have the customers who wish to sell register to become a vendor as a separate second step.

Seems like its working ok now since your workaround but perhaps its best I restore the original and get it working so when upgrades happen it doesnt affect the process!

I'll let you know how this goes:)

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

  • Posts: 108
  • Thank you received: 6
10 years 1 month ago #173511

Hi Jerome,

the fallout seems to be a 500 error when trying to access the vendor form page from the vendor cpanel
I'm not sure why as there shouldnt have been any changes to the vendormarket/cpanel page?

edit:
I re-applied the code you added above and its working ok.

question:
will future updates include the code you gave me in controllers/vendor.php ? I just want to keep an eye on any adjustments I might need to make when new updates occur

Last edit: 10 years 1 month ago by christofu. Reason: found part solution

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 1 month ago #173514

Hi,

When I provide a patch, I generally include it into HikaMarket (with or without confirmation).
So yes, this patch will be in the next 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.081 seconds
Powered by Kunena Forum