News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[SOLVED] TOS bugs on checkout

Started by Blackwabbit, November 15, 2013, 18:47:23 PM

Previous topic - Next topic

Blackwabbit

Hello.
I've got a deep problem with TOS on checkout.
TOS line and checkbox should appear and get checked in to proceed payout. However, it doesn't appear at all, while the shop is configured to ask customers to agree TOS.
Screenshot :


I had an override in my template, so i disabled it. but the problem remains.


I found a bunch of articles about some similar problems, but never about that case exactly, and all of them are pretty old or talk about obsolete bits of code.

I decided to look at components/com_virtuemart/views/cart/default.php and try to get what was going wrong.
I finally realised that TOS line doesn't appear because of that if condition, line 152 :
if ($userFieldsModel->getIfRequired ('agreed')) {

If i disable it (as its closing bracet a few lines further of course), tada, all my TOS stuff reappears. TOS label (including the popup link to vm tos), and TOS checkbox.

BUT ...
Checking it or unchecking the box it has no consequence ... Customers can finish their order without checking/clicking the box... Which is pretty much the inverse of what it's supposed to do  :-\


I'm totally lost, i plundered the whole web and found nothing. And now, i'm beggin for help, or direction, on your forum !
Thank you  ;D

And sorry for my rusty english.


GJC Web Design

but if  if ($userFieldsModel->getIfRequired ('agreed')) { isn't true

(this comes from function getIfRequired($fieldname) file administrator/components/com_virtuemart/models/userfields.php line 1074 )

then it isn't set as "required" in the #__virtuemart_userfields table...

what does the VM admin shopper fields say?

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Blackwabbit

Hello GJC, and thank you for your answer.

If i understand, this condition means that __virtuemart_userfields table should indicate "required".
Stop me if i'm wrong, but this :

is the way to get this field as "required", isn't it?

the two lines within the red circle are the options to force any user to checks and agree tos before checking out any order.

The first line litteraly means : "Should user accept tos for every order", while second one means "display tos on order confirm page".

The last checked line is about forcing the client to create a user account while checkout.

does that answer your question? I must admit i'm still lost in this case :s

GJC Web Design

Yes - but those settings are VM settings in virtuemart.cfg - I doubt highly they are changing the database setting for

table: #__virtuemart_userfields ; field: required; where name = agreed

have you checked that table and is required set to 1?

It is set afaik in VM config->configuration->shopper fields but it is normally locked.
If your ($userFieldsModel->getIfRequired ('agreed')) { ->  isn't true then the required can't be 1
if not just set it in the database directly

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Blackwabbit

#4
Thank you GJC Web Design :)
that's exactly the info i was looking for, and that exactly fixed my problem.

For som reason, the COM_VIRTUEMART_I_AGREE_TO_TOS table field, named agreed, was assigned to 0 in the required column.
If i get that right, the checkbox in virtuemart config is supposed to act on this table field, passing it to 0 or 1. For some reason, my virtuemart doesn't.

However, thank you for your time and effort.
Problem vapored  8)

GJC Web Design

And I thank you for your thank you!!!! :)

very rare sadly..  :(
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Blackwabbit