Advertisement:

Author Topic: How to change Alert1, Alert2, etc to show Category name instead?  (Read 82 times)

MGD4me

  • Newbie
  • *
  • Posts: 15
Using ver 3.80 and Bender theme.

I've searched the forums to find a solution, but couldn't find a definitive answer:  Instead of simply displaying a users Alert subscriptions as "Alert1", "Alert2", etc, I would like the actual Category name be displayed, like "For Sale", or "Looking to Buy".

Has someone found a way to do this ??

Thanks.

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to change Alert1, Alert2, etc to show Category name instead?
« Reply #1 on: July 29, 2019, 10:25:28 pm »
In a very difficult manner:) Just joking.
They made it like that in order to use a plugin (I can't remember if it's free or paid).

Also if a user unsubscribes from an alert, the alert is not deleted from db if I remember right.

You can search in my posts some solutions regarding deleting the unsubscribed alerts like

https://forums.osclass.org/development/alerts-in-admin/msg149604/#msg149604

I solved this problem with core modifications and some php logic.
« Last Edit: July 31, 2019, 10:37:16 pm by marius-ciclistu »

MGD4me

  • Newbie
  • *
  • Posts: 15
Re: How to change Alert1, Alert2, etc to show Category name instead?
« Reply #2 on: July 31, 2019, 09:27:15 pm »
There is a lot more to this program behind the scenes going on, which makes it tricky to "reverse engineer".

However, I am using this piece of code in 'item.php' to include the Parent Category in a listing, and it works really well (for me). However, when I try to use it in 'user-alerts.php' the value returned to $cat is always blank.

I can't figure out why it retrieves the Parent Category in one instance, and not in the second.  :o(

Code: [Select]
<?php
$aCategories Category::newInstance()->hierarchyosc_item_category_id() );
$cat '<a href="' osc_search_url(array('sCategory' => $aCategories[0]['fk_i_parent_id'])). '">' $aCategories[1]['s_name'] . '</a> : ';

echo $cat;  // displays correctly in item.php, but nothing in user-alerts.php
?>


marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to change Alert1, Alert2, etc to show Category name instead?
« Reply #3 on: July 31, 2019, 10:38:34 pm »
The alerts are stored as json if I remember right.