2013-02-26 18 views
0

Magento cron在除了一個模塊以外的所有模塊中都能正常工作。此模塊是Google受信任的商店。這個問題也被其他magento用戶報告過。magento模塊(Google可信任商店)的Cron無法正常工作

我查看了cron_schedule表,並且此模塊沒有待定任務。當我手動將此模塊的cron任務插入到cron_schedule表中時,此模塊完全按照本應該執行的操作進行。那麼,對於這個cron工作,這個模塊有什麼問題?這是config.xml。我想一旦我們解決了這個問題,模塊就好了。

<?xml version="1.0"?> 
<!-- 
/** 
* Magento Enterprise Edition 
* 
* NOTICE OF LICENSE 
* 
* This source file is subject to the Magento Enterprise Edition License 
* that is bundled with this package in the file LICENSE_EE.txt. 
* It is also available through the world-wide-web at this URL: 
* http://www.magentocommerce.com/license/enterprise-edition 
* If you did not receive a copy of the license and are unable to 
* obtain it through the world-wide-web, please send an email 
* to [email protected] so we can send you a copy immediately. 
* 
* DISCLAIMER 
* 
* Do not edit or add to this file if you wish to upgrade Magento to newer 
* versions in the future. If you wish to customize Magento for your 
* needs please refer to http://www.magentocommerce.com for more information. 
* 
* @category Mage 
* @package  Mage_GoogleTrustedStore 
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) 
* @license  http://www.magentocommerce.com/license/enterprise-edition 
*/ 
--> 
<config> 
    <modules> 
     <Mage_GoogleTrustedStore> 
      <version>1.6.0.0</version> 
     </Mage_GoogleTrustedStore> 
    </modules> 
    <global> 
     <helpers> 
      <googletrustedstore> 
       <class>Mage_GoogleTrustedStore_Helper</class> 
      </googletrustedstore> 
     </helpers> 
     <models> 
      <googletrustedstore> 
       <class>Mage_GoogleTrustedStore_Model</class> 
      </googletrustedstore> 
     </models> 
     <resources> 
      <googletrustedstore_setup> 
       <setup> 
        <module>Mage_GoogleTrustedStore</module> 
       </setup> 
      </googletrustedstore_setup> 
     </resources> 
     <blocks> 
      <googletrustedstore> 
       <class>Mage_GoogleTrustedStore_Block</class> 
      </googletrustedstore> 
     </blocks> 
     <googletrustedstore> 
      <google_group_email>[email protected]</google_group_email> 
      <order_cancellation_reasons> 
       <BuyerCanceled>Buyer Canceled</BuyerCanceled> 
       <MerchantCanceled>Merchant Canceled</MerchantCanceled> 
       <DuplicateInvalid>Duplicate Invalid</DuplicateInvalid> 
       <FraudFake>Fraud Fake</FraudFake> 
      </order_cancellation_reasons> 
      <ftp_host>uploads.google.com</ftp_host> 
      <carriers> 
       <main> 
        <ups>UPS</ups> 
        <fedex>FedEx</fedex> 
        <usps>USPS</usps> 
       </main> 
       <other> 
        <dhl>DHL</dhl> 
        <dhlint>DHL</dhlint> 
       </other> 
      </carriers> 
     </googletrustedstore> 
    </global> 
    <default> 
     <google> 
      <trustedstore> 
       <enabled>1</enabled> 
       <default_order_cancellation_reason>BuyerCanceled</default_order_cancellation_reason> 
       <estimated_ship_date>3</estimated_ship_date> 
      </trustedstore> 
     </google> 
    </default> 
    <frontend> 
     <layout> 
      <updates> 
       <googletrustedstore> 
        <file>googletrustedstore.xml</file> 
       </googletrustedstore> 
      </updates> 
     </layout> 
     <events> 
      <checkout_multishipping_controller_success_action> 
       <observers> 
        <googletrustedstore> 
         <type>model</type> 
         <class>googletrustedstore/observer</class> 
         <method>collectMultishippingOrderIds</method> 
        </googletrustedstore> 
       </observers> 
      </checkout_multishipping_controller_success_action> 
     </events> 
    </frontend> 
    <adminhtml> 
     <translate> 
      <modules> 
       <Mage_GoogleShopping> 
        <files> 
         <default>Mage_GoogleTrustedStore.csv</default> 
        </files> 
       </Mage_GoogleShopping> 
      </modules> 
     </translate> 
     <layout> 
      <updates> 
       <googletrustedstore> 
        <file>googletrustedstore.xml</file> 
       </googletrustedstore> 
      </updates> 
     </layout> 
     <events> 
      <sales_order_save_before> 
       <observers> 
        <googletrustedstore> 
         <type>model</type> 
         <class>googletrustedstore/observer</class> 
         <method>addCancellationReasonToOrder</method> 
        </googletrustedstore> 
       </observers> 
      </sales_order_save_before> 
      <sales_convert_order_to_quote> 
       <observers> 
        <googletrustedstore> 
         <type>model</type> 
         <class>googletrustedstore/observer</class> 
         <method>addCancellationReasonToSession</method> 
        </googletrustedstore> 
       </observers> 
      </sales_convert_order_to_quote> 
      <checkout_submit_all_after> 
       <observers> 
        <googletrustedstore> 
         <type>model</type> 
         <class>googletrustedstore/observer</class> 
         <method>collectAdminOrderId</method> 
        </googletrustedstore> 
       </observers> 
      </checkout_submit_all_after> 
      <controller_action_predispatch_adminhtml_sales_order_index> 
       <observers> 
        <googletrustedstore> 
         <type>model</type> 
         <class>googletrustedstore/observer</class> 
         <method>addOrderGridBlocksRenderingObserver</method> 
        </googletrustedstore> 
       </observers> 
      </controller_action_predispatch_adminhtml_sales_order_index> 
     </events> 
    </adminhtml> 
    <crontab> 
     <jobs> 
      <googletrustedstore_generate_feeds> 
       <schedule> 
        <cron_expr>0/20 * * * *</cron_expr> 
       </schedule> 
       <run> 
        <model>googletrustedstore/feeder::generateFeeds</model> 
       </run> 
      </googletrustedstore_generate_feeds> 
      <googletrustedstore_upload_feeds> 
       <schedule> 
        <cron_expr>0 2 * * *</cron_expr> 
       </schedule> 
       <run> 
        <model>googletrustedstore/feeder::uploadFeeds</model> 
       </run> 
      </googletrustedstore_upload_feeds> 
     </jobs> 
    </crontab> 
