New blank page in Zen-Cart - e-commerce

How can I create a new blank page in zen-cart without applying the template.
I want to create a page that will result only a JSON data...
Thanks in advance

Create a php file in your store directory. In that file, if you want to use ZenCart functions you can include them, like so:
<?php
include "includes/application_top.php";
set headers for mime type
set headers for not caching
YOUR CODE
echo $json;
// below is optional if you didn't create/edit session
include "includes/application_bottom.php";

Related

WHMCS how to find right tpl files in pages

i'm using WHMCS and i want to make some changes in part of the page but its so hard and takes so much time for me to find the right tpl file and edit it in the template.
for example for this "search for domains" tab in this url =>
example.com/cart.php?a=add&domain=register
where is the .tpl file.
For example.com/cart.php?a=add&domain=register the file is at templates/orderforms/standard_cart/adddomain.tpl
In general, when url has cart.php, the file in cart template.
Also, you can add the following to hooks to tell you which tpl file was used for current page.
1- Create file includes/hooks/tpl_locator.php
2- Add the following code:
<?php
add_hook('ClientAreaPage', 1, function($vars) {
error_log(print_r([$vars['currentpagelinkback'],$vars['templatefile']], true), 3, __DIR__.'/tpl_file_location.log');
});
3- Visit the page you want to know which tpl file is used.
4- Result will be at file includes/hooks/tpl_file_location.log, sample below:
Array
(
[0] => /cart.php?a=add&pid=1&
[1] => configureproductdomain
)
This was tested on WHMCS 8.0
The tpl for cart.php?a=add&domain=register is actually located at /whmcs/templates/orderforms/standard_cart/domainregister.tpl if I understand your question.

WebKitGtk2 load from string

In WebKitGtk1 there was a function to load an html page directly from a string.
webkit_web_view_load_string ()
Requests loading of the given content with the specified mime_type ,
encoding and base_uri .
Is there an equivalent in WebKitGtk2? I would like to display an HTML page that is re-generated very often, so saving it as a file and loading this file is no option.
http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html
There are few load methods e.g. webkit_web_view_load_html. Please pick up the one that suits your needs.

How to grab the url or path of generated docs created in phpdocx

We have a project in which we are using phpdocx in generating word document. We would like to grab the url or path of the generated docs and send it to email. How can we grab the url? Thanks!
When you generate docs, you pass $path parameter to the method createdocx() like this:
<?php
$docx = new CreateDocx();
$docx->addText('This is just a dummy text');
$docx->createDocx($path);
?>
This generate the document at $path. So you always have the path of the generated docs

Opencart display one module conents into another module

I'm having custom footer module in my template. Also i'm using testimonial module in the position content bottom. I'm trying to display testimonial inside custom footer.
To do this i simply copied testimonial.tpl and testimonial.php contents and pasted into customfooter.tpl and customfooter.php
After this i'm getting errors stating
undefined variable and class name already assigned error
Did you know how to do this?
See this answer for how to do use a module in a separate modification/controller
opencart - How to manually display a module inside a template file?
You simply need to change from the common/home to your module's controller and view files
please define variable.
how can you define i will show you.
catalog > controller > header.php
for static variable
$this->load->language('common/header');
$data['text_home'] = $this->language->get('text_home');
// Where language file in assign this variable with different language foler
$data['text_home'] = $this->url->link('information/contact');
and you can tpl file in use this varible.
<?php echo $text_home; ?>
make sure 100% erorr has not facing
for dynamic variable

Getting the data from backend to display it on Front end in X-CART

I am working on a X-Cart Module. I need the backend configuration values to the front end. In admin/configuration file I have created an array which contains the value which I need to use it in adv_search.php which is in the root folder. I don't know how to pass that array to adv_search.php.
Thanks in advance.
It is not quite clear how you store the configuration values. It may be easier to store them in the table xcart_config and access them directly as $config['Option-category']['option_name'] in php files and {$config.Option-category.option_name} in the Smarty-templates.
Or just define an array in module's config.php file and this array will be available everywhere in php-scripts. Look at the modules/UPS_OnLine_Tools/config.php file for example.