VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: jflash on May 16, 2020, 20:19:55 PM

Title: Shopper fields on cart
Post by: jflash on May 16, 2020, 20:19:55 PM
Hello all!
I have used Virtuemart over many years and this is very good project and i want to thank you for this!

I use VM 3.6.10 on J 3.9.18 and i want to change my shopping cart more compact. I want to put shopper info, shipment info and payment info together (done, see attached image). All is OK, but how to show shopper fields under Shopper data (i do not want to go to another page to fill them)?
Title: Re: Shopper fields on cart
Post by: GJC Web Design on May 16, 2020, 20:39:05 PM
echo $this->loadTemplate ('cartfields'); includes the shopper fields template

or do u mean address data?

it would be a similar method

something like

echo $this->loadTemplate ('address');

but these are forms that submit to different target urls .. thats the tricky bit
Title: Re: Shopper fields on cart
Post by: jflash on May 16, 2020, 21:31:52 PM
Quote from: GJC Web Design on May 16, 2020, 20:39:05 PM
echo $this->loadTemplate ('cartfields'); includes the shopper fields template
I have this and it shows 'add/edit billing details' and other text, i want to show fields (email, name, country, etc) here

Quote from: GJC Web Design on May 16, 2020, 20:39:05 PM
echo $this->loadTemplate ('address');
This does nothing when i tried.
Title: Re: Shopper fields on cart
Post by: GJC Web Design on May 16, 2020, 22:58:59 PM
you need to see what then happens when u call the template ..

it is never going to be as simple as just calling the file...
Title: Re: Shopper fields on cart
Post by: Studio 42 on May 17, 2020, 12:34:24 PM
the shopper fields are in the user view, so this  trick do not work, you have to add the user edit layout in the cart view.
But then the form is inside the form and can have side effects, so you need to modify more codes and perhaps use own javascript to refresh correctly some cart informations. For eg. sihpment methods list, total cart price ....
Title: Re: Shopper fields on cart
Post by: jflash on May 17, 2020, 14:04:15 PM
OK, thank you, i try now to show user fields in modal window :)