Author Topic: Dont let users edit/add ST adresses  (Read 881 times)

welrachid

  • Jr. Member
  • **
  • Posts: 265
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Dont let users edit/add ST adresses
« on: October 24, 2016, 10:30:11 am »
Hi everyone.
Im trying to figure out how to stop users from being able to edit/add ST adresses. I know i can make a small plugin that always sets BT = ST but, what i want is that the links for editing/adding new addresses are disabled.
I've done a bit of work with CSS but the addresslist in views/cart/view.html.php: renderCompleteAddressList displays the link to editing.
<a href="index.php'
            .'?option=com_virtuemart'
            .'&view=user'
            .'&task=editaddresscart'
            .'&addrtype=BT'

From my understanding its the
echo $this->cart->lists['shipTo']; in default_address.php that prints out that list of possibilities.
My current solution is to in the template override making a
echo strip_tags($this->cart->lists['shipTo'],"<input>");

Is that the way to do it?

Thanks
Best regards,
Wel

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Dont let users edit/add ST adresses
« Reply #1 on: October 25, 2016, 15:50:56 pm »
It could be interesting to provide a config like "allow ST addresses" and if it is disabled, we can disable it in the core.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

welrachid

  • Jr. Member
  • **
  • Posts: 265
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: Dont let users edit/add ST adresses
« Reply #2 on: October 27, 2016, 15:07:22 pm »
That would be very nice
Best regards,
Wel