Advertisement:

Author Topic: [PLUGIN] Toggle Item Status  (Read 1897 times)

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
[PLUGIN] Toggle Item Status
« on: December 07, 2016, 03:17:52 am »
English Version:
 
With this plugin, it is possible for users to tag their listings. Possible marks here are sold and available again.
 
The integration is pretty simple. You can insert a Button where you want that give the user the possibility to mark his listings as sold or available. This inform all user, that this Listing is no longer available and when the user want to reinsert the listing, he simply can make it re-available.
 
To display the toggle button, place this code anywhere you want (e.g. in item.php of your theme)
 
Code: [Select]
<?php tis_show(osc_item_id(), osc_item_user_id()); ?>
You should insert a status box to the item page with this code (e.g. in item.php of your theme)
 
Code: [Select]
<?php tis_status_box(osc_item_id()); ?>
You can change the appearance of the button via CSS in the following file.
 
../oc-content/plugins/toggle_item_status/assets/css/tis.css
 
This plugin can be translated in different languges, available for now are: german, english
 
 
Deutsche Version:
 
Mit diesem Plugin ist es den Benutzern möglich, ihre Inserate zu markieren. Mögliche Markierungen hierbei sind verkauft und wieder verfügbar.

Die Funktionsweise ist relativ simpel. Man kann sich an beliebiger Stelle im Inseratemarkt einen Button anzeigen lassen, welcher es den Inserenten erlaubt das Angebot auf verkauft zu stellen und somit alle anderen darüber informiert, dass dieser Artikel nicht mehr erhältlich ist. Sollte man wider erwarten auf dem Artikel sitzen bleiben, kann man das Angebot wieder zurückholen, in dem man es wieder auf verfügbar stellt.
 
Um den Togglebutton anzuzeigen, platziere diesen Code wo Du möchtest (z.B. in item.php von deinem Theme)
 
Code: [Select]
<?php tis_show(osc_item_id(), osc_item_user_id()); ?>
Du solltest mit diesem Code eine Statusbox auf der Angebotsseite einfügen (z.B. in item.php von deinem Theme)
 
Code: [Select]
<?php tis_status_box(osc_item_id()); ?>
Um den Button oder die Statusbox zu designen, bearbeite folgende Datei
 
../oc-content/plugins/toggle_item_status/assets/css/tis.css

Das Plugin kann jetzt schon in alle Sprachen übersetzt werden, verfügbar sind bis jetzt: deutsch, englisch

Download here: OSClass Market

thedon

  • Sr. Member
  • ****
  • Posts: 341
Re: [PLUGIN] Toggle Item Status
« Reply #1 on: August 15, 2017, 03:41:40 pm »
Works like a charm but how can i change language from
Quote
No longer available
to something else?

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: [PLUGIN] Toggle Item Status
« Reply #2 on: August 15, 2017, 07:40:20 pm »
the whole plugin can be translated with the language files

dilishops

  • Newbie
  • *
  • Posts: 2
Re: [PLUGIN] Toggle Item Status
« Reply #3 on: September 27, 2017, 07:07:12 pm »
did someone find how to change this plug in language...would like to change it in french!!!Thanxxx

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: [PLUGIN] Toggle Item Status
« Reply #4 on: September 27, 2017, 07:58:15 pm »
this plugin uses language files, you can translate it with poedit

leox

  • Newbie
  • *
  • Posts: 1
Re: [PLUGIN] Toggle Item Status
« Reply #5 on: May 18, 2019, 10:27:45 pm »
super added if added to the ads list in the admin panel
Google translation sorry

wonaza

  • Newbie
  • *
  • Posts: 3
Re: [PLUGIN] Toggle Item Status
« Reply #6 on: May 28, 2019, 01:19:14 pm »
Thanks, it works :)

But, i have new problem now. Users cannot delete their own listings because that plugin.

I have to go to panel admin for remove the listings.


calinbehtuk

  • Sr. Member
  • ****
  • Posts: 478
Re: [PLUGIN] Toggle Item Status
« Reply #7 on: May 30, 2019, 02:56:24 pm »
Thanks, it works :)

But, i have new problem now. Users cannot delete their own listings because that plugin.

I have to go to panel admin for remove the listings.

Code: [Select]
function tis_before_delete_item($itemId) {
    if (!is_numeric($itemId)) {
        return null;
    }
    $tis = new t_i_s();
    $tis->dao->delete($tis->tis_table(), array('ti_id' => $itemId));
}

osc_add_hook('before_delete_item', 'tis_before_delete_item');

wonaza

  • Newbie
  • *
  • Posts: 3
Re: [PLUGIN] Toggle Item Status
« Reply #8 on: May 31, 2019, 08:05:40 am »
Thanks, it works :)

But, i have new problem now. Users cannot delete their own listings because that plugin.

I have to go to panel admin for remove the listings.

Code: [Select]
function tis_before_delete_item($itemId) {
    if (!is_numeric($itemId)) {
        return null;
    }
    $tis = new t_i_s();
    $tis->dao->delete($tis->tis_table(), array('ti_id' => $itemId));
}

osc_add_hook('before_delete_item', 'tis_before_delete_item');

Thank you very much. it works :)

Germar

  • Newbie
  • *
  • Posts: 24
Re: [PLUGIN] Toggle Item Status
« Reply #9 on: June 11, 2019, 03:51:06 pm »
NEW PROBLEM:

After installing this plugin, users can not click on there pictures to see the pop-up picture. Screen goes dark, but no picture shows up. After removing the programming in the item.php file, everything is working fine. So, whats the problem?

This is the line that is been added in item.php according the help file.
<?php tis_show(osc_item_id(), osc_item_user_id()); ?>


Ik placed it after the edit button.

...
<div>
    <a href="<?php echo osc_item_edit_url(); ?>" rel="nofollow">
        <button class="btn btn-info btn-post"><?php _e('Edit item', CLASSIC_LANGUAGE); ?></button>
    </a>
</div>         
<?php tis_show(osc_item_id(), osc_item_user_id()); ?>
    ...



The Status field:
Must be placed in item.php

<?php tis_status_box(osc_item_id()); ?>


Placed it above the Title

...
<div class="inner-box ads-details-wrapper">
    <?php echo tis_status_box(osc_item_id()); ?>
    <h2><?php echo osc_item_title(); ?></h2>
    <p class="item-intro">
    ...


So HELP??

Regards,
Germar
« Last Edit: June 11, 2019, 03:59:46 pm by Germar »