Advertisement:

Author Topic: Item Expiration  (Read 14464 times)

darren

  • Newbie
  • *
  • Posts: 2
Item Expiration
« on: January 02, 2012, 11:30:43 pm »
Feature Request:

Mark Items as expired in the dashboard in a user's "My Account" section (once they have actually expired)
Allow users to re-publish an item after it has expired.
Allow users to remove a listing (without deleting it) after their item sells

I have been looking through the code to attempt to add these features on my own, but I have not been able to do it yet. Any suggestions or help would be great. I will gladly offer my help if anyone familiar with the code can point me in the right direction in terms of what files need t be updated. Thanks much...

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #1 on: January 03, 2012, 02:40:52 am »
Hi darren,

I agree with your suggestion, we need this functions

disable, activate and mark as sold is allredy noted by osclass developer

topic:
Quote
http://forums.osclass.org/suggestions/user-can-disable-items/

regards

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #2 on: January 03, 2012, 02:50:26 am »
Hi darren,

Welcome to the community!

To add the text expired next to an item you could add the following code in the user-items.php file.


<?php
if(osc_item_is_expired()) {
_e('EXPIRED','modern');
}
?>


As for "Allow users to re-publish an item after it has expired." I as well have been looking for a solution to this.

As for "Allow users to remove a listing (without deleting it) after their item sells " I just submitted a feature suggestion for this as I have a site I am working on that I wanted this functionality. Here is the link to the issue for the code. https://github.com/osclass/OSClass/issues/102 Please do note that if you make these changes they will be overwritten when you do an update unless the osclass team adds this feature.

Jay
« Last Edit: January 03, 2012, 06:09:10 am by trains58554 »

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #3 on: January 03, 2012, 04:57:31 am »
Hi Jay,

somehow it's not work, deactivate - button takes me to search page and items  are not deactivate

regards

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #4 on: January 03, 2012, 05:02:35 am »
Hi ingo,

where about did you add the code in the item.php file? I forgot to add the line number where I added this code and that line was 245.

Make sure that the item.php file is the one in the root folder.

Jay

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #5 on: January 03, 2012, 05:38:10 am »
sorry,

I make it several times exact as your said/wrote but still takes me to search page

anyway thanks a lot.

3:35 h AM in Austria, I will take a break, bye!

Jesse

  • Hero Member
  • *****
  • Posts: 631
  • Out of my mind, back in 5 minutes
Re: Item Expiration
« Reply #6 on: January 03, 2012, 06:07:08 am »
Not sure if this is obvious, but just incase.... if you're using this code:

if(osc_item_is_expired()) {
_e('EXPIRED','modern');
}

Make sure to wrap it in <?php ?> tags, like:

Code: [Select]
<?php
if(osc_item_is_expired()) {
_e('EXPIRED','modern');
}
?>

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #7 on: January 03, 2012, 06:24:30 am »
I am thinking that the code was not added in the right place in the item.php file and it cannot find the deactivate code section and it just redirects you to the search page.

I uploaded the root folder item.php file try replacing yours with this. Make a backup of yours first just in case it does not work but it should.

Jay

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #8 on: January 03, 2012, 11:28:45 am »
@Jesse
Thanks, I used from the beginning correct code

@Jay
Thanks, your item.php file is the same like mine, it  redirects me to right page -....mypage.../item/activate/19
but actually Im on the search page - Your search result...

Jay you  made ​​a little typo at github:
Quote
<a href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Dectivate', 'modern'); ?></a>
<?php } ?>

No idea what am I doing wrong, thanks guys




ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #9 on: January 03, 2012, 06:28:09 pm »
I think I have problem with german language,

beacuse It's same in admin panel  when I try to Manage items, it will be > redirect to > /oc-admin/index.php?page=items&catId=99 page but it shows blank page, if I enable new language in oc-admin it shows items but only for short time

regards

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #10 on: January 03, 2012, 06:41:26 pm »
Hi ingo,

Can you tell me what the url of the deactivate link is?

Jay

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #11 on: January 04, 2012, 12:06:44 am »
Hi Yay,

........................................................

thanks
« Last Edit: January 04, 2012, 04:08:51 am by ingo »

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #12 on: January 04, 2012, 12:16:08 am »
Hi ingo,

I found another error. In the code that got entered into hDefines.php look for the following line


return osc_base_url() . 'item/activate/' $id ;

change it like so

return osc_base_url() . 'item/deactivate/' $id ;



Try it like above I am currently unable to test if that fixed the problem as my permalinks are not working right at the moment.

Jay

ingo

  • Full Member
  • ***
  • Posts: 216
Re: Item Expiration
« Reply #13 on: January 04, 2012, 12:35:48 am »
unfortunately does not work

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: Item Expiration
« Reply #14 on: January 04, 2012, 12:37:50 am »
I got my permalinks working and I found out that we need to add another rewrite rule to the generate_rules.php and then it works just fine with permalinks.

Add the following code on line 53 of the generate_rules.php file.

$rewrite
->addRule('^item/deactivate/([0-9]+)/?$''index.php?page=item&action=deactivate&id=$1');


You may have to disable and re enable your permalinks for the change to take place.

Jay