Osclass forums
Support forums => General help => 3.8.x => Topic started by: MGD4me on July 29, 2019, 08:27:43 pm
-
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.
-
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.
-
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(
<?php
$aCategories = Category::newInstance()->hierarchy( osc_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
?>
-
The alerts are stored as json if I remember right.