I had been using a custom payment module that I had built from scratch to accept payments from a particular gateway company. However, the company has recently uploaded a better magento extension that i have now uploaded.
However, since I also cleared the old files for clarity the order details page no longer opens generating an error that the payment method does not exist.
I am guessing that for each order, Magento would store the payment method in the database. If I can get hold of that attribute and change all old values to the new value id - this error would be taken care of.
I have looked in the sales_flat_order and many other tables but cannot figure out where this value is stored. Can anyone point the actual table and attribute.
This is stored in the method column of the sales_flat_quote_payment and sales_flat_order_payment tables.
I am trying to make my table rates work with my multi store setup. I have 2 stores (not only store views) for the same installation and I want table rates for that.
I tried with the built in table rates and I also tried with http://www.magentocommerce.com/magento-connect/webshopapps-matrixrate-1-multiple-table-rates-extension.html.
The problem is, this only seems to work for my first store, the second store always tells me that there is no shipping available in the OPC.
I checked the tables shipping_tablerate and shipping_matrixrate (this one comes from the extension) and both have the website_id column which is 1 (my first store) for me. I tried changing from 1 to 3 (thats the id of my other store), did not help.
This is the content for the extensions file:
Land,Region/Staat,Stadt,"Zip/Postal Code From","Zip/Postal Code To","Gewicht From","Gewicht To",Versandkosten,"Delivery Type"
DEU,*,,,,1.1000,2.0000,4.4000,Versand
DEU,*,,,,2.1000,5.0000,6.9900,Versand
DEU,*,,,,0.2000,1.0000,3.9500,Versand
DEU,*,,,,0.0000,0.1000,6.9900,Versand
How can I make this work for my second store as well?
Thanks!
you just need to import csv for all websites.
No changes in code.
I've been trying to figure out exactly how does magento save the config data for a module given in System.xml. reason?I would like to edit the data provided by the user before storing it in the database.
Any clues????
Take a look at Mage_Core_Model_Store::setConfig function (and getConfig for reading the value). You will probbably have to write an observer that will listen to store_save_before event.
Magento stores configuration data in core_config_data database table - path column is the hierarhical structure of XML elements in system.xml file and is the same as XPath used for reading the default value out of config.xml file and value column contains the value that was saved.
When accessing the data with for e.g. Mage::getStoreConfig( 'path', $storeId ); Magento first searches the table for path-value pair and if it doesn't find it it reads the default value from config.xml file.
I'm trying to have a custom credit card payment attribute save to two different tables but I'm not sure how to do this.
The normal credit card information saves to two different tables.
sales_flat_quote_payment
sales_flat_order_payment
I created the new attribute and it should be saved to both tables. The column with the correct value has been set on both tables but it only saves to one "sales_flat_quote_payment" right when the customer places the order.
How can I make it so it saves the data to both tables?
I found this reference but I'm not sure how to implemente it to make it work with a credit card attribute value.
http://www.magentocommerce.com/boards/viewthread/19344/P0/
Can anyone confirm if this would work?
<sales_copy_order_payment>
<cc_bankname>
<to_order>*</to_order>
</cc_bankname>
</sales_copy_order_payment>
Did you configure Magento to convert the new attribute from quote to order? If you check the config.xml from the Mage_Sales module and search for sales_convert_quote_payment. You see something as follows:
<sales_convert_quote_payment>
<method><to_order_payment>*</to_order_payment></method>
<additional_data><to_order_payment>*</to_order_payment></additional_data>
<additional_information><to_order_payment>*</to_order_payment></additional_information>
<po_number><to_order_payment>*</to_order_payment></po_number>
<cc_type><to_order_payment>*</to_order_payment></cc_type>
<cc_number_enc><to_order_payment>*</to_order_payment></cc_number_enc>
<cc_last4><to_order_payment>*</to_order_payment></cc_last4>
<cc_owner><to_order_payment>*</to_order_payment></cc_owner>
<cc_exp_month><to_order_payment>*</to_order_payment></cc_exp_month>
<cc_exp_year><to_order_payment>*</to_order_payment></cc_exp_year>
<cc_number><to_order_payment>*</to_order_payment></cc_number>
<cc_cid><to_order_payment>*</to_order_payment></cc_cid>
<cc_ss_issue><to_order_payment>*</to_order_payment></cc_ss_issue>
<cc_ss_start_month><to_order_payment>*</to_order_payment></cc_ss_start_month>
<cc_ss_start_year><to_order_payment>*</to_order_payment></cc_ss_start_year>
</sales_convert_quote_payment>
Magento uses these fieldsets to transport data from entity to entity. In this case from the quote_payment to the order_payment.
Since all config XML is merged into one big heap of XML, you can add additional nodes from your own modules config.xml. Something like:
<global>
<fieldsets>
<sales_convert_quote_payment>
<your_attribute><to_order_payment>*</to_order_payment></your_attribute>
</sales_convert_quote_payment>
</fieldsets>
</global>
Hope this helps you get underway.
I have noticed that in Magento the core_config_data table is very small just after installation and it gradually gets populated over time ONLY when sections of the system config are saved. For example there are no values in the core_config_data table for the contacts settings - yet i can still do Mage::getStoreConfig('contacts/contacts/enabled') and get the correct value.
So, does this mean that magento is simply reading the config xml until a value is saved, and at which point it saves to the database and then the value is read from there?
If this is the case, then surely this is a bad design pattern, having these values stored in two places?
I think this post may help.
The Magento Config: Loading System Variables