How can I add a new documents template in Shopware? - smarty

I have created a new template, that extends the Bare template of Shopware 5.3.7 though the backend, then I activated it.
I added the file index_mydocument.tpl inside the documents/ directory and added a new entry MyDocument in Basic Settings > PDF document creation. The template path of that entry is index_mydocument.tpl.
The I deleted all caches, reloaded the backend and tried generating a "Preview" in "Basic Settings > PDF document creation > MyDocument"
It returns the following error message:
Fatal error: Uncaught SmartyException: Unable to load template snippet
'documents/index_mydocument.tpl' in
/project/shopware/engine/Library/Smarty/sysplugins/smarty_internal_templatebase.php
on line 127
What can I do so that Shopware notices my new index_mydocument.tpl?

I found the solution. The shop configuration under
Basic Settings > Shop settings > Shops > My Shop > Document template
was still set to the Bare template.
I changed it to:
and now the PDF generation works.

Related

Office Add-in Taskpane can't find html file

Developing an office web add-in for Outlook. I Followed this tutorial to start my project.
I tried implementing a new taskpane, but when I open it I get this error: Failed to load resource: the server responded with a status of 404 (Not Found).
When I try to access de sideloading at https://localhost:3000/src/taskpane/taskpane.html, the page is only containing Cannot GET /src/taskpane/taskpane.html.
I have no error in the manifest and I updated the webpack.config.js with:
entry: {
polyfill: ["core-js/stable", "regenerator-runtime/runtime"],
taskpane: "./src/taskpane/taskpane.js"
}
new HtmlWebpackPlugin({
filename: "taskpane.html",
template: "./src/taskpane/taskpane.html",
chunks: ["polyfill", "taskpane"]
})
I don't know what I'm missing, can someone help?
Found my problem, I was doing almost everything right. I was typing the full path, but I only needed to specify the filename like this: https://localhost:3000/taskpane.html

How To Deploy: Installing Mezzanine Theme

