Advertisement:

Author Topic: Custom Attributes Plugin - how to make basic amend  (Read 2748 times)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Custom Attributes Plugin - how to make basic amend
« Reply #15 on: November 27, 2014, 11:40:45 pm »
Hi,

There is a function to display custom-attributes 
Code: [Select]
<? php if (function_exists ('custom_attributes')) custom_attributes ();?>

Is this a question or a statement? I couldn't find such function anywhere... ??? Custom attributes work just like Custom fields, they are shown dinamically, changing via Ajax call on Item post or edit depending on selected category, hence the need of this Javascript code I've provided.

I don't have the Symnel theme, but looking a the demo here, ny code should work just as well as in Bender or Modern... ???

Regards


ronnnie

  • Jr. Member
  • **
  • Posts: 89
Re: Custom Attributes Plugin - how to make basic amend
« Reply #16 on: November 28, 2014, 04:29:10 pm »
It is an statment, with this call custom-attributes to be shown anywhere, on the other hand has to be some way (remove_hook) to only show the custom fields and not custom-attributes, Boting plugin for example <? php osc_remove_hook ('item_detail', 'voting_item_detail'); ?>.

see the help in custom-attribute config panel in plugin menu

regards
« Last Edit: November 28, 2014, 04:33:36 pm by ronnnie »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Custom Attributes Plugin - how to make basic amend
« Reply #17 on: November 28, 2014, 04:44:12 pm »
Well, still no function custom_attributes() anywhere here using this plugin. So, you call this function inside your scripts and you are getting some result? All I have is a "PHP Fatal error:  Call to undefined function custom_attributes()".

On the other side, I'm a little confused, you name item_detail hook. That hook is for Ad showing, this thread is for Ad posting/editing... ???

Regards


ronnnie

  • Jr. Member
  • **
  • Posts: 89
Re: Custom Attributes Plugin - how to make basic amend
« Reply #18 on: November 28, 2014, 05:23:26 pm »
yes, sorry, I understood wrong translation into Spanish, seeing that wanted to move from place custom-attributes but I did not realize that this thread was for editing the ad, I'm looking to display custom elsewhere on the item page, I can show anywhere with <? php if (function_exists ('custom_attributes')) custom_attributes ();?>, but does not remove it from its place by default.
 you can see  here "http://livoo.co/ar/gastronomia/restaurantes/cocina-argentina/el-baqueano_i296"
in the sidebar is where I put the code and the description of the ad is where default shown.
I start another thread with this topic as correct.

thanks
regards.

potoco

  • Full Member
  • ***
  • Posts: 191
  • OSClass 3.5.3
Re: Custom Attributes Plugin - how to make basic amend
« Reply #19 on: March 28, 2015, 07:22:39 am »
Hi,

Please, I would like to move custom_atributes in item-post.php just after that:

Code: [Select]
<?php ItemForm::category_multiple_selects(nullnullnull__('Select a category''bender')); ?>
How could to do that in bender theme, last version (3.5.3)?

At the same time I would like a better style in this form, if possible..., please see attached imagen...

Thanks
Regards



teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Custom Attributes Plugin - how to make basic amend
« Reply #20 on: March 28, 2015, 02:01:53 pm »
***CORRECTED***

Hi,

This is just for your specific case (only one Select element), and that "Required" I don't know what will happen to it (if it should be shown anyway) ???. Well, try this variant of my original code:

Code: [Select]
<?php
function cust_move_custom_attributes() { ?>


<script type="text/javascript">
    $("#plugin-hook").change(function(){

        $("<div></div>").attr('id', 'moved_custom_attributes').insertAfter($("#catId").closest("div.control-group"));
        $("#custom_attributes label").removeClass('edit_label');
        $("#custom_attributes label").addClass('control-label');
        $("#custom_attributes div.select-box").parent('td').css('padding-left', '15px');
        $("#moved_custom_attributes").append($("#custom_attributes"));
    });
</script>

<?php }

$section Rewrite::newInstance()->get_section();
if (
$section == 'item_add' || $section == 'item_edit'osc_add_hook('footer''cust_move_custom_attributes');

function 
cust_trigger_plugin_hook() { ?>


<script type="text/javascript">
    $("#moved_custom_attributes").remove();
    $("#plugin-hook").change();
</script>

<?php }

osc_add_hook('item_form''cust_trigger_plugin_hook''6');
osc_add_hook('item_edit''cust_trigger_plugin_hook''6');
?>

Regards
« Last Edit: March 28, 2015, 11:02:26 pm by teseo »

potoco

  • Full Member
  • ***
  • Posts: 191
  • OSClass 3.5.3
Re: Custom Attributes Plugin - how to make basic amend
« Reply #21 on: March 28, 2015, 08:31:15 pm »
Hi,

This is just for your specific case (only one Select element), and that "Required" I don't know what will happen to it (if it should be shown anyway) ???. Well, try this variant of my original code:

Code: [Select]
<?php
function cust_move_custom_attributes() { ?>


<script type="text/javascript">
    $("#plugin-hook").change(function(){
        $("<div></div>").attr('id', 'moved_custom_attributes').insertAfter($("input#price").parent("div.controls"));
        $("#custom_attributes label").removeClass('edit_label');
        $("#custom_attributes label").addClass('control-label');
        $("#custom_attributes div.select-box").parent('td').css('padding-left', '15px');
        $("#moved_custom_attributes").append($("#custom_attributes"));
    });
</script>

<?php }

$section Rewrite::newInstance()->get_section();
if (
$section == 'item_add' || $section == 'item_edit'osc_add_hook('footer''cust_move_custom_attributes');

function 
cust_trigger_plugin_hook() { ?>


<script type="text/javascript">
    $("#moved_custom_attributes").remove();
    $("#plugin-hook").change();
</script>

<?php }

osc_add_hook('item_form''cust_trigger_plugin_hook''6');
osc_add_hook('item_edit''cust_trigger_plugin_hook''6');
?>

Regards

Hi teseo

Thank you for your fast reply and the solution, by the way, the styles works fine, but not the position, I would like these Custom Attributes just after category selector...

Code: [Select]
<?php ItemForm::category_multiple_selects(nullnullnull__('Select a category''bender')); ?>
Please see the new imagen attached..

Thank you very much
Regards

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Custom Attributes Plugin - how to make basic amend
« Reply #22 on: March 28, 2015, 11:05:15 pm »
Sorry, a mistake in a line. Check my corrected version above, now it should work with or without category_multiple_selects...

Regards

vivek347

  • Newbie
  • *
  • Posts: 3
Re: Custom Attributes Plugin - how to make basic amend
« Reply #23 on: March 29, 2015, 10:42:46 am »
You will get so many articles on www.hiptweet.com

potoco

  • Full Member
  • ***
  • Posts: 191
  • OSClass 3.5.3
Re: Custom Attributes Plugin - how to make basic amend
« Reply #24 on: March 30, 2015, 05:32:18 pm »
Sorry, a mistake in a line. Check my corrected version above, now it should work with or without category_multiple_selects...

Regards

Hi teseo,

Now is working fine, thank you for your help...

Regards