LemonStand Forum: Renaming a default defined column - LemonStand Forum

Jump to content

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

Renaming a default defined column

#1 User is offline   Beats 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 192
  • Joined: 18-January 11

Posted 22 December 2011 - 09:51 PM

Hey guys,

Sorry I just noticed I posted a thread in the wrong forum, and will request a mod to delete the other thread.

Well, is it possible to rename an already defined column via a new module?

For instance "SKU" is already defaulted set in the Create/Edit Product page.... but is it possible to give SKU the name "Product ID" or something else?

Basically something like this:

[b]$product->define_column('sku', 'SKU'); ---> $product->define_column('sku', 'Product ID');[/b]


[b]$product->define_column('description', 'Long Description'); ---> $product->define_column('description', 'Some Custom text');[/b]


Please let me know if this is possible and how I should proceed.

Thanks!

Beats.
0

#2 User is offline   Aleksey 

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

Posted 25 December 2011 - 02:53 PM

Hi!

You can do it in the shop:onExtendProductModel event handler (http://lemonstandapp...uctmodel_event/).

$def = $product->find_column_definition('sku');
$def->displayName = 'Product ID';

Not tested, but should work.

Thank you

#3 User is offline   Beats 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 192
  • Joined: 18-January 11

Posted 27 December 2011 - 08:06 AM

Hi Aleskey,

That worked perfectly. Thanks

For others to reference: To Hide Fields and Tabs As this kind of pertains to the same topic.

_____


Is there a way to move a defined column/field to another tab and to add a parameter (ie. form side) and class to it also?

For example:

Moving Base Price from the tab "Pricing" to the tab "Product".

Thanks!
0

#4 User is offline   Aleksey 

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

Posted 27 December 2011 - 02:22 PM

View PostBeats, on 27 December 2011 - 08:06 AM, said:

Is there a way to move a defined column/field to another tab and to add a parameter (ie. form side) and class to it also?

For example:

Moving Base Price from the tab "Pricing" to the tab "Product".

Thanks!


Hi!

Yes, you can do it in the shop:onExtendProductForm (http://lemonstandapp...ductform_event/) event handler. Example:

$field = $model->find_form_field($dbName('price');
$field->tab('Product')->side('right');

Please look into the Db_FormFieldDefinition class definition for all options.

Thank you

#5 User is offline   Beats 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 192
  • Joined: 18-January 11

Posted 29 December 2011 - 03:03 PM

Thanks Aleksey,

Is there a way to auto input text into a input field in the backend? I am looking at the DB_FormDefinitions, and I can't find a reference for this.

Edit: Here is a javascript alternative (not sure if there is a reference for this though)
jQuery(function($)
{
	$('#id_of_form_field_here, #id_of_form_field2_here,').each(function()
	{
    	var default_value = this.value;
    	{ if(this.value == default_value) {this.value = 'text you want to display here' in the inputfield;} };
    
	});
});


With the Manufacturer Option in the Edit/Create Product Tab, is it possible to customize the text options shown? For example, can I change "Create New Manufacturer" to "Create New Supplier" here?

Is it possible to also edit a form section? For example, the "add_form_section" in the Attributes tab.
0

#6 User is offline   Beats 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 192
  • Joined: 18-January 11

Posted 01 January 2012 - 10:24 PM

Hello..again.

I was going through the LS Docs, and there aren't any events to extend the Product Groups (Shop_CustomGroup), and also for the Preview tab for Customers (/customers/preview) and Products (/products/preview/)?
0

#7 User is offline   Aleksey 

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

Posted 03 January 2012 - 02:27 AM

Hi,

The documentation is not complete yet, but you can find many things by exploring LemonStand code.

1. I added your event requests to our internal list. There is an event for extending the Product Preview page: shop:onExtendProductPreviewTabs. The handler should return an array:

array('Custom tab'=>PATH_APP.'/modules/your-module/partials/_tab_partial.htm')

2. Placeholder text is not support by the framework (yet).
3. You can change the empty option text in drop down fields. Find the form field (find_form_field) and then call emptyOption('Create New Supplier') on the form field object.
4. You can add form sections in the extend...Form event handlers. You can find existing form sections in the model's $form_elements field and modify it. Form sections are Db_FormSection objects.

Thank you

#8 User is offline   Aleksey 

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

Posted 26 January 2012 - 04:10 PM

Hi,

We just added the shop:onExtendCustomGroupModel, shop:onExtendCustomGroupForm and shop:onGetCustomGroupFieldOptions events.

Thank you

Share this topic:


Page 1 of 1

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