VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: PeterSwe on March 23, 2015, 19:39:56 PM

Title: Suggestion: new functionality to hide shopper fields
Post by: PeterSwe on March 23, 2015, 19:39:56 PM
Hi,
Sometimes you want to add a shopper field which only admin are allowed to change or see. Today you can hide the field for account maintenance but this also hide it for the admin.
Perhaps something to add for future versions?

In the meantime I would be very glad to get some advice where I can hide these fields in the "Shopper account" and in the BT and ST addresses. Right now I have 6 customer unique fields before the shipmentaddress in the cart.

Thanks,
Peter
Title: Re: Suggestion: new functionality to hide shopper fields
Post by: GJC Web Design on March 23, 2015, 22:34:46 PM
the fields are displayed in a loop on (over ride path) html\com_virtuemart\user\edit_address_userfields.php

you could hide them by css ..



Title: Re: Suggestion: new functionality to hide shopper fields
Post by: PeterSwe on March 23, 2015, 23:13:18 PM
Thanks for your answer. I have migrated the shop from 1.1 to 3.0 and in 1.1 I just coded $skipFields[] = [userfield]; in ps_shopper.php and in account.billing.tpl.php I did an array for the fields to skip.
I was thinking doing it in a similar way for these 6 customfiled_id's which I don't want to show. I just don't know where to take care of it.

//Peter
Title: Re: Suggestion: new functionality to hide shopper fields
Post by: GJC Web Design on March 24, 2015, 00:55:10 AM
if you don't mind core hacks

components\com_virtuemart\views\cart\view.html.php ~ line 107

$userFieldsCart = $userFieldsModel->getUserFields(
            'cart'
            , array('captcha' => true, 'delimiters' => true) // Ignore these types
            , array('delimiter_userinfo','user_is_vendor' ,'username','password', 'password2', 'agreed', 'address_type') // Skips
         );
Title: Re: Suggestion: new functionality to hide shopper fields
Post by: PeterSwe on March 24, 2015, 09:22:58 AM
Thanks,
I don't like core hacks but sometimes it's a quick workaround. :)
Title: Re: Suggestion: new functionality to hide shopper fields
Post by: PeterSwe on March 24, 2015, 16:23:59 PM
Strange, it didn't work for the cart. Only for the order.