Magento creating invoice redirect to wrong url - magento

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!

Related

Magento error in admin - Payment method does not exist

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.

Magento sells products but fails to store the order

I have a silly problem - a Magento 1.7.2.0 that works just fine, except for now and then it does not store the order in the database.
Emails go out, payment gets processed (owner gets confirmation from PayPal, for example) but no order is stored in the database. I did not rely on grid only, I checked the database - and nothing is there.
Also, last time this happened I checked increment values in eav_entity_store and thy were not updated - it says 130000030 and in the email order is numbered 130000031 - so somewhere in the process it crashes.
First idea was to look in the error log but I was not able to see anything there that I could relate to this.
Now I need a fresh idea. Any thoughts?
Thanks

Why does a category have a weird path defined in the Magento database?

My catalog_category_entity table has an entry for a category that does not appear anywhere in the admin area of the site, or in the front end.
It has a weird path: "/30" (30 is its entity_id). Every other category in every other Magento site I have access to starts its path with a number, not a slash.
It has entries through the rest of the EAV system in various places.
My suspicion is that someone ran a bad import, or other manual process, which left this category in the database, when really it should have been simply deleted.
Is this an anomaly, or is there a reason for this category to have a weird path?
Your suspicion is right. Most probably this is due to a bad import. Normally all paths look like this: 1/2/5/17. The path represents the ids of the categories starting from "root of all roots" (1) and continuing with all the parents and last is the category id. The path is used for displaying the categories in frontend and backend. That's why the category does not appear in any list.
If you have data on that category and you need it, just edit the path field and make it 1/2/30. 2 is the id of the root catalog so it may be different for you.
Then just increment the field children_count for the categories with id 1 and 2.
Back-up your db before trying this.

why magento using other product's url key for url rewrite

I am using magento 1.7. i am faceing strange problem. magento making duplicate product url with random number with wrong url key please my attached screenshot
I also empty table rewrite_urls and reindex urls but still i am getting wrong urls. please help me to solve this problem. if you are unable to view images in question then please click on links duplicate product urls and Product in admin panel
,
Let me make understand u with example
Like i have one product named "example" and url key is "example" Url will be
www.example.com/example
and now i have created new product "xyz and url key is "xyz" and url should be
www.example.com/xyz
but magento generating url
www.example.com/example-123
This seems to be a bug in 1.7.
If you have multiple simple products with the same url key as the configurable product (e.g. all names are the same), than magento always creates a new url rewrite on every index process.
Example:
First index:
myproducturl (config product)
myproducturl-id (simple product with its id appended, so far so good)
Second index:
myproducturl (config product)
myproducturl-randomnumber (simple product with random number, BAD)
myproducturl-id --> myproducturl-randomnumber (rewrite to the new url)
And on every new index process the last step will be repeated, so always a new random url key is generated.
If magento would check, that a url key with the id for that product already exists, this should be no problem.
After a few months, you will have a really big url_rewrite table, because nothing will be deleted and on every run, at least 1 record for every product with the same url key will be created.
I was able to eliminate the extra numbers at the end of the URLs by truncating the table "core_url_rewrites" (I made sure to make copy first) then reindexed it.

404 error when switching between stores when in a category on magento

My magento website has 5 store views. When we are in a product in English and select French, it redirects correctly and show the product in French. But when it comes to categories, it doesn't work at all.
I'm on a category with the url http://myweb.com/en/body-care, if I change to the Spanish view, it doesn't redirect to the url "../cuidado-del-cuerpo" it just goes to to http://myweb.com/es/body-care and shows a 404 error (it changes the 'en' for 'es', but doesn't change the last part of the url).
The rewrite is not defined on the URL Rewrite Management section. I have 5 categories and 5 store views, so it's not a good idea to create the rewrites rules manually.
How can I solve this? Why the rewrite rules were not written when we created/modified the url of each category?
1) Can you check if the urlkey is definable on store view level, or if it is set to website level? That way, you can only create 1 url key for EN and ES. You need it to be at store view level, do define 2 separate values.
2) Is there something in your error log? (and is your error log turned on?) Normally url rewrites are created automatically for each store view. If not, you may need to manually reindex.
It's hard to give further advice, since the problem could be anywhere (conflicting module? bad code?)

Resources