Magento error in admin - Payment method does not exist - magento

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.

Related

woocommerce cart session duplicating

I have a client who is experiencing issues with their Wordpress/WooCommerce website.
Issue: The website is automatically adding products to the cart (Roughly 40-60). The issue occurs for both logged-in & logged-out users. The issue can occur when trying to login to the My Account section, when adding items to the cart or sometimes after adding items to the cart and then visiting the cart it will override cart items with new random items.
I have noticed that in WC_Session_handler the value for _customer_id is often not unique nor is the other session data.. I have removed all server & front-end caching, searched for any other sessions initialized.
Any help would be appreciated as they are losing business due to customers not being able to remove the items from their cart (As the removed items re-appear quickly)..
Domain Name: thecoffeehopper.com :)
The cart is constructed from data in the wp_woocommerce_sessions and wp_usermeta MySQL tables.
I would run the following sql queries to try and find the source of your problem.
select * from wp_woocommerce_sessions;
select * from wp_usermeta where meta_key like '_woocommerce_persistent_cart_%';
The data from these rows are used to construct the cart. Are the random items found in any of these rows? The rows have a user id or customer id to tell which customer the data belongs to.
The data in these rows are serialized strings and is difficult to read directly so I would use the WordPress CLI tool and apply the function maybe_unserialize() to the SQL results.

Magento 2: Generating Customer Session Based Caching Pages

Scenario:
In an integration in Magento 2 with Full Caching.
We have two types of customers Type 1 and Type 2. Both these types of customers are saved under same Customer Group we are distinguishing the customers based on a customer type attribute.
Customer of type 1 can belong to different departments (1 to many). When he first visits the site after login, he is redirected to select his department.
This value is saved in customer session, on run time customer can change his department that value is updated in the existing customer session.
When we access a new page we get the updated session, but if we access a page that was accessed earlier, we get the old data from session.
Options tried:
We tried to load the data from customer session factory instead of customer session, but still we are facing the issue. Our understanding is that data which is saved in customer object is loaded as new, but since our data is saved under customer session it is not returning the latest data.
For some section of the page we have used sections to load the data, but in that scenario also, if a page is accessed earlier the correct data is not loaded in first refresh, in second refresh the data is loaded properly.
We also tried to update the session data from AJAX, but that was also not much useful since that data is not getting loaded on the pages.
We also tried to use context variables, but when we log the data while saving the context variable the correct data is logged but when we try to fetch the context data, no data was returned. Also even if different context variable is set for each department, the page seems to be rendered from cache.
We can’t use Cookie since this is sensitive data, this will be the last option.
In Magento 1 we had an option to generate new Cache key by extending app\code\local\Enterprise\PageCache\Model\Processor.php,
Example
if
(isset($_COOKIE[Enterprise_PageCache_Model_Cookie::IS_USER_ALLOWED_SAVE_COOKIE]))
{ $uri .= '_' .
$_COOKIE[Enterprise_PageCache_Model_Cookie::IS_USER_ALLOWED_SAVE_COOKIE];
}
Is there any similar option available in Magento 2. If yes, please share some reference links to integrate the same.

Magento creating invoice redirect to wrong url

When I create an invoice from the order in the backend, this on this url:
http://www.site.com/index.php/safe/sales_order_invoice/new/order_id/4372/
But when the Invoice is about to be created it goes to:
http://www.site.com/shop/safe/sales_order/view/order_id/4372/
You see the (Shop), which is mostly correct because the storefront is named that(We had 2 storefronts once) If I remove the (Shop) part from the url, I'm getting back to the correct page and it shows that the invoice was correctly created. This only happens from the Order itself. If I use Mass action to create invoices from the orders list, it's not giving me any problems.
If anyone else has the problem (Using multi stores)
Please check your database, core_config_data and see if web/secure/base_url etc. is redirecting to the right path. And make sure to check that it's doing so for the right store ID that is giving you the trouble.
My problem was that the secure path for one of my stores, was ruining it.
All works fine now!

Where is Magento order data stored?

I am running Magento 1.6.2 and have an intermittent error cropping up with some sales orders. The customer is being charged correctly, but the Magento admin page when viewing the sale reports incorrect values. I understand why it is doing it incorrectly - I have a 10% discount off a full section of products on my website, and it is because of this that something is going wrong.
Again, the customer is paying the correct (discounted) amount, but the data must be being stored incorrectly in the magento database because looking at it in the admin system doesn't total the values correctly. The Catalog Price Rule that applies the 10% discount is not accounted for in the displayed totals.
To add to my woes, we use Zynk to bring data in from Magento to our Sage 200 backoffice system, and the data getting imported into that system is also missing the 10% discount, making reconciliation of order payments and Sage invoices a complete pain.
The only thing I can think is that somewhere somehow the data is being stored in the magento database incorrectly (not having had the 10% discount applied to it) so when Zynk collects the data, it is incorrect.
Can anyone help me understand where I can find the order data in the Magento database so I can see what was stored for a specific Magento order number - I can at least begin to debug this then, maybe?
If someone has details of where to find the code used by Magento to perform the order database transactions, specifically where the discounts should be applied before storing the data, that would be a big help too.
Cheers!
Orders data are saved in database tables sales_flat_order and sales_flat_order_item
Discounts are applied in Mage_SalesRule_Model_Validator
You can find orders and order items data in your (tables prefix)_sales_flat_order and (tables prefix)_sales_flat_order_item respectively. but remember that when an order is placed Magento simply copies the data from its respective quote. so in my opinion you should be checking (table prefix)_sales_flat_quote and (table prefix)_sales_flat_quote_item first.

Magento checkout method recorded in database

Is the Magento checkout method recorded anywhere in the database.
I know the value can be accessed during the session i.e. register, guest etc but after the order is placed is the value recorded anywhere?
Anton S gave a good answer but if you need more help viewing tables and their fields in the Magento database, this is a really useful tool.
http://www.magereverse.com/
Simply select your version of Magento and then start selecting tables. It gives you correlations between various fields in the tables as well, which can be helpful when tracking down entity data.
Hope this helps!
Checkout method is stored in the sales_flat_quote table in the customer_is_guest field. A value of 1 indicates the customer checked out using the guest checkout option. A value of 0 indicates the customer checked out using their account. You can access the quote using its id from the order object.

Resources