CS-Cart Create 2nd Invoice Template - cs-cart

I'm trying to create a second invoice template and add another print invoice link so I can print a standard invoice but also print a 'internal' invoice copy with an 'Official Use' table in which can be filled out by staff on the print out.
I've found the template invoice.tpl and print_invoice.tpl in /basic/mail/orders/
created two new files called invoice.dirty.tpl and print_invoice_dirty.tpl and pasted the content of the original files in the new ones, changed the path and added the table I wanted.
I've managed to locate the code for the 'Print Invoice' link and duplicated that changing the href by adding _dirty to the original 'orders.print_invoice?' but when I try the link it opens the popup ok but I get a 404 error, i've checked the permissions and changed them to full but still it won't play ball...
it seemed quite simple and I expected it to work but obviously i'm missing something, any guidance would be appreciated.

Check controllers that bring data to this files, maybe there is the main problem.

What cs-cart version are you using?
You need to create also the mode > invoice_dirty and this can be added with the help of file order.post.php but before i can give you some instructions i need to know you cs-cart version

Related

odoo-8 Template 'report.layout' not found

I can't print no reports anymore with odoo 8.
As it seems, the error is in the database because a newly created database doesn't have this problem.
But how can I correct this in the current database?
File "/opt/odoo8/server/openerp/addons/base/ir/ir_qweb.py", line 200, in get_template
raise QWebTemplateNotFound("Template %r not found" % name, template=origin_template)
QWebTemplateNotFound: Template 'report.layout' not found
Thanks for helping...
You probably have mistakenly butchered either web.layout or report.layout records. In your database that works. Go to Settings -> User Interface -> Views and search for layout. Select report.layout and make note of the configuration and values. Export it or copy it to your broken database. Your broken database may be missing this record entirely. This is a base view so unless you have modified it a vanilla record should work. The important part is the external id as without it you will probable still get this error.

Magento Dataflow (Advanced) Profile, default values

I want to create an import from a CSV but i can't modify the CSV file.
So i need to define default values for a couple required fields in Magento (like "type" ( > Simple Product ) etc.
I'm looking at https://stackoverflow.com/a/7319214/2252078 to make a custom Adapter and that inject the missing required values in the array before saving.
But i already get an error that says:
Method "parse" not defined in adapter spaanproductions_basics/convert_adapter_product
So i can't even begin with my custom code.
Maybe someone has a beter idea how to create some default values, or how to fix this issue.
Magento version: 1.9.1.1
Thanks in advance.
Kind regards,
Sonny
Not sure what the problem is, your code does seem to be valid. You could try http://pastebin.com/vxewc0Zt . OR temporarily rename your app/code/local/Spaanproductions/Basics/Model/Covert/Adapter/Product.php to verify wetter the right class is actually being loaded although I highly doubt that's the problem
-- Edit (See comments) --
try changing spaanproductions_basics/convert_adapter_product to basics/convert_adapter_product your models are defined under basics, not under spaanproductions"
At the first you have to export products as a csv file to catch the structure and then modify that as you need.
Take a look at this answer, it could be useful:
Update Magento products with multiple images

Smart Search Joomla One Result

I just enabled the Smart Search plug-in, and everything were great!
I just wanted to know when the query have ONE result, I'd love Joomla! will direct the user to this page directly.:(
Anyone has this issue and solved it ?
In this file components\com_finder\views\search\view.html.php add the below line inside display function. After this line - $this->assignRef('pagination', $pagination);
if(count($results)==1){
$app->redirect($results[0]->path);
}
This is a core file change so please do if necessary.
let me know if it does not work.

Google Analytics not tracking conversions in Magento 1.7

I'm using Magento's built in Googleanalytics module which is working fine for page views, but not for conversions. The account is set up fine on Google, but it's not adding the addTrans part in the checkout/onepage/success page.
I've done a lot of digging this morning, and found that the observer does observe the "checkout_onepage_controller_success_action" correctly, and does indeed run. It does the following:
$block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('google_analytics');
if ($block) {
$block->setOrderIds($orderIds);
}
I've done some echoing, and it does retrieve the block, and it also sets the order ids correctly. However, in the block itself, if I echo out $this->getOrderIds(); its empty.
My next thought was that perhaps it could be using two GA blocks on the page, and maybe its passing the data to the first one but echoing the HTML of the 2nd one, but I've no clue how to start checking that! The Googleanalytics.xml file only has one block it in, and I don't use that block name anywhere else!
Anyone experienced similar? Or have any idea where I can go from here?
EDIT:
The Ga.php block includes the transaction code if $this->getOrderIds() returns an array, which it is not doing. However, the observer is doing $block->setOrderIds($order_ids); which is passing through an array containing an order id. So the observer is passing the ids to the block, and the block is receiving them (setting up a method of setBlockIds and echoing out the argument, does show the array), but when the block tries to access its own data, it's suddenly not there ($block->getData() returns an array of properties but there is no order_ids property).
I also figured maybe it could be that its echoing the blocks HTML before setting the order id, so I added some variables in to check that and it's not that - its definitely setting the order_ids before trying to get them again, but its still not working!
I'm completely stumped! My only idea now is to modify the Ga.php block to use Magento's registry instead of it's own _data property, which is really not a nice way of doing it!
I think i've been an utter tool. Magento wasn't tracking conversions on the live site because I hadn't put the account code in the configuration part, but I had on my test site.
I had previously put my own analytics code in the template, so I had tracked page views.
When I saw no conversions (despite putting the account code in my test site), I started making orders on the test site and then viewing the source of the order success page. Firefox loads its source as a new request...which automatically goes to the empty basket page. So obviously, it wasn't showing the addTrans or anything, because it had already done that.
A quick check in firebug revealled it was working as it should.
So in the end, after a day of searching, I had to change "No" to "Yes" in the admin, and type in the account code. Great.

Magento - Make a copy of history.phtml and use it in my own way

I’m looking to find a way to copy the page history that we can access from My account/My orders which is available on this directory template/sales/order/history.phtml and use its content on my own way without affecting the original one. I’ve been trying many ways, as copying the whole directory and editing the Xml files related to it in order to setup up the right path and make it work, unfortunately it was a failure. I would like to know if you could give me a solution for this.
thx.
To use the functions of a block inside another .phtml I'm quite sure you can use getBlock
$blockFunctions = $this->getLayout()->getBlock('sales/order_history');
$order = $blockFunctions->getOrderHistory();
And to add a block in your custom module you'll need to create a .xml file for your block and add it to your template, you'll also have to add the actual .phtml file. Take a look at the moduleCreator (http://www.magentocommerce.com/magento-connect/danieln/extension/1108/modulecreator) this handles most of this quite well.
This is by no means througher its just a rough guide.

Resources