我们的使命

助力跨境卖家高效建立全球销售网络

喜报2021年我司获《江苏省国家高新技术企业》认定

分类目录

文章标签

热门推荐

相关咨讯

opencart退款,magento数据库表

2022-09-14 10:42:49 - 米境通跨境电商

   

    MagentoSQL命令可以加快解决你遇到的问题,不同版本,数据库可能会有所不同,所以SQL命令可能也会有所变化,在用SQL命令的时候一定要记得备份!!

    1.批量调整所有产品的价格(参考命令在1.3下通过)

    UPDATE'catalog_product_entity_decimal'SETvalue=round(value*1.45)WHEREattribute_id=99;

    执行完后,需要到缓存管理里刷新:LayeredNavigationIndices,即可同步数据库里的关联表。

    2.批量处理所有exclude状态的图片

    UPDATE'catalog_product_entity_media_gallery_value'SETdisabled=0WHEREdisabled=1;

    3.导出导入Magento所有分类和产品

    分类和产品是存放在以catalog开头的所有表中,对这组表进行导出导入即可实现此功能。

    导入分类产品的SQL文件前注意:

    在首行加入:SETFOREIGN_KEY_CHECKS=0;

    在末行加入:SETFOREIGN_KEY_CHECKS=1;

    原因是Magento使用Innodb存储引擎。

    4.批量修改分类的DisplaySettings——>IsAnchor值为No

    UPDATE'catalog_category_entity_int'setvalue=0WHEREvalue=1ANDattribute_id=120;

    5.清空邮件队列

    TRUNCATETABLE'newsletter_queue';

    TRUNCATETABLE'newsletter_queue_link';

    TRUNCATETABLE'newsletter_queue_store_link';

    注意:同时向上万顾客发邮件时,不要在后台查看邮件队列,不然服务器压力会很大,待邮件发完之后,

    记着清空邮件队列,这样在后台进入邮件队列就不会大量消耗服务器资源了。

    6.Magento转移站后,经常会出现下面这个提示,运行一下下面的SQL命令即可恢复正常。

    错误提示:Notice:Undefinedindex:0app/code/core/Mage/Core/Model/Mysql4/Config.phpon

    line92

    SETFOREIGN_KEY_CHECKS=0;

    update'core_store'setstore_id=0wherecode=’admin’;

    update'core_store_group'setgroup_id=0wherename=’Default’;

    update'core_website'setwebsite_id=0wherecode=’admin’;

    update'customer_group'setcustomer_group_id=0wherecustomer_group_code=’NOTLOGGEDIN’;

    SETFOREIGN_KEY_CHECKS=1;

    不过要明白,这个错误是使用了第三方数据库备份工具导致的,Magento自带的备份功能是不会出现这个

    错误的。

    7.根据产品的SKU批量将产品自定义选项设为非必填:

    UPDATE'catalog_product_option'SETis_require=0WHEREproduct_idIN(SELECTentity_idFROM

    'catalog_product_entity'WHEREskuLIKE‘SKU%’);

    8.关闭/开启所有缺货产品

    SETFOREIGN_KEY_CHECKS=0;

    UPDATE'catalog_product_entity_int'SETvalue=2WHEREattribute_id=80andentity_idIN

    (SELECTproduct_idFROM'cataloginventory_stock_status'WHEREstock_status=0);

    SETFOREIGN_KEY_CHECKS=1;

    其它说明:value=2为关闭,1为开启,attribute_id对应不同版本的产品禁用项,最后执行完命令需要

    重建分类索引。

    9.取消所有问题邮件订阅

    UPDATE'newsletter_subscriber'SETsubscriber_status=3WHEREsubscriber_idIN(SELECT

    subscriber_idFROM'newsletter_problem');

    10.清除产品与分类的描述与Meta

    重置所有产品shortdescription

    UPDATE'catalog_product_entity_text'SETvalue=’ShortDescription’WHERE

    attribute_id=506;

    清除所有产品Meta

    UPDATE'catalog_product_entity_text'SETvalue=”WHEREattribute_id=97OR

    attribute_id=104;

    UPDATE'catalog_product_entity_varchar'SETvalue=”WHEREattribute_id=103OR

    attribute_id=105;

    清除所有产品URL

    UPDATE'catalog_product_entity_varchar'SETvalue=”WHEREattribute_id=481;

    清除所有分类描述:

    UPDATE'catalog_category_entity_text'SETvalue=”WHEREattribute_id=112OR

    attribute_id=115ORattribute_id=116;

    清除所有分类URL

    UPDATE'catalog_category_entity_varchar'SETvalue=”WHEREattribute_id=479;

    11.重置Magento所有ID统计数(如订单编码、发票编码等)
    联系我们
  • 24H客服
  • 联系电话:16651690460(龙经理)
  • 微信咨询:
南京天遥路联网络科技有限公司,版权所有 Copyright By ©米境通ERP4.0,2015-2025,苏ICP备:苏ICP备15044100号-4, 苏公网安备:32011402011043