Why does magento generates random order id's - magento

One of my magento site shows zig-zag order numbers from admin panel sales->orders. I guess, it should be auto incremented. There is possiblity to skip few numbers due to uncompleted orders. But i get unusual number for an order. Last order id was 100001922 and i get order id for latest order 100001300. can anybody help me as i need to figure out the reason.

Related

In NetSuite, can I sort a transaction by item # or some other column field?

Is it possible to sort the lines in a transaction by item (or some other column field)? We often receive very large orders from our customers and the items are in a more or less random order. When we receive said items from our vendors, the items come in numerical order by part number. It's very difficult for our logistics to receive them when our purchase order is in random order but the items came numerically. Is there any way for me to sort the purchase order by item #?
Re-sorting transaction lines is possible but quite prone to breaking. Until Netsuite actually supports it my recommendation would be to not spend time trying to re-sort lines.
About the only place it's safe to do that is on a Sales Order in the before Submit phase. Generally a sales order is the start of a whole chain of related transactions. Some of these relations are visible from fields and some are hidden. There is no api to re-sort the lines so the the way to get them sorted is to cache the lines in memory; clear the lines from the sales order; and then re-insert the lines in the desired order.
You have to make sure you capture everything and that you account for future customizations in your code.
So the alternative of supplying a sorted UI to aid fulfillments and receipts is much more reliable. Some of the ways I've done that include:
Adding a text area where people can paste a formatted list of skus/qtys received. A client script processes that and sets up the item receipt lines.
Creating a pop-up with the PO's items sorted as you like with whatever controls you need for efficient handling. The pop-up has a button for processing items when you are done with the receipt.
A field that lets you enter a sku (can have type ahead) that either brings you to the item you are receiving (selects the line) or provides a qty field as well so you just work at the top of the item list and enter and sku/qty/click process... until you have received the order
a similar thing but expecting a scanner to provide the sku so the process is gun/qty/click process

Algolia sorting only ASC or DESC not both

I'm bit confused with Algolia settings releated to sorting, specifically in the dashboard I created new replicas, products_price_asc & products_price_desc. Then I come to the ranking formula and added a "price" attribute to the sorting.
However, it allows me to pick up the price attribute only once, so as to specify the sorting order of the price.
So the result is, that I have a dropdown menu with 2 options (price order ASC and DESC), but only one of them works correctly.
It's my first day with Algolia, so maybe I've missed something, but if anyone can explain me, how to implement this, I'll be happy.
Thanks in advance.
Creating replicas for sorting is the right first step: you need one replica per sorting order (in your case, one for sorting by price DESC, and one for sorting by price ASC).
But you need to update the Ranking Formula on the replicas themselves, not on the main index.
So, on products_asc, you should set this:
And on products_desc, you should set this:
Now, when you need to order results by ascending price, you should target the products_asc index for your search. When ordering by price descending, it will be products_desc.

Change Order Date when changing an order

I'm hoping someone will be able to solve an issue that takes us a lot of manual labour, the solution seems simple :-)
Summary:
Is it possible to change the code that, when you Edit an order (invoiced or not yet invoiced) that is does not take the Order Date and Time of when you edited the order, but it uses the Order Date and Time of the original order?
Example:
Order 1000 was placed on 15/05/2015 at 12:00
Order 1000 was edited on 25/05/2015 at 14:00, the new order ID is 1000-1
We will credit or cancel order 1000, depending on the invoice state
Standard Magento will give order 1000-1 the Order date of 25/05/2015 14:00
But we would like order 1000-1 to receive the order date of 15/05/2015 12:00, the same as original order 1000.
Explanation:
We use a Magento Extension (Embedded ERP) which uses product reservations. If a customer orders a product, it does not remove the item from stock, but reserves stock. If the item is on backorder, the customer is placed in queue.
The system uses a first in, first out system. It uses the order date to check which customer is higher in queue than the other customers.
Because we use backorders, customer sometimes like to add or remove items to order, because they have to wait for items anyway. But when changing an order to add or remove items, the new order gets a new Order Date and Time. We want the customer to have the same product reservations as their original order. So now we manually change the product reservation of each item so it's the same as their original order.
I expect we can have the correct product reservations on the new order done automatically when the new order has the same order date and time of the original order.
Copy the file app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php into app/code/local/Mage/Adminhtml/Model/Sales/Order/. Keep the folder structure unchanged!
Find the option createOrder() and change this
if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
$this->getSession()->getOrder()->setRelationChildId($order->getId());
$this->getSession()->getOrder()->setRelationChildRealId($order->getIncrementId());
$this->getSession()->getOrder()->cancel()
->save();
$order->save();
}
with this:
if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
$this->getSession()->getOrder()->setRelationChildId($order->getId());
$this->getSession()->getOrder()->setRelationChildRealId($order->getIncrementId());
$this->getSession()->getOrder()->cancel()
->save();
$order->setCreatedAt($oldOrder->getCreatedAt());
$order->save();
}

Linq to SQL - Random Select Order and Paging

We have a database with 2,00,000 vendor in 100 plus category, if someone visit the website we want to allow them to select a category and show them 25 Vendor per page, first we kept order by VendorId but it always use to get first 25, but we removed it, but now in paging it sometime repeat the vendor, is there a way to get random 25 vendor and also keep the paging.
Regards
you can randomize your result but everytime you dot he query, it will create new random list so unless you randomize and save the randomized state in your Code and page over it, it cant be done straightforward way.
refer, SQL Query results pagination with random Order by in SQL Server 2008
I believe this requirement is impossible to implement if a new random order is needed every time, there needs to be good performance and every item should have equal chance to get selected. I believe you should redesign the way your application works.
One possible workaround is to have a couple of columns in a table and fill them with random numbers. When a user requests the list assign the random column to him (stick it in the URL for example). Then do an order by that column and display the results. Randomly switch 4-5 columns to create the appearance of randomness. Update the random numbers in the columns once a day.

Default sorting is not working

Please refer this following url http://www.trendycollections.in/kids-wear/boys-wear.html
All sorting is working Fine. But I have different issue. In the above url if i chose Price lowest under the sort by option then i will move to http://www.trendycollections.in/women-collections/sarees/designer-sarees.html, That category page also having Price lowest sorting.
If i chose price highest,Next category page also sorting by price highest
I think, i need to reset sort by option. I have set default sorting under system->config->catalog->front end->Product Listing Sort by as Best value. I can’t find where am i doing wrong here. if anybody know, please help me guys
The sort order parameter is stored in session.
You can switch it off by calling Mage_Catalog_Block_Product_List_Toolbar::disableParamsMemorizing method
OR
by setting params_memorize_allowed in catalog session. Mage::getSingleton('catalog/session')->setParamsMemorizeAllowed(true)

Resources