Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Firering an autoaction for one particular plan only

  • OldLodgeSkins
  • OldLodgeSkins
  • OFFLINE
  • Posts: 119
  • Thanks: 5
  • Karma: 2
  • Add-ons
10 years 10 months ago #238540 by OldLodgeSkins
Hi,

I'm trying to find a way to have an image generated with PHP / GD when my subscribers buy an extra item. The PHP part is the easy bit I already have it working in another autoaction with a different trigger.

So here I want this one to fire only when they buy the item. I have a plan set up as a merchandise accessible only to already existing members (so, people who have already subscribed to one of the main plans).
I'm guessing the right trigger would be onCbSubsAfterPaymentBasket is that correct?
Then I need a condition to verify this is the right plan and that's where I'm hesitating. Is there something like [planid] equal to xxx that I could use?

Thanks.

Seb.

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

  • OldLodgeSkins
  • OldLodgeSkins
  • OFFLINE
  • Posts: 119
  • Thanks: 5
  • Karma: 2
  • Add-ons
10 years 10 months ago #238542 by OldLodgeSkins
Replied by OldLodgeSkins on topic Firering an autoaction for one particular plan only
Correction, I'm now using my original action to generate the picture...
I now only need it copied somewhere else when someone orders the item, but this probably changes nothing as I'd still need a PHP action in that case I guess.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 10 months ago #238556 by krileon
Please see my below reply to one of your other topics regarding firing an action on a specific plan.

www.joomlapolis.com/forum/153-professional-member-support/223738-solved-family-subscriptions-with-cbsubs-and-autoactions#238034

You'll need to use a Code action with PHP method to generate the image.


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.

  • OldLodgeSkins
  • OldLodgeSkins
  • OFFLINE
  • Posts: 119
  • Thanks: 5
  • Karma: 2
  • Add-ons
10 years 10 months ago - 10 years 10 months ago #238558 by OldLodgeSkins
Replied by OldLodgeSkins on topic Firering an autoaction for one particular plan only
Ah... True, you've talked about this before!
Thanks!
Last edit: 10 years 10 months ago by OldLodgeSkins.

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

  • OldLodgeSkins
  • OldLodgeSkins
  • OFFLINE
  • Posts: 119
  • Thanks: 5
  • Karma: 2
  • Add-ons
10 years 10 months ago #238736 by OldLodgeSkins
Replied by OldLodgeSkins on topic Firering an autoaction for one particular plan only
Hi again,

I don't want to clutter the forum with one more topic for something that's more or less the same topic in fact...

It seems I can't, as a subscriber, order the merchandise item I have created - I get a fatal error, see the log below, maybe you'll see what I've done wrong. I'm suspecting I made a mistake in my other plans that prevent the purchase of an item... Your opinion?
The plans are set to not allow any kind of upgrade because there will be none, you pick a plan and that's it. However there is one physical item that can be ordered once you are a subscriber. That's the idea at least. The item is set to "allow upgrade to this: YES".

