Search

Hello dear developers.

I`m working on social projects, and what i want to asking you about.

I have 2 Sections:

User: Username (string) ........ Favorite Products (Bi-Link Field with allow selecting multiple) -> Product: Users favorite

Product: Title (string) ......... Users favorite (Bi-Link Field with allow selecting multiple) -> User: Favorite Products

When user want to add to favorite some product, he sends ajax request, theese params:

fields[users-favorite]: 1,34,66,12...ids of products. action[user-favorite]

This is not elegant method. I find bug with this, when i open several pages with other products in many tabs, and add to favorite each other. Finally submit that products from the last tab.

What method i can use for more elegantly solve this issue?

I would suggest a third section "Favourite Products" which has just two select box link fields, one to Users and one to Products. To favourite a project, add a new entry to this section. To get all user's favourites, filter this section by user.

And how to REMOVE from favorite?

I use this method bellow i upgrade to sym 2.2.x

Either a custom event to delete an entry, or include an "Active" checkbox in the Favourite Products section which you can set to yes/no depending on whether it's deleted or not.

'Active' checkbox is too massive for many users and products.

Better choice is to remove entry via custom Event.

sorry about offtop, but example in this thread is obsolete in symphony 2.2, i use it before.

Do you now a good example to remove entries via event, and Members beta extensions. May be role permissions in that extensions solve the problem with security at all?

but example in this thread is obsolete in symphony 2.2, i use it before

What about it is obsolete? The code should still work.

Do you now a good example to remove entries via event, and Members beta extensions

No. I haven't really used Members since it is still in beta.

Try replacing $this->_Parent with Symphony::Engine().

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details