Jump to content

Tyson

Blesta Developers
  • Posts

    3,638
  • Joined

  • Last visited

  • Days Won

    241

Reputation Activity

  1. Like
    Tyson got a reaction from Amit Kumar Mishra in How to achieve multiple billing for the same product   
    It's not currently possible to have 2 different billing dates using pro rata. New settings would have to be added and you would have to configure 2 days-of-the-month to bill to (1st and 15th) with the largest one overriding the smaller one based on the bill date.
  2. Like
    Tyson got a reaction from Tjw in Custom Client Fields Value In The Invoice   
    It depends where you want to place the value in the PDF, but consider this example which places it below the "Due Date" field:
     
    Update /components/invoice_templates/default_invoice/default_invoice_pdf.php (line 402):
    private function drawInvoiceInfo() { $data = array( array( 'name'=>Language::_("DefaultInvoice.invoice_id_code", true), 'space'=>null, 'value'=>$this->invoice->id_code ), array( 'name'=>Language::_("DefaultInvoice.client_id_code", true), 'space'=>null, 'value'=>$this->invoice->client->id_code ), array( 'name'=>Language::_("DefaultInvoice.date_billed", true), 'space'=>null, 'value'=>date($this->invoice->client->settings['date_format'], strtotime($this->invoice->date_billed)) ), array( 'name'=>Language::_("DefaultInvoice.date_due", true), 'space'=>null, 'value'=>date($this->invoice->client->settings['date_format'], strtotime($this->invoice->date_due)) ) );  
    to
    private function drawInvoiceInfo() { $cf_data = array(); if (property_exists($this->invoice->client, "id")) { Loader::loadModels($this, array("Clients")); $field_id = 6; $values = $this->Clients->getCustomFieldValues($this->invoice->client->id); foreach ($values as $value) { if ($value->id == $field_id) { $cf_data = array( 'name' => $value->name . ":", 'space' => null, 'value' => $value->value ); break; } } unset($values, $value); } $data = array( array( 'name'=>Language::_("DefaultInvoice.invoice_id_code", true), 'space'=>null, 'value'=>$this->invoice->id_code ), array( 'name'=>Language::_("DefaultInvoice.client_id_code", true), 'space'=>null, 'value'=>$this->invoice->client->id_code ), array( 'name'=>Language::_("DefaultInvoice.date_billed", true), 'space'=>null, 'value'=>date($this->invoice->client->settings['date_format'], strtotime($this->invoice->date_billed)) ), array( 'name'=>Language::_("DefaultInvoice.date_due", true), 'space'=>null, 'value'=>date($this->invoice->client->settings['date_format'], strtotime($this->invoice->date_due)) ) ); if (!empty($cf_data)) $data[] = $cf_data;  
    You need to update line 407 to set the integer to the correct custom field ID for your custom field. For example, if you go to edit the custom field in Blesta, the integer value will you're looking for appears at the end of the URL.
     
    Note that this is a core file in Blesta, and future patches/updates from us may overwrite this file, and you will need to merge these changes with any subsequent update accordingly.
  3. Thanks
    Tyson got a reaction from jd39 in Customer User/Password Validation Via API   
    $data = [ 'username' => "username", 'vars' => [ 'username' => "username", 'password' => "password" ], 'type' => "any" ]; $response = $api->get("users", "auth", $data, "any"); The parameter names are the keys to the array you pass as $data.
  4. Like
    Tyson got a reaction from IOS Webmaster in Package Pricing Display...   
    It's possible, but it's not natively supported. It would require you to make core changes, which will be overridden during upgrades. You would need to maintain the changes in your installation.
     
    Amounts are displayed in several places across the admin/client interfaces, but for brevity I'll give an example of one place on the Wizard order form. The other order forms (i.e. Standard/AJAX) would need to be updated similarly.
     
    This example will change the price display on the Wizard order form's drop-down menu for Term and Price. This will show prices using the per-month price rather than the price for all months combined.
     
     
    Open /plugins/order/views/templates/wizard/config.pdt
    Find (line 37):
    $prices[$price->id] = $this->_("Config.index.package_price", true, $period, $this->CurrencyFormat->format($price->price, $price->currency)); Replace with:
    $amount = $price->price; if ($price->period == "month" && $price->term > 0) $amount = ($price->price/$price->term); $prices[$price->id] = $this->_("Config.index.package_price", true, $period, $this->CurrencyFormat->format($amount, $price->currency));
  5. Like
    Tyson got a reaction from IOS Webmaster in Package Pricing Display...   
    The "Starting At" price is from the /plugins/order/views/templates/wizard/main_packages.pdt template. It currently shows the lowest numeric price, however, it would require several changes to show the lowest price per month. It becomes more complex if you have non-monthly terms in the mix as well.
     
    As an example, I will only show changes for the Wizard Boxes template, and ignore non-monthly terms for simplicity.
    Find:
    foreach ($package->pricing as $price) { if ($lowest_price === null || $lowest_price->price > $price->price) $lowest_price = $price; } Replace with:
    $lowest_monthly_price = null; $lowest_monthly_currency = null; foreach ($package->pricing as $price) { if ($lowest_price === null) { $lowest_price = $price; } if ($price->period == "month" && $lowest_price->period == "month" && $price->term > 0 && $lowest_price->term > 0 && ($price->price/$price->term) < ($lowest_price->price/$lowest_price->term)) { $lowest_monthly_price = ($price->price/$price->term);                 $lowest_monthly_currency = $price->currency; } } Find:
    <div class="package panel-blesta <?php echo ($this->Html->ifSet($package_id) == $package->id ? "selected" : "");?>" data-group-id="<?php $this->Html->_($package_group->id);?>" data-pricing-id="<?php $this->Html->_($lowest_price->id);?>"> Replace with:
    <div class="package panel-blesta <?php echo ($this->Html->ifSet($package_id) == $package->id ? "selected" : "");?>" data-group-id="<?php $this->Html->_($package_group->id);?>" data-pricing-id="<?php echo $this->Html->safe($this->Html->ifSet($lowest_monthly_id, $lowest_price->id));?>"> Find:
    <h4><?php echo $this->CurrencyFormat->format($this->Html->ifSet($lowest_price->price), $this->Html->ifSet($lowest_price->currency));?></h4> Replace with:
    <h4><?php echo $this->CurrencyFormat->format($this->Html->ifSet($lowest_monthly_price, $lowest_price->price), $this->Html->ifSet($lowest_monthly_currency, $lowest_price->currency));?><?php echo ($lowest_monthly_price !== null) ? "/month" : "";?></h4>
  6. Thanks
    Tyson got a reaction from Colin in 4.2.2 Nginx Installation   
    The equivalent of the change you mentioned would be to update /core/ServiceProviders/MinphpBridge.php and change:
    $htaccess = file_exists($rootWebDir . '.htaccess'); to
    $htaccess = true; That said, I have not tested this with Nginx and am not sure whether this will work for you.
  7. Like
    Tyson reacted to Jstuts5797 in Any way to have a order form with "Hierarchy"?   
    Perfect! This is exactly what I was looking for and needed. This will for sure work for my use case I believe! ?
  8. Like
    Tyson got a reaction from Jstuts5797 in Any way to have a order form with "Hierarchy"?   
    It sounds like the hierarchy you would want is a package group of package groups. However, packages groups cannot nest each other in Blesta. You could only have one level of nesting, which is the package group and the packages inside that group.
    With that said, you can accomplish the behavior from your example (i.e. 1 level of nesting) using the way some templates display package groups on the order form.
    For example:
    Create an order form Choose the template "Wizard Boxes". You could also use "Wizard Slider", or the respective AJAX equivalents. Assign 3 package groups to the order form: "Beginner" "Intermediate" "Advanced" Each of those package groups should have multiple packages assigned to them, respectively, so the customer can choose the package they want to order from that group. Visit the order form (e.g. /order/main/index/orderformname) You will have 3 package groups to choose from: "Beginner", "Intermediate", and "Advanced" Once you choose one, you will then see a list of all packages you can order from that group I think that will be the closest native support for your use case.
  9. Like
    Tyson reacted to Jake in API credentials are invalid   
    Ok...That was a painful lesson.  It turns out that that apache was running php as CGI/FastCGI.  In order to make this work you will need to add the following to the .htaccess file
     
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 Works great now.
  10. Like
    Tyson reacted to Jstuts5797 in Newbie - I am completely lost   
    I tried to reach out but haven't gotten a response yet. I know its gotta be crazy with support right now because pretty much everyone is constantly on the internet right now for work, lol. I WAS able to fix it myself so I'm writing this here in case anyone else runs into this issue they can find an answer. What I did was after uninstalling Blesta CMS I had to also then COMPLETELY uninstall and remove the Blesta Portal plugin... then reinstall and reactivate it... and it returned things back to normal. Thanks so much Tyson for all your help!
  11. Like
    Tyson got a reaction from Jstuts5797 in Newbie - I am completely lost   
    I'm glad that helped!
    Some third-party plugins, unfortunately, do not adequately uninstall everything they added when they are installed. It sounds like the BlestaCMS plugin may fail to uninstall everything it should since it has caused you issues. Perhaps @Blesta.Store can take a look at resolving those issues in newer versions of his plugin.
  12. Like
    Tyson reacted to armandorg in Lowendhost - Free Modern Hosting Template   
    Lowendhost - Official discussion thread as requested by the marketplace 
    Link to download
     
    About
    It's a completely free HTML/PHP hosting template, now integrated with Blesta. It comes in 3 colors and is fully integrated with Blesta in all 3 colors. 
    It has these pages: Homepage, Web Hosting, VPS, Dedicated, Game Servers and Terms of Service. It's extreemly easy to edit with basic HTML knowledge.
     
    Live preview of HTML version:
    Green Version Preview
    Blue Version Preview
    Red Version Preview
     
    It's developed & designed by our web design firm.
     
    If you have any question or issue, we might help! Reply here don't PM.
     
    Thanks!



  13. Like
    Tyson reacted to Jstuts5797 in Newbie - I am completely lost   
    This helps a TON! Thank you so much! Looks like I will need to reinstall and re-setup blesta now so that 1.) I have it in a subdomain and 2.) I can undo whatever BlestaCMS did because even after uninstallint BlestaCMS It's still hijacked my blesta front page somehow.  Thank you SO much though! These were some answers that I needed!
  14. Like
    Tyson got a reaction from Jstuts5797 in Newbie - I am completely lost   
    Blesta uses the Portal/CMS plugin to create a landing page where clients can go to access their account, the order form, or the support system, etc. You are using the BlestaCMS plugin, which I am not familiar with, but it most-likely overrides the default Blesta Portal plugin. AFAIK you can create additional front-end pages with the BlestaCMS plugin though. You may want to ask @Blesta.Store for some help with that setup.
    As for Blesta, it is not meant to replace your website, although you could use it that way, such as through a plugin like BlestaCMS. Any integration with Wordpress or another third-party platform will likely require modifications to the code to get it integrated into your particular site. There are some threads on the forums that describe how to do that if you're interested. However, Blesta is usually used on a subdomain or in a sub-directory of your website. If your website is at "domain.com", you might install Blesta at "domain.com/billing/". You can then update links on your website to go to "/billing/" to access Blesta-related content like the Order system at "/billing/order/" or client login at "/billing/client/login/".
    Regarding packages in Blesta appearing on an Order form, this is something you can configure after you create your package in Blesta. Under "Packages > Order Forms" you can create a new order form and assign any packages you want to sell through it from the list of packages you have already created in Blesta. A link will be shown to access that order form directly. However, you can also set a default order form under "Packages > Order Forms > (Settings) tab". The default order form will be shown when accessing "/order/" in your browser. I hope that helps.
  15. Like
    Tyson reacted to Hosting Hangar in Can't add Centovacast Server   
    I am trying to add a CentovaCast server but I keep getting the error: A connection to the server could not be established. Please check to ensure that the Hostname, Username, Port and Password are correct. All the details are correct and I can see activity in CentovaCast's logs. All the ports are open and I am using version 3.2.12.20191116.stable-529r4205 of Centovacast, version 1.5.0 of the CentovaCast module with Blesta 4.8.1
    I have noticed that if I use a wrong password I'll get a slightly different error of: Invalid username or password A connection to the server could not be established. Please check to ensure that the Hostname, Username, Port and Password are correct. So I know it can connect and it can authenticate properly.
    If you need more info let me know and I'll see what I can find.
     
    Edit: I managed to get it to work. For some reason I had to create an account over on Centova cast then I tried adding it to Blesta again and it worked.
  16. Like
    Tyson reacted to Michael in BlestaCMS is now open-code!   
    Thank you I've removed it from the github version.
  17. Like
    Tyson got a reaction from Michael in BlestaCMS is now open-code!   
    Looks to me like the plugin itself is causing an error and therefore cannot be displayed by Blesta. You may notice this in your error logs as "Undefined offset 0".
    It appears to be a bit of the chicken and the egg problem. The plugin tries to assign a database record of itself to the variable "$this->plugin" before it's installed, but it could only work after it's installed.
    You may be able to workaround the issue by commenting out the line in the constructor:
    list($this->plugin) = $this->PluginManager->getByDir('blesta_cms'); //list($this->plugin) = $this->PluginManager->getByDir('blesta_cms'); I haven't tested this, but it may work for you. The plugin author should fix the error.
  18. Like
    Tyson got a reaction from Bloory in Cannot add namecheap   
    When you save the credentials, the system tries to test the API by checking that the 'namecheap.com' domain exists by POSTing an API request to Namecheap with your credentials. However, Namecheap did not return an 'OK' response, or the system could not interpret the response. The module requires the libxml php extension to be enabled on the server, so you may want to double-check that it is.
  19. Like
    Tyson got a reaction from Jstuts5797 in Replacement for mcrypt?   
    Also see discussion of this @
     
  20. Like
    Tyson got a reaction from SLIBINAS in BlestaCMS is now open-code!   
    Looks to me like the plugin itself is causing an error and therefore cannot be displayed by Blesta. You may notice this in your error logs as "Undefined offset 0".
    It appears to be a bit of the chicken and the egg problem. The plugin tries to assign a database record of itself to the variable "$this->plugin" before it's installed, but it could only work after it's installed.
    You may be able to workaround the issue by commenting out the line in the constructor:
    list($this->plugin) = $this->PluginManager->getByDir('blesta_cms'); //list($this->plugin) = $this->PluginManager->getByDir('blesta_cms'); I haven't tested this, but it may work for you. The plugin author should fix the error.
  21. Like
    Tyson reacted to MDHMatt in error adding product to basket cpanel module   
    Thank you! this has fixed it.
  22. Like
    Tyson got a reaction from Gabriel Gutierrez in Creating Staff user limited to Client Groups   
    To add to what Jono said, the permission system is generalized to entire resources (e.g. /clients/). If you give staff access to clients, they can see all clients. There is currently no mechanism to limit staff to access only certain clients based on some criteria. However, if you create a plugin, you can setup plugin events that listen for an event like the AppController.preAction event that is called when someone views a page, and your plugin can perform logic to determine whether this is a staff user and whether they are viewing an appropriate client they have access to or not, and redirect them elsewhere if necessary.
  23. Like
    Tyson got a reaction from sedudohost in versions 4.8 and 4.8.1 the centos webpanel module did not work   
    It looks like the API for your module is not responding appropriately. First, it's returning HTML, and second, it's sharing an error and stacktrace because something is wrong with the CWP server. This issue isn't caused by Blesta, but by the server it's attempting to connect to. You should look into that CWP server and resolve the error that's mentioned because it's not running correctly.
    Type: ErrorException Code: 8 Message: Trying to get property of non-object File: /usr/local/cwpsrv/var/services/api/v1/index.php Trace #0 /usr/local/cwpsrv/var/services/api/v1/index.php(0): Slim\Slim::handleErrors(8, 'Trying to get p...', '/usr/local/cwps...', 0, Array) ...  
  24. Thanks
    Tyson got a reaction from sedudohost in versions 4.8 and 4.8.1 the centos webpanel module did not work   
    The error indicates it is missing the port field on the module row object. This port field should be set on the module row when you save it. From your screenshot, that is the "API Port" field.
    However, you get an error about the connection failing to be established. Can you check your module logs to see if there is an entry that begins with "<yourdomain>|validate_connection/packages_get"? That log should contain some information on the API request that failed to validate the connection. This is the reason for the port error as well. The port is not being set on the module row because you cannot successfully save the updated module row information. Once the connection issue is resolved the port error will go away.
  25. Thanks
    Tyson got a reaction from domaingood in Install Mailparse on PHP 7.3 and 7.4 The mailparse extension does not yet support PHP 7.3 or 7.4.   
    It looks like it's available here, and the changelog says it is compatible with php 7.3. I can't comment on php 7.4 as it was released not very long ago and we haven't yet checked compatibility with Blesta.
×
×
  • Create New...