Advertisement:

Author Topic: Publish Button redirect to the actual ad  (Read 674 times)

AdsGig

  • Jr. Member
  • **
  • Posts: 72
Publish Button redirect to the actual ad
« on: November 01, 2014, 04:27:23 am »
hi all,
   how can we achieve this?

   What i want to do is after publishing the ad,  instead of showing the category list
   i need to show the latest ad of the user itself.   

mahesh

  • Full Member
  • ***
  • Posts: 116
Re: Publish Button redirect to the actual ad
« Reply #1 on: November 01, 2014, 01:50:47 pm »
Hi Mr.AdsGig

Edit the file oc-includes/osclass/controller/item.php

Go to case 'item_add_post':   at the bottom of this case statement .you'll find the following code
Code: [Select]
$category = Category::newInstance()->findByPrimaryKey(Params::getParam('catId'));
View::newInstance()->_exportVariableToView('category', $category);
 $this->redirectTo(osc_search_category_url());

Comment the above code and add the following code
Code: [Select]
$item = osc_apply_filter('pre_show_item', Item::newInstance()->findByPrimaryKey( $itemId  ));
View::newInstance()->_exportVariableToView('item', $item);
$this->redirectTo(osc_item_url());

Then it'll redirect to the latest posted ad by user after publishing.

AdsGig

  • Jr. Member
  • **
  • Posts: 72
Re: Publish Button redirect to the actual ad
« Reply #2 on: November 01, 2014, 04:05:27 pm »
hats off for you.  AS IN THANKS A LOT :)

just asking what php framework did osclass use?

s51

  • Sr. Member
  • ****
  • Posts: 309
Re: Publish Button redirect to the actual ad
« Reply #3 on: November 01, 2014, 07:57:58 pm »
.
@mahesh

THANK,s  for your snippet
Thats the proper way to end a ad outlay on.  8)
- -

Regards:  s51
.