Skip to Content Skip to Menu

[SOLVED] Coupons use case question.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 4 months ago #294931 by liaskas
Replied by liaskas on topic Coupons use case question.
CB Privacy it self is public and published. Everything is up to date.

Please Log in or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 4 months ago #294943 by liaskas
Replied by liaskas on topic Coupons use case question.
Any other ideas?

Please Log in or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 4 months ago #294945 by liaskas
Replied by liaskas on topic Coupons use case question.
News that might be helpful about this situation.

2 different plugins

a) cb_invites tab
privacy works pretty fine here. Each member can see his own invites!

b) cb_coupon field that shows alone in a new created tab named "coupons"
privacy does not work! Each member can see all created coupons from everyone.

Both tabs have exactly the same privacy settings!

So... this problem can not be related to privacy plugin. There must be something wrong with with the cb_coupons field, or the plan, or something.

I remind you that everything has been created according to the following tutorial...

www.joomlapolis.com/documentation/283-cb-paid-subscriptions/tutorials/18407-purchasing-discount-coupons

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48448
  • Thanks: 8280
  • Karma: 1443
7 years 4 months ago #294970 by krileon
Replied by krileon on topic Coupons use case question.
I don't think your issue has anything to do with CB Privacy. Your cb_coupon field is a query field that's querying for those coupon codes. The query you're using likely is not specific to the user. If you review the tutorial carefully you'll see that 172474 is the example user id. You need to adjust it to make that dynamic. Should just be a matter of replacing 172474 with [user_id]. That tutorial is an extremely rough usecase. We don't officially have a means of generating coupons for users and it's just utilizing direct database queries to do so.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 4 months ago - 7 years 4 months ago #294980 by liaskas
Replied by liaskas on topic Coupons use case question.
Yes... changing to [user_id] / [username] fixes the issue of creating the record with the right user_id in the #__cbsubs_promotions table.

Now i guess there is also a miss in the query field that is also created according to the tutorial. For some reason (just a guess...) the query field is not getting the user_id of the member that created the coupon, and this is why it still shows all the promotion coupons that exist in the database to everyone.

Here is the query field provided from the tutorial...
SELECT p.`coupon_code`, p.`max_uses_total`, ( SELECT COUNT(*) FROM `#__cbsubs_promotions_uses` AS c WHERE c.`promotion_id` = p.`id` ) AS count, ( SELECT group_concat(d.`user_id` separator ', ') FROM `#__cbsubs_promotions_uses` AS d WHERE d.`promotion_id` = p.`id` ) AS idlist FROM `#__cbsubs_promotions` AS p WHERE p.`coupon_code` REGEXP '^48706-'

Can you please advise?

Thank you.

Ok i got it!

Thank you for your help. I did put the user-id in the created coupon code and changed the last part of the above selection to WHERE p.`coupon_code` REGEXP '^[user_id]-'

Now everything is working fine. Thank you again.
Last edit: 7 years 4 months ago by liaskas. Reason: Please mark this as solved. Thank you!
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum