Magento Forum

1.1.6 Clear cache problem
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

I think the clear cache function in version 1.1.6 is not working. I changed the title of some products and I also added a free shipping method to my store, then I cleared cache several times, but I still don’t see the changes in front end. Is anybody has any idea why is this? Can I clear the cache manually by going to var/cache and delete all the files? I’m not sure if this will make any problem with my site....

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

You may safely delete the content of var/cache/* and var/session/*

You should then be able to see if the actual problem lies with the “Refresh Cache” functionality within the Admin.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

OK, I think I was wrong about the cache, however, even after deleting all the cache files manually, I still can’t make the Free Shipping method to show up in the front page. I checked everything in the method configuration, including, minimum order, sort, country selection, but still not showing up. I can see my other shipping options (DHL, Flat Rate, UPS and FedEx) but not the Free shipping.
I wonder if there is anything that I’m missing here or if this is a bug in 1.1.6?

Also, my product name is still not updated even after I changed it and cleared the cache manually. I really don’t know what is going on and what is wrong with this.....

I attached a copy of my Free Shipping configuration panel here…
Thanks

Image Attachments
free_shipping.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

OK, here is what I found so far,
If I delete the minimum order amount and leave it blank, then the Free Shipping fee will show up for all orders. If I put a number in there, even if my cart has great total, it wont show up. I think the problem is with the calculation of free shipping amount that is not working properly.

Here is the code in my freeshipping.php file:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * 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 license@magentocommerce.com 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_Shipping
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */


/**
 * Free shipping model
 *
 * @category   Mage
 * @package    Mage_Shipping
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Shipping_Model_Carrier_Freeshipping
    
extends Mage_Shipping_Model_Carrier_Abstract
    
implements Mage_Shipping_Model_Carrier_Interface
{

    
protected $_code 'freeshipping';

    
/**
     * FreeShipping Rates Collector
     *
     * @param Mage_Shipping_Model_Rate_Request $request
     * @return Mage_Shipping_Model_Rate_Result
     */
    
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    
{
        
if (!$this->getConfigFlag('active')) {
            
return false;
        
}

        $result 
Mage::getModel('shipping/rate_result');
//      $packageValue = $request->getBaseCurrency()->convert($request->getPackageValueWithDiscount(), $request->getPackageCurrency());
        
$packageValue $request->getPackageValueWithDiscount();

        
$this->_updateFreeMethodQuote($request);

        
$allow = ($request->getFreeShipping())
            || (
$packageValue >= $this->getConfigData('free_shipping_subtotal'));

        if (
$allow{
            $method 
Mage::getModel('shipping/rate_result_method');

            
$method->setCarrier('freeshipping');
            
$method->setCarrierTitle($this->getConfigData('title'));

            
$method->setMethod('freeshipping');
            
$method->setMethodTitle($this->getConfigData('name'));

            
$method->setPrice('0.00');
            
$method->setCost('0.00');

            
$result->append($method);
        
}

        
return $result;
    
}

    
/**
     * Allows free shipping when all product items have free shipping (promotions etc.)
     *
     * @param Mage_Shipping_Model_Rate_Request $request
     * @return void
     */
    
protected function _updateFreeMethodQuote($request)
    
{
        $freeShipping 
false;
        
$items $request->getAllItems();
        
$c count($items);
        for (
$i 0$i $c$i++) {
            
if ($items[$i]->getProduct() instanceof Mage_Catalog_Model_Product{
                
if ($items[$i]->getFreeShipping()) {
                    $freeShipping 
true;
                
else {
                    
return;
                
}
            }
        }
        
if ($freeShipping{
            $request
->setFreeShipping(true);
        
}
    }

    
public function getAllowedMethods()
    
{
        
return array('freeshipping'=>$this->getConfigData('name'));
    
}

}

Anybody has tried this method?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Linergy
Jr. Member
 
Total Posts:  8
Joined:  2008-07-28
 

protected function _updateFreeMethodQuote($request)
{
$freeShipping = false;
$items = $request->getAllItems();
$c = count($items);
for ($i = 0; $i < $c; $i++) {
if ($items[$i]->getProduct() instanceof Mage_Catalog_Model_Product) {
if ($items[$i]->getFreeShipping()) {
$freeShipping = true;
} else {
return;
}
}
}

The above is from your post...I’m not experienced in php but this is my best guess.

You have the value of $i = 0, after that you have

if($items)($i) ->getFreeShipping())

then free shipping equals true, however, the amount of items multiplied by the value of 0 still equals 0, so then your free shipping show up when there is 0 items or price.  After that you have an else and return function with no alternative specified, so nothing is displayed unless the price/items = 0.

I’m trying to logically work this out based on algebra, not actual knowledge of php code, so it’s possible I’m wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 

Thank you for your reply. However, the $i++ means add one number to the $i. so this loops each time and adds one number to $i untill it completes counting the items in the cart.

 
Magento Community Magento Community
Magento Community
Magento Community
 
metalMilita
Member
 
Total Posts:  53
Joined:  2008-11-03
sweden
 

Hey zadpro!!

did you find any solution for your free shipping method??
I have the same problem…

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 
metalMilita - 26 January 2009 11:49 PM

Hey zadpro!!

did you find any solution for your free shipping method??
I have the same problem…

To be honest with you, I didn’t try it after I have updated my store to 1.2.0.2. Magento had so many other major problems that I just left this issue alone for now. Like always, it should be going on. As I have never seen Magento team FIX any problem, other than adding more problematic features.
Good luck to all of us with Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
metalMilita
Member
 
Total Posts:  53
Joined:  2008-11-03
sweden
 

As I have never seen Magento team FIX any problem, other than adding more problematic features.

I agree with you..I dont remember number of my topics I created for help..

 
Magento Community Magento Community
Magento Community
Magento Community
 
zadpro
Sr. Member
 
Avatar
Total Posts:  247
Joined:  2007-12-10
FL, USA
 
metalMilita - 27 January 2009 01:36 AM


I agree with you..I dont remember number of my topics I created for help..

I bit you can exactly count number of bugs that was resolved/answered for you, If any.

See this:
http://www.magentocommerce.com/boards/viewthread/23942/

 
Magento Community Magento Community
Magento Community
Magento Community
 
snucky
Jr. Member
 
Total Posts:  5
Joined:  2009-10-11
 

SORRY - wrong thread

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top