</config> 
+1

我不確定模型解決了。您可以嘗試將模型更改爲「Mage_GoogleTrustedStore_Model_Feeder' :: yourMethod。在cron配置中一切看起來都很好。 – 2013-02-26 22:36:36

+1

謝謝Fabian,最後,我發現cron很好。但它不是基本生成文本文件。最初,cron是在午夜之前設置的,在我試圖看到它們之前,它們正從cron_schedule表中刪除。當我將其改爲每20分鐘一次時,我發現它很好。所以,問題出現在別的地方。我會試着弄清楚並在模塊評論中寫下來,這樣可以幫助其他人排除故障或理解它。 – Robi 2013-02-27 16:59:12

+0

供稿不會生成和更新。什麼是問題以及如何解決這個問題? – alamelu 2014-11-10 08:43:52

回答

0

我們修補了Google信譽商店的社區版版本並記錄了http://www.dcjcooltools.com/blog/magento-extensions/the-nightmare-that-is-google-trusted-stores-for-magento/所需的確切修改。

我們解決的特殊問題包括Cron作業處理不當(有趣的小錯誤,如果我可以這麼說),即使上傳過程不起作用,即使上傳過程不起作用,也會刪除供稿文件,最後將出貨單名稱設置爲其他而非USPS,FedEx等。

讓我知道我們的解決方案是否適合您!

Regards, Evan

+0

而我單擊手動生成&上傳飼料管理員,它iswkg良好。但自動cron不是wkg。我的feeder.php有if(false === $ result){item} ['error_message'] = Mage :: helper('googletrustedstore') - > __(「無法上傳'%s'到'%s '在服務器%s上',$ item ['local'],$ item ['remote'],$ host); $ exceptions [] = $ item ['error_message']; } else { $ uploadedFiles [] = $ item ['local']; $ fs-> rm($ item ['local']); $ item ['successfully'] = true; } – alamelu 2014-11-10 09:35:07