Thanks.
Code:
USER ERROR: Merchandise::createOrLoadReplacementSubscription: replace subscription not possible: id: 87 in /home/scoopcod/public_html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/models/something/cbpaidNonRecurringSomething.php on line 100 Trace:called in class cbpaidErrorHandler::_error_handler_callable(256, "Merchandise::createOrLoadReplacementSubscription: replace subscription not possible: id: 87", "/home/scoopcod/public_html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/models/something/cbpaidNonRecurringSomething.php", 100, array("user" => object(moscomprofilerUser), "plan" => object(cbpaidProductMerchandise), "replacesSubscriptionId" => array(0 => 2, 1 => 87), "existingSubscriptionId" => NULL, "status" => "R", "store" => true, "subscriptionTime" => 1387642379, "reason" => "U", "parentSubId" => NULL, "_CB_database" => object(CBdatabase))) called in function trigger_error("Merchandise::createOrLoadReplacementSubscription: replace subscription not possible: id: 87", 256) on line 100 in file cbpaidNonRecurringSomething.php called in class cbpaidNonRecurringSomething::createOrLoadReplacementSubscription(object(moscomprofilerUser), object(cbpaidProductMerchandise), array(0 => 2, 1 => 87), NULL, "R", true, 1387642379, "U", NULL) on line 447 in file cbpaidProduct.php called in class cbpaidProduct::createProductThing(object(moscomprofilerUser), array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa"), "U", "R", array(0 => 2, 1 => 87), NULL, 1387642379, false, false, NULL) on line 158 in file cbpaidControllerOrder.php called in class cbpaidControllerOrder::createSubscriptionsAndPayment(object(moscomprofilerUser), array(5 => object(cbpaidProductMerchandise)), array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa"), array(5 => array(0 => 2, 1 => 87)), NULL, "R", "Upgrade", "U") on line 245 in file cbpaidControllerCBTab.php called in class cbpaidControllerCBTab::getTabComponent(NULL, object(moscomprofilerUser), 1, array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa")) on line 1087 in file cbpaidsubscriptions.php called in class getcbpaidsubscriptionsTab::getTabComponent(NULL, object(moscomprofilerUser), 1, array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa")) on line 81 in file cbpaidControllerCBComponent.php called in class CBplug_cbpaidsubscriptions::getCBpluginComponent(NULL, object(moscomprofilerUser), 1, array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa")) called in function call_user_func_array(array(0 => object(CBplug_cbpaidsubscriptions), 1 => "getCBpluginComponent"), array(0 => NULL, 1 => object(moscomprofilerUser), 2 => 1, 3 => array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa"))) on line 583 in file plugin.class.php called in class cbPluginHandler::call("520", "getCBpluginComponent", "CBplug_cbpaidsubscriptions", array(0 => NULL, 1 => object(moscomprofilerUser), 2 => 1, 3 => array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa")), NULL) on line 4187 in file comprofiler.class.php called in class cbTabs::_callTabPlugin(NULL, object(moscomprofilerUser), "CBplug_cbpaidsubscriptions", "getCBpluginComponent", "520", array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa")) on line 4274 in file comprofiler.class.php called in class cbTabs::tabClassPluginTabs(object(moscomprofilerUser), array("cbpplanE" => array(0 => array("selected" => array(0 => "5"))), "cbponlyplans" => "5", "cbpsubscriptionid" => array(5 => "2,87"), "cbpcbregUpgrade" => "Buy", "user" => "408", "cbpact" => "upgrade", "cbsecuritym3" => "cbm_4db12b5f_0c0de627_ee89d5e5efb030b4651157da9e6d16fa"), "cbpaidsubscriptions", "CBplug_cbpaidsubscriptions", "getCBpluginComponent") on line 780 in file comprofiler.php called in function tabClass("com_comprofiler", "pluginclass", 408) on line 275 in file comprofiler.php called in function require_once("/home/scoopcod/public_html/components/com_comprofiler/comprofiler.php") on line 351 in file helper.php called in class JComponentHelper::executeComponent("/home/scoopcod/public_html/components/com_comprofiler/comprofiler.php") on line 331 in file helper.php called in class JComponentHelper::renderComponent("com_comprofiler") on line 178 in file site.php called in class JApplicationSite::dispatch() on line 208 in file site.php called in class JApplicationSite::doExecute() on line 255 in file cms.php called in class JApplicationCms::execute() on line 40 in file index.php

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

  • OldLodgeSkins
  • OldLodgeSkins
  • OFFLINE
  • Posts: 119
  • Thanks: 5
  • Karma: 2
  • Add-ons
10 years 10 months ago - 10 years 10 months ago #238738 by OldLodgeSkins
Replied by OldLodgeSkins on topic Firering an autoaction for one particular plan only
Wait a minute... I think there is somewhere a setting that says you can / can't have more than one subscription active... Could that be it? I can't remember where it is right now but I'll find it...

Edit: found it ("exclusive") and that was the reason of that error.
You can ignore my question, but thanks anyway :)
Last edit: 10 years 10 months ago by OldLodgeSkins.
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