Integrating Magento Module for Extra Checkout Fee - magento-1.7

I'm newer to Magento development and am having quite a difficult time integrating the module explained and laid out here:
http://turnkeye.com/blog/magento-development-add-total-row-checkout/
I know that there are some inconsistencies on the walkthrough, which I believe I have accounted for, but still cannot get it in working order. What I have done so far:
-Created all of the files they outline and the config file:
/magento/app/code/local/Turnkeye/Insurance/RW/Adminhtml/Block/Sales/Order/Totals.php
/magento/app/code/local/Turnkeye/Insurance/RW/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php
/magento/app/code/local/Turnkeye/Insurance/RW/Adminhtml/Block/Sales/Order/Invoice/Totals.php
/magento/app/code/local/Turnkeye/Insurance/etc/config.xml
/magento/app/code/local/Turnkeye/Insurance/Model/Total/Insurance/Quote.php
/magento/app/code/local/Turnkeye/Insurance/Model/Total/Insurance/Creditmemo.php
/magento/app/code/local/Turnkeye/Insurance/Model/Total/Screen/Invoice.php
-Created a helper file:
class Turnkeye_Insurance_Helper_Data extends Mage_Core_Helper_Abstract
{ }
After doing all of this, I'm getting an error when trying to add a product to the cart: address total model should be extended from Mage_Sales_Model_Quote_Address_Total_Abstract . Unfortunately that is where I've reached the limit of what I know. Any help with any errors I may have done or any idea what that error may be coming from, that would be awesome!

Related

Swiss QR Bill --> Output fpdf

I've been trying to get the whole Swiss QR up and running for months now. Unfortunately, you can't get help anywhere and it's also getting frustrating.
Finally, I would like to call up a PHP file and have a ready payment slip. with the correct information from the customer.
The SwissQR bill and FPDF were installed via the Composer (but would be happier without Composer, if there is someone here who shows me which files I have to copy I would be happier). and now? none of the "example" files work. Outputs like:
Uncaught Error: Class "Fpdf\Fpdf" not found
or
Class "QrBill\PaymentPart\Output\FpdfOutput\FpdfOutput" not found
are generated.
can someone help me?
everything should be easier, but it seems everything is only getting harder. More complicated, more cumbersome.
Thanks

building android source for pixel 6

I'm trying to build grapheneos for pixel 6 with custom bootanimation.
I created the bootanimation.zip file according to instructions but can't figure out the location to put it in. Since the usual location, system/media/bootanimation.zip is giving me an Error:
offending entries: system/media/bootanimation.zip
besides this, the build also fails.
Can anyone help me to understand what I am doing wrong ?
Error message
If it is still relevant, I may have an answer for you.
There's a mechanism that prevents you from doing something to the system partition from the product makefile in some cases.
The solution to your specific situation might be different, and there are also suggested solutions in the link below.
If you have something that is a part of the system partition, and is not a product specific thing, you can also add it to:
build/make/target/product/generic_system.mk
instead of the product specific makefile
Here is a link explaining this mechanism

How to include only the Google PHP APIs that I need (just Google Spreadsheets)?

Summary: My simple website now successfully communicates with Google Spreadsheets, but the inconvenience of adding this Google Spreadsheets API is that deployments of my website (via deployhq.com) now take 50 minutes when they used to take 30 seconds!
Details:
I created a simple webpage using PHP that accepts parameters and then appends a new row of data to a Google Spreadsheet. Getting it working felt like a miracle because Google's documentation was so sparse and often outdated.
Following the example there and on Google's Github page, my composer.json file is:
{
"require": {
"google/apiclient": "^2.0"
}
}
Can I somehow avoid requiring all of those Google dependencies for all of their PHP APIs?
I'd love not to download all of the irrelevant Google API code that has nothing to do with Google Spreadsheets.
I think the massive amount of files is what is causing my deployments to take 50 minutes instead of 30 seconds.
My super basic webpage pretty much just uses the Google_Service_Sheets class and related classes. I want anything extraneous.
If you download a release of the client library it will include the core library and all of its dependencies, without the auto-generated classes. Then you can then download the Sheets API generated classes separately and add them to your project. Using composer is the preferred method, as it makes it easy to get updates later.
P.S. - There are ~4200 generated files downloaded with the library. That's not trivial, but any process that takes 50 minutes to copy those over likely has room for improvement.

External access to Magento instances

I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');

ZF2 Album tutorial using stored procedures

Please also suggest which namespace to use. I am new to zend and MVC.
module.php
public function getServiceConfig()
{
// what code here?
}
**Album\Model\Album.php**
{
//what code here?
}
**Album\Model\AlbumTable.php**
{
//what code here?
//do we have to use this class or a different class?
}
I can understand the sudden confusion when starting out with ZF2. However, the manual has really done a good job at helping those who are just starting out. You can find the most up-to-date information here : http://zf2.readthedocs.org/en/latest/user-guide/overview.html
Once you've got the Skeleton Application working I believe some of your confusion will be relieved. If not, come back and ask more specific questions OR you could even join the FreeNode IRC channel at #zftalk.
But to also help answer some of what you've asked here:
getServiceConfig() is where you will interact with the ServiceManager. Try to stay away from closures and work with Factories.
Album.php is sort of like the Hydrator. You don't have to use a Hydrator but for example purposes it was put here. It can make like easier in the long run.
AlbumTable.php is the Database Table you will be interacting with.
The namespace which is used in the tutorial is called Album. The Skeleton application comes packaged with a namespace called Application to start with.
You can manually download ZF2 here: https://packages.zendframework.com/
The latest skeleton application can be found here: https://github.com/zendframework/ZendSkeletonApplication
You may also choose to use Composer to install your entire application which tends to make the installation process much easier for those just starting out, so in your situation I'm going to recommend you use that. You can find instructions on how to use Composer here: http://zf2.readthedocs.org/en/latest/user-guide/skeleton-application.html