LemonStand Forum: Customising the admin - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Customising the admin

#1 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 30 January 2012 - 11:57 AM

Is there an API reference for interacting with the admin back-end? For example, I want to remove a particular tab from the product entry page.
0

#2 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 01 February 2012 - 03:56 PM

Hi Dominic,

To remove a tab from the Create/Edit Product form you should remove all controls from this tab. Models in LemonStand have the delete_form_field() method, which allows to remove a specific field. Example (for blog comment): http://forum.lemonst...endcommentform/

You should create a custom module and handle the shop:onExtendProductForm event in it (http://lemonstandapp...ductform_event/). In the handler you can remove all fields which are not needed. You can find a list of native fields in the modules/shop/models/shop_product.php class (see define_form_fields() method).

I hope this helps.

Thank you

#3 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 05 February 2012 - 11:54 AM

Brilliant! Thanks.
0

#4 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 10 February 2012 - 05:26 PM

So what if I just want to HIDE a field, instead of deleting a field. For example, I want to hide the notes field on the customer tab, but not remove the actual database column. I want a simple way of hiding/showing fields on different sites based on a stock install of Lemonstand.
0

#5 User is offline   Eric 

  • Developer
  • PipPipPip
  • Group: Members
  • Posts: 1,290
  • Joined: 04-August 10
  • LocationVancouver, Canada

Posted 10 February 2012 - 07:36 PM

View PostDominic, on 10 February 2012 - 05:26 PM, said:

So what if I just want to HIDE a field, instead of deleting a field. For example, I want to hide the notes field on the customer tab, but not remove the actual database column. I want a simple way of hiding/showing fields on different sites based on a stock install of Lemonstand.


Somebody asked this in chat today. I believe the solution was to call defaultInvisible() on the define_column(). You'll have to $customer->find_column_definition('notes')->defaultInvisible(). LMK if that doesn't work.
0

#6 User is offline   Dominic 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 63
  • Joined: 24-January 12

Posted 11 February 2012 - 07:56 AM

Ah cool thanks. I'll give that a go.
0

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users