How to install Mezzanine Theme exactly, step-by-step?
E.g., Moderna free theme.
Preconditions:
0) Versioning
Python 2.7.6.
Django 1.6.10
Mezzanine 3.1.10
Moderna v.? (static content)
1) I used PythonAnywhere for hosting
2) I followed this way to install Mezzanine: here, at the bottom there are links to PythonAnywhere specific guides
3) So, initial state is: Mezzanine is deployed, empty, with default theme.
4) [optional] Basic templates are collected (~80 of them it was)
5) Static is collected via python manage.py collectstatic
1. Add moderna to project
That's a simple step.
You should go to site with theme (for moderna it's here ) and download it. It will be a Django App, probably zipped into archive.
If app is zipped, unzip it.
Move it to your Mezzanine project folder (the one, which got created by command mezzanine-project myproject)
Folder structure should become:
myproject/
+-deploy/
+-static/
+-templates/ [in case you chose to collect them]
+-moderna/ [our new theme]
|
+-__init__.py
+-settings.py
+-urls.py
+-manage.py
+-wsgi.py
|
+-[some other things]
2. Change settings.py
open settings.py of your Mezzanine project
add moderna/templates to TEMPLATE_DIRS in settings.py 1st recor. The point is to give new directions to template loaders - now they 1st look for templates in moderna. Should now look like this:
TEMPLATE_DIRS = (
os.path.join(PROJECT_ROOT, "moderna/templates"),
os.path.join(PROJECT_ROOT, "templates"),
)
add moderna app to INSTALLED_APPS in settings.py above all (I presume, that's for Moderna's views, models etc. - backend for templates)
3. New Static Files
collectstatic again - now it will grab moderna's static
4. URLConf
in urls.py, use DIRECT_TO_TEMPLATE selected for / (root url), it should look like this:
urlpatterns += patterns('',
url("^$", direct_to_template, {"template": "index.html"}, name="home"),
("^", include("mezzanine.urls")),
...
5. Reload
I guess some servers would pick up new settings and urls automatically. Those which don't should be reloaded manually to catch up and start showing your beautiful new theme.
6. Customization begins
Now you can start customizing Moderna theme via base.html and index.html files in myproject/moderna/templates/ folder.
Postscriptum
I welcome any corrections and extensions, I'm not an expert in Mezzanine customization and the topic has many of slippery slopes.

Magento - import - Get an error just after clic on save and continue to edit

My data was move from another server by the team who host my website ( www.whc.ca) and now when i go in the section:
system -> import/export -> CommerceExtension
when i open a import with out add any file just clicking save and continue i get this message:
Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file).
I don't get this from any other files in the system -> import/export
I talk with the guy how program this extension and he said that there is nothing in his program that bring this error.
The guys who doing the technical support on WHC do not know how to fix it. It was fix once when i was on the other server but there was no note about how it was fix.
some one made this for me: http://djinncomics.com/phpinfo.php
Can some one know what can cause that or where to look? true the Cpanel i already configure the limit and i modify the php file ether. nothing seem affect this error message.
I assume your import/export extension is certainly overloading some of Magento classes. I got the same error today and checked the code, here is what appear to be the problem, in file app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php :
/**
* Save profile action
*/
public function saveAction()
{
if ($data = $this->getRequest()->getPost()) {
...actions...
}
else {
Mage::getSingleton('adminhtml/session')->addError(
$this->__('Invalid POST data (please check post_max_size and upload_max_filesize settings in your php.ini file).')
);
$this->_redirect('*/*');
}
}
When you try to save an import/export profile and don't change any param, Magento will automatically assume that you have a problem with your server configuration, which is not the case.

Magento : How to hide the default Store View code from the url

The site has 2 languages: English and French, represented by 2 store views. French is the default one. For our SEO efforts we need to have the following urls:
French - http://www.domain.com/category/product
English - http://www.domain.com/en/category/product
System -> Configuration -> Web -> Add Store Codes to URL is the all or nothing setting. We just need to turn it off for the default store only.
I’ve done a lot of searching through the forums and wiki but there’s nothing on the subject.
Please any sugestions?
Finnaly i solved this magic probleme , i hope that's save others persone here is the details :
1- Download the zip existe in this page : https://github.com/Knectar/Magento-Store-Codes
2- unzip the file and put the folder called "Knectar" in {app/code/community/} and Knectar_Storecodes.xml file in {app/etc/modules}
3- In your backoffice go to "System > Tools > Compilation" and click the rebuild button
4- always in backoffice got to "System > Configuration > Web > URL options" and set the attribute "and default store view" to No and save the configuration
5- Clear your cach magento and enjoy your application :) .
I had the same problem and I have developed an extension for that.
It is available on GitHub: https://github.com/jreinke/magento-hide-default-store-code
I didn't find a quick solution to your problem, but I see that's possible through 2 steps :
1 / Using the advise commented by #user3154108 and trying this tip https://magento.stackexchange.com/questions/8126/store-code-in-url-for-every-store-view-except-for-default
2 / For SEO SITEMAP, it's possible to override the following file
app/code/core/Mage/Sitemap/Model/Sitemap.php
public function generateXml()
{
...
}
and replace the default store code by NULL.
For more details try to look at this post : http://alanstorm.com/generating_google_sitemaps_in_magento
I was having the same problem and I had already selected to not show store code in url in the config. I also didn't want to install an extension just to handle something this minor. Here's my EASY solution:
Copy app/code/core/Mage/Catalog/Block/Widget/Link.php to app/code/local/Mage/Catalog/Block/Widget/Link.php
Search for (line 91 in Magento 1.7.x / line 100 in Magento 1.9.x)
$this->_href = $this->_href . $symbol . "___store=" . $store->getCode();
And modify to
$this->_href = $this->_href;
Upload and save your changes and you'll now not have your widget (dynamically) inserted links getting appended with ?___store=default.
Credit: DesignHaven
Under System -> Configuration -> Web -> URL Options you
change "Add Store Code to Urls" to "NO" as on the attached screenshot

Magento backend error: Edit user

I get an error in Magento 1.6.1.0 backend:
System -> Permissions -> Users -> Edit user
When I try to access this page nothing gets loaded into content area. Page layout and menus are displayed but the form for user editing is not.
In Firbug it throws the following error:
$("user_user_roles") is null
This line comes from
app/design/adminhtml/default/default/template/permissions/user_roles_grid_js.phtml
which has not been touched.
I did an update from 1.6.0.0 to 1.6.1.0 ... could create and edit users in the old version but I am not able to do it now. Could not find anything on the web for this error.
Please let me know if there is a fix to this.
I also got this error. Here is what I did to fix.
Open file Roles.php in app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php and add getRowUrl() function:
public function getRowUrl($row) {
return $this->getUrl('*/*/edit');
}
Hope this helps,
Neo.

Resources