Sorting items by item number in the Ecshop spool order page

Source: Internet
Author: User

Ecshop background Management in the "Print Order" page of the product sort a bit messy, now want to change to order by serial number, modify the method as follows

Here are the changes made on the basis of 2.7.2

Open admin/order.php File

Found (approximately 311 rows or so)

$sql = "Select O.*, if (o.product_id > 0, P.product_number, g.goods_number) as storage, o.goods_attr, g.suppliers_id, if NULL (B.brand_name, ") as Brand_Name, P.PRODUCT_SN
From ". $ecs->table (' Order_goods '). "As O
Left JOIN ". $ecs->table (' products '). "As P
On p.product_id = o.product_id
Left JOIN ". $ecs->table (' goods '). "As G
On o.goods_id = g.goods_id
Left JOIN ". $ecs->table (' brand '). "As B
On g.brand_id = b.brand_id
WHERE o.order_id = ' $order [order_id] ' ";



Revision changed to

$sql = "Select O.*, if (o.product_id > 0, P.product_number, g.goods_number) as storage, o.goods_attr, g.suppliers_id, if NULL (B.brand_name, ") as Brand_Name, P.PRODUCT_SN
From ". $ecs->table (' Order_goods '). "As O
Left JOIN ". $ecs->table (' products '). "As P
On p.product_id = o.product_id
Left JOIN ". $ecs->table (' goods '). "As G
On o.goods_id = g.goods_id
Left JOIN ". $ecs->table (' brand '). "As B
On g.brand_id = b.brand_id
WHERE o.order_id = ' $order [order_id] ' ORDER by G.GOODS_SN ';

This will allow you to sort by product serial number.

Sorting items by item number in the Ecshop spool order page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.