国际电子商务技术 & Magento开发公司

Maishen technologies

Welcome visitor! You canlogin orcreate an account.

热线:+86-0532-58973093

麦神科技有限公司
Mygod Technologies

官方认证开发工程师

magento订单删除---数据库sql方式

2011年10月12日星期三 Asia/Shanghai下午1:11:26


关于magento的订单删除,好像涉及到法律的问题,所以magento,没有这个功能,虽然本身没有这个功能,也是有插件的,可以实现,但是magento的1.4.2不好用,所以,用sql删除也是不错的选择

 

通过下面的sql语句进行删除,删除前先备份:

1.4版本:

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `catalogsearch_query`;
ALTER TABLE `catalogsearch_query` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;

 

 

 

老版本,大致,1,3!!

Delete test orders in Magento

SET FOREIGN_KEY_CHECKS=0;
 
TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE`sales_order_entity_varchar`;
TRUNCATE`sales_order_int`;
TRUNCATE`sales_order_text`;
TRUNCATE`sales_order_varchar`;
TRUNCATE`sales_flat_quote`;
TRUNCATE`sales_flat_quote_address`;
TRUNCATE`sales_flat_quote_address_item`;
TRUNCATE`sales_flat_quote_item`;
TRUNCATE`sales_flat_quote_item_option`;
TRUNCATE`sales_flat_order_item`;
TRUNCATE`sendfriend_log`;
TRUNCATE`tag`;
TRUNCATE`tag_relation`;
TRUNCATE`tag_summary`;
TRUNCATE`wishlist`;
TRUNCATE`log_quote`;
TRUNCATE`report_event`;
 
ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
 
-- reset customers
TRUNCATE`customer_address_entity`;
TRUNCATE`customer_address_entity_datetime`;
TRUNCATE`customer_address_entity_decimal`;
TRUNCATE`customer_address_entity_int`;
TRUNCATE`customer_address_entity_text`;
TRUNCATE`customer_address_entity_varchar`;
TRUNCATE`customer_entity`;
TRUNCATE`customer_entity_datetime`;
TRUNCATE`customer_entity_decimal`;
TRUNCATE`customer_entity_int`;
TRUNCATE`customer_entity_text`;
TRUNCATE`customer_entity_varchar`;
TRUNCATE`log_customer`;
TRUNCATE`log_visitor`;
TRUNCATE`log_visitor_info`;
 
ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
 
-- Reset all ID counters
TRUNCATE`eav_entity_store`;
ALTER TABLE  `eav_entity_store` AUTO_INCREMENT=1;
 
SET FOREIGN_KEY_CHECKS=1;

缺点就是删除的是全部,而不是一部分,所以实用范围为,模板制作测试遗留的订单删除,而不适应于上线的网站!

0 Comments | Posted in magento日常所用 By terry water

magento的.htaccess文件

2011年10月12日星期三 Asia/Shanghai下午1:04:14

magento的.htaccess文件

在使用.htaccess文件的时候:

1

sample.com   301重定向到:www.sample.com

 

 RewriteEngine on

RewriteCond %{HTTP_HOST} ^sample.com [NC]
RewriteRule ^(.*)$ http://www.sample.com/$1 [L,R=301]

2

屏蔽某个IP的访问:

 deny from 71.84.196.66

3

在移动问价打包的时候,就会出现.htaccess文件丢失的现象,这样需要重新加上,否则,做的设置就没了

4

下面是一个access实例:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

#    php_value memory_limit 64M
    php_value memory_limit 128M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

    php_flag session.auto_start off

############################################
## enable resulting html compression

    php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

    php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # Don't compress images
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

RewriteCond %{HTTP_HOST} ^sample.com [NC]
RewriteRule ^(.*)$ http://www.sample.com/$1 [L,R=301]


############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    AddDefaultCharset Off
    #AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

    Order allow,deny
    Allow from all
    deny from 71.84.196.66
############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

再就是一些别的设置了,

譬如开始gzip等,一些模块等,需要在这里设置一下

有一些文件,譬如存放数据库信息的文件是不允许别人访问的,所以,我要屏蔽所有人访问,可以使用下面的格式设置magento 的.htaccess文件:

Order deny,allow
Deny from all

 

在app,var,等包下,你可以看到一个htaccess文件,里面的内容和上面一样,是不可以删除的,如果删除掉,别人通过

www.sample.com/app/etc/local.xml访问这个地址,直接就可以查看到你的数据库信息,这是很危险的!

0 Comments | Posted in magento日常所用 By magento use

paypal订单取消后转向购物车页面!

2011年10月9日星期日 Asia/Shanghai下午8:39:04

paypal订单取消后转向购物车页面!

paypal是magento默认就存在的支付方式,但是在进入paypal页面,用户点击取消后,回到网站,购物车是空的,或者有时候不是回到购物车页面,这样对客户体验不是很好,需要修改

文件为:

 

 app/code/core/Mage/Checkout/controllers/OnepageController.php

在该文件的484 - 491行

$this->getOnepage()->getQuote()->save();
        
/**
         * when there is redirect to third party, we don't want to save order yet.
         * we will save the order in return action.
         */
        
if (isset($redirectUrl)) {
            $result[
'redirect'$redirectUrl;
        
}

改为:

//$this->getOnepage()->getQuote()->save();
        /**
         * when there is redirect to third party, we don't want to save order yet.
         * we will save the order in return action.
         */
        if (isset($redirectUrl)) {
            $result[
'redirect'$redirectUrl;
        
}
        
else {
            $this
->getOnepage()->getQuote()->save();
        
}

重新编译,刷新缓存,好了!

测试一下,看看!

0 Comments | Posted in magento扩展 By terry water

在magento网店的产品详细页面添加facebook like 和google +1 按钮

2011年10月9日星期日 Asia/Shanghai下午6:58:19

在magento网店的产品详细页面添加facebook like 和google +1 按钮,通过社区推广!

Read More
0 Comments | Posted in magento日常所用 By terry water

magneto 运费和时间选项的插件,此类问题的解决--Multipletablerates

2011年6月2日星期四 Asia/Shanghai下午10:42:02

税率

Multiple Tablerates

当遇到这个问题,

Dellvery Rates

Ground $10.3

3Day Select $21.80

2nd Day Air $28

Next Day Air $56

这个运费的问题,

可以通过下面这个插件解决

key:magento-community/Pw_Multipletablerates

http://www.magentocommerce.com/magento-connect/Yarhajile/extension/728/multiple-tablerates

0 Comments | Posted in magento免费插件 By terry water
 
  • Mygod Technologies
  • 麦神科技有限公司
  • 香港中路8号
  • 中铁青岛中心大厦A3001
  • 市南区, 青岛, 266000
  • 电话: 0532-5897-3093

订阅我们的最新消息。

我们将严格尊重您的隐私。

关注我们的微信
获取外贸电子商务最新资讯;跨境推广最新策略;电子商务网站技术最新趋势。

2018 Mygod Technologies. 保留所有权. Privacy Policy