PrintInvoice global variable - BigCommerce - bigcommerce

I have the following case:
I'm trying to edit the PrintInvoice.html after downloading it through WebDav. The template was previously edited by another developer, but using the Template Files directly in the Storefront back when the files were visible in the Storefront. When opening the HTML template, the wording that I need to change is inside the global variable %%GLOBAL_ProductsTable%% so I'm not sure how to reach the text content inside. Replacing the global variable with custom HTML is not desirable.
Any suggestions are appreciated!

As others have stated, these global variables are saved within BC's back-end database which you do not have access to.
A workaround my team and I have done to edit the contents of these global variables is to use JavaScript at the bottom of the document that changes the desired text after it is loaded. This seems to be the only way we could find to edit those values.

Global variables like this are provided by the BigCommerce app, it is how the product data is sent through your store to email and can't be modified. To change the product table's appearance, the existing variable would need to be removed and replaced with your custom code.

Related

Accessing settings json file in shopify from JS or product liquid page

I check this and it wasn't the same as my question:
Editing JSON data from within a shopify liquid page
Currently I have a file settings_data.json in my theme. This file has a specific field called "product_form_style" there is a specific field I need to edit here from one product template titled: product_custom_liquid
According to some scarce resource I read this would work:
{% settings.product_form_style == 'my value' %}
This however gives an error: "Liquid syntax error: Unknown tag 'settings'"
The official documentation says I can access it with ajax or jquery from js however it doesn't give any examples. It only says it can be done but I have no idea how.
The basic idea is if product template is 'product_custom' then change settings product_form_style == true.
Obviously the above is not correct syntax. Just an example.
You can't modify the settings_data.json from the front-end without using an APP.
If you could modify it without any authentication this would have been a huge security issue and anyone could modify it.
settings_data.json is modified only when you save something in your Customize panel. For any other way you will need a Private app or some App to do so.
In addition you can't modify files in any way from the liquid code as well. The liquid template language only outputs data, it can't modify that data without the use of some kind of an APP.

Always hidden field support in Podio API

I am creating apps using Podio PHP library and want to specify always hidden setting. I have tried it a lot but I did not find any option in the library so can someone please help me to point out how I can specify this setting.
After investigation, I am able to figure it out like how to pass the always hidden. When we are creating an app with fields then for each field we need to provide config array so in this config array we need to pass new property "hidden_create_view_edit" with true and it will create app field with always hidden setting.
Sample config array:
"config"=>array(
"required"=>false,
"label"=>"Name",
"delta"=>1,
"hidden_create_view_edit"=>true
)

Concrete5 hardcode External Form to template

I have managed to create an external form using the method: http://www.concrete5.org/community/forums/usage/external-form-email... The form worked when I embedded the block via cms. However, I need to put the form into my template. the following code did not work.
$b = Block::getByName('My Form');
$b->display();
It it probably because my external form did not have a block name. But how could I set its name?
Block names can only be set when the block is placed on a page (which means you're in a catch-22 here and have no way to achieve that).
Instead of attempting to output this block directly, try putting it in a global area in your template instead. You can then tell the global area to not show editing controls or the red dotted outline by disabling them. See http://concrete5tricks.com/blog/dont-hardcode-blocks-use-a-global-area-instead/
btw, you might be interested in this code I have which makes custom contact forms much easier and better than the built-in "external forms" block (in my humble opinion): https://github.com/jordanlev/c5_custom_contact_form

Bigcommerce product image snippet in custom panel

I'm new to Bigcommerce and hoping someone can help me figure out if I'm doing anything wrong here. I'm simply trying to create a custom template for my product pages. I created a new file called "_product.html", uploaded it via FTP, and applied it to one of my products.
Within this file I have a default panel called ProductDetails.html. This panel makes a reference to the products thumbnail images. Everything works as expected.
However, I now copy the content from the ProductDetails.html panel and place it in a new panel called ProductInformation.html. At this point, there is no difference between ProductDetails.html and ProductInformation.html, except for the name.
I then go into my _product.html template and replace the reference to the ProductDetails panel with a reference to my new ProductInformation panel. Now, none of the snippets or global variables are being populated. They print nothing to the page.
If I put the original reference to the ProductDetails panel back, everything is displayed as expected. Is there something I'm missing here? Are the snippets and global variables used in the system-created ProductDetails panel only available in that file and not available to other custom panels created for a product page?
I really appreciate any help you can provide! Thank you!
As I recall, there is a key element inside of the ProductDetails Panel that is needed to get all the variables to work on a product page. I think the order even matters.
I would recommend using Snippets to control the information you want to swap out on a custom product page.
The ProductDetails panel populates the global variables that you are trying to use. If you do not have it on the custom page then you cannot use the variables inside of it. The workaround is to place the panel inside an HTML comment:
<!-- %%Panel.ProductDetails%% -->
That way the panel will be called by the Bigcommerce template system without affecting the rest of your layout.

Adding a custom field type to SugarCRM?

I'm trying to add a custom field type to our SugarCRM 6.2 instance. I want to add an "email link" type field. I want it to function like the URL field, but prefix every address with "mailto://" prefix instead of "http://".
It will be good if that field type is available in studio while creating new fields or in minimum, some custom code to achieve it.
What I did up to now:
- I've copied include/SugarFields/Fields/URL to include/SugarFields/Fields/Email
- In modules/ModuleBuilder/language/en_us.lang.php I've added a title for the email field
But unable to get anything working. Any help?
First of all you do not want to make any coding changes outside of the custom directory. Doing so outside of this directory is not upgrade safe.
Create a custom fields directory in your custom folder
Create new template files (.tpl) for your custom field
then you can just add a regular textfield in studio
then edit your viewdefs in your custom directory
in your tpl file concatenate the mailto:// to your text and just add the persons email address and it will take care of the rest for you
why you need custom field type for such small functionality? Just add your custom JS file in editviewdef.php. Then use some jQuery selector to perform certain action. For detail view, you can use view.detail.php to add required text in run time.
This will help you to store less data in database and display more in frontend.