niyo Posted September 22, 2020 Report Posted September 22, 2020 Hi, not sure if anyone can help me with this but i'm trying to echo ($package_group->description) in a service management tab but can't quite figure out the syntax. If anybody could educate me on how to do that it would be greatly appreciated. Thanks Quote
0 Jono Posted September 23, 2020 Report Posted September 23, 2020 Technically that looks like it would work. That being said it would usually look something like this in Blesta: <p><?php echo $this->Html->ifSet($package_group->description);?><p> This does of course assume that $package_group was fetched in the controller and passed to the view. Quote
0 niyo Posted September 28, 2020 Author Report Posted September 28, 2020 On 9/23/2020 at 5:10 PM, Jono said: This does of course assume that $package_group was fetched in the controller and passed to the view. Hi Jono, thanks for your response. I guess that's where I'm going wrong. How would I fetch $package_group and pass it to the view? Quote
0 Jono Posted September 28, 2020 Report Posted September 28, 2020 Are you sure the package group is what you're looking for? Each service is assigned to a package. That package has a description. That package may be assigned to any number of package groups. To access the $package in the view you would add this to the controller: $this->view->set('package', $package); To display the package description you would do: <p><?php echo $this->Html->ifSet($package->description);?><p> To display the package group descriptions you could do something like: <?php foreach ($this->Html->ifSet($package->groups, []) as $package_group) ?> <p><?php echo $this->Html->ifSet($package_group->description);?><p> <?php } ?> Quote
0 niyo Posted September 29, 2020 Author Report Posted September 29, 2020 Hi Jono, thanks for your help. It is definitely package group description i was after as i'm using the group as a product and the packages as tiers for that product. your solution only half worked since the module controller was already setting $this->view->set("package", $package->meta ); and it seemed i could only get one or the other working and not both. I'l just have to find a developer to implement it for me since it seems it should be sufficiently straight forward for someone in the know. Hopefully @Blesta Addons reappears soon so i can hire him since he seems to have disappeared off the face of the earth. Thanks again for your help ?? Jono and Blesta Addons 2 Quote
0 Jono Posted September 29, 2020 Report Posted September 29, 2020 You really don't need $this->view->set("package", $package->meta ); Since you can access the package meta from the view if you use: $this->view->set('package', $package); That first 'package' parameter determines the variable name in the view so if you have two $this->view->set('package', ....); statements then they would conflict. Quote
0 Blesta Addons Posted September 29, 2020 Report Posted September 29, 2020 i think @Jono has replied to your request, but if you still need help, we can help you. Quote
0 niyo Posted September 30, 2020 Author Report Posted September 30, 2020 On 9/29/2020 at 4:25 PM, Jono said: Since you can access the package meta from the view if you use: Thanks jono, you're right, i got it working. i used $this->view->set('package', $package); in the controller and removed $package->meta like you stated. i then edited the pdt which was originally echo $this->Html->ifSet($package->someMeta) ; and changed it to echo $this->Html->ifSet($package->meta->someMeta) ; Appreciate your help. ?? On 9/29/2020 at 7:25 PM, Blesta Addons said: i think @Jono has replied to your request, but if you still need help, we can help you. @Blesta Addons I tried opening a ticket on your site but your ticket system doesn't work. i then sent you a private message on here but didn't hear back for 2 weeks. what's the best way to contact you? Quote
0 Blesta Addons Posted September 30, 2020 Report Posted September 30, 2020 1 hour ago, niyo said: @Blesta Addons I tried opening a ticket on your site but your ticket system doesn't work. i then sent you a private message on here but didn't hear back for 2 weeks. what's the best way to contact you? almost of time i log from mobile, so didn't care about PM or i miss them, our ticket system ork and we have ticket and we reply to them. are you opening ticket from your account or via email? Quote
0 niyo Posted October 16, 2020 Author Report Posted October 16, 2020 On 9/28/2020 at 6:22 PM, Jono said: Are you sure the package group is what you're looking for? @Jono one last thing on the matter. i'm trying to get the Package Group Name in the email template for the package but at a loss. it's not really clear in the Package Welcome Email section of the docs. Can you assist me with the appropriate tag to use to get the name of the package group to be displayed in the emails. thanks. Quote
0 Jono Posted October 16, 2020 Report Posted October 16, 2020 https://docs.blesta.com/display/user/Customizing+Emails I believe something like this would work {% for $package_group in package.groups %} Name: {package_group.name} {% endfor %} Quote
0 niyo Posted October 16, 2020 Author Report Posted October 16, 2020 1 hour ago, Jono said: https://docs.blesta.com/display/user/Customizing+Emails I believe something like this would work {% for $package_group in package.groups %} Name: {package_group.name} {% endfor %} definition of a living legend. thanks ?? Jono 1 Quote
Question
niyo
Hi, not sure if anyone can help me with this but i'm trying to echo ($package_group->description) in a service management tab but can't quite figure out the syntax.
If anybody could educate me on how to do that it would be greatly appreciated.
Thanks
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.