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

Virtuemart registration fields conditional on basket/products chosen: Possible?

Started by gbruzzo, November 26, 2015, 14:05:32 PM

Previous topic - Next topic

gbruzzo

Dear all

Joomla 3.4.5
Virtuemart 3.0.10

Assume:

-both guest and standard registration at checkout are offered
-store sells a mix of physical and virtual products
-a virtual products plugin is installed (istraxx or other).
-weight of virtual products is set to 0, weight of a physical product > 0

Therefore there is a univocal "rule" to distinguish a basket containing only digital products (weight = 0) from one containing a mix of virtual and physical (weight > 0)

Assume now a new (non-registered) customer buys virtual / Download products only.
I would like to offer him / her the opportunity to register without having to give all address details (e.g. with only username/password/email and country, since we need to know where they are situated, for VAT purposes).
Why? Because customers do not like to leave unnecessary information nowadays, and will tend to drop the basket if presented with an excessively tedious (and unnecessary) registration procedure.

I am therefore looking to find a way of making the user registration forms dynamically conditional on properties of the basket (in our case weight), e.g. offer this form if weight > 0 vs. offer that form if weight = 0.

I could only find a plugin which made forms conditional on forms, but not on the basket.

An option could be to use shopper groups (there is a dynamic shopper group changer I know of, would have to be changed), but then is it possible to offer a different registration form depending on the shopper group?

Any help / guidance / ideas deeply appreciated .

Kindest regards to all

Giacomo Bruzzo


gbruzzo

Hello there

could anyone from the VM team chime in on this please (even to confirm it is not possible?)

Thank you in advance

Giacomo Bruzzo

GJC Web Design

in the Bill To get the cart object and read the weight .. hide/show fields depending on the result

can't remember if the "required" test is only Js (think so) then perhaps some JS to remove the required="required" etc
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

gbruzzo

Hello there,

thank you very much for your response. Trying to identify the files to look at.

Are you referring to the default_address.php from /components/com_virtuemart/views/cart/ ?

Sorry for the basic question, I am currently learning the logic of VM 3.

Kind regards

Giacomo Bruzzo

GJC Web Design

components\com_virtuemart\views\user\tmpl\edit_address.php is where the BT/ST forms are displayed

components\com_virtuemart\views\user\tmpl\edit_address_userfields.php  are where the user fields are looped thru

components\com_virtuemart\views\cart\tmpl\default_address.php is where the address choice etc is rendered

BTW in Rupostels OPC all this setup is possible just from its admin
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

gbruzzo

Thank you for the clarification GJC.

Alas I am not using the Rupostel OPC, but rather VMUIkit + Warp 7 (which means there is a further layer of overrides  I will have to contend with).

All fine and interesting

Cheers

Giacomo Bruzzo

Milbo

Quote from: GJC Web Design on December 07, 2015, 12:55:05 PM
components\com_virtuemart\views\user\tmpl\edit_address.php is where the BT/ST forms are displayed

components\com_virtuemart\views\user\tmpl\edit_address_userfields.php  are where the user fields are looped thru

components\com_virtuemart\views\cart\tmpl\default_address.php is where the address choice etc is rendered

BTW in Rupostels OPC all this setup is possible just from its admin

"Therefore there is a univocal "rule" to distinguish a basket containing only digital products (weight = 0) from one containing a mix of virtual and physical (weight > 0) "

hm?

"I would like to offer him / her the opportunity to register without having to give all address details (e.g. with only username/password/email and country, since we need to know where they are situated, for VAT purposes). "

Ehrm, yes for VAT you need all that. Customers must enter it.


"I am therefore looking to find a way of making the user registration forms dynamically conditional on properties of the basket (in our case weight), e.g. offer this form if weight > 0 vs. offer that form if weight = 0. "

Then I would loop through the userfields within the layouts suggested by GJC and set the required attribute off.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gbruzzo

Dear Milbo

thank you for chiming in.

by Univocal I mean a necessary and sufficent condition I can check which will allow me to distinguish between the two. Ideally it would be nice to add a dimension/characteristic to distinguish physical from virtual products. I am not aware of any, but this may be down to my relative ignorance. Is there one?

Other than that, I will focus on your suggestion,

Thank you

Giacomo Bruzzo

GJC Web Design

It seems std. practice to use/set virtual weights to 0..  this e.g. helps to remove shipping etc

I guess you could also use a separate cat .. but doesn't change the advice.. detect and show/ no show
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