> [!INFO]
> **Website**: [The S Group](https://www.sashas.org/)

#

   # Free Gift Extension FAQ: Troubleshooting Rules & Errors

 Q: The "Apply Rules" button does not work. After loading, the server returns a 500 error.

 A: Please try to apply the Catalog Price Rules using the command-line PHP script provided below. Place this script in your store's shell/ directory, and execute it via the terminal with php apply_rules.php.

   <?php require_once '../Mage.php'; ini_set('display_errors', 1); #Varien_Profiler::enable();
Mage::setIsDeveloperMode(true); umask(0); Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
 try { Mage::getModel('catalogrule/rule')->applyAll(); Mage::app()->removeCache('catalog_rules_dirty');
 echo Mage::helper('catalogrule')->__('The rules have been applied successfully.') . "\n";
 } catch (Exception $e) {
 echo Mage::helper('catalogrule')->__('Unable to apply rules.') . "\n"; print_r($e);
 }

## Frequently Asked Questions

### Free Gift Extension FAQ: Troubleshooting Rules &amp; Errors

Q: The "Apply Rules" button does not work. After loading, the server returns a 500 error. A: Please try to apply the Catalog Price Rules using the command-line PHP script provided below. Place this script in your store's shell/ directory, and execute it via the terminal with php apply_rules.php. &lt;?php require_once '../Mage.php'; ini_set('display_errors', 1); #Varien_Profiler::enable(); Mage::setIsDeveloperMode(true); umask(0); Mage::app('default'); Mage::app()-&gt;setCurrentStore(Mage_Core_Mo



## Navigation & Categories
- [Experience](https://www.sashas.org/customer-experience.html)
  - [Catalog Enhancements](https://www.sashas.org/customer-experience/catalog-enhancements.html)
  - [Cart & Checkout](https://www.sashas.org/customer-experience/cart-checkout.html)
  - [Customers](https://www.sashas.org/customer-experience/customers.html)
  - [Shipping](https://www.sashas.org/customer-experience/shipping.html)
  - [Payments](https://www.sashas.org/customer-experience/payments.html)
- [Management](https://www.sashas.org/site-management.html)
  - [Sales & Fulfillment](https://www.sashas.org/site-management/sales-fulfillment.html)
  - [Catalog](https://www.sashas.org/site-management/catalog.html)
  - [Customer Support](https://www.sashas.org/site-management/customer-support.html)
  - [Marketing & Promotions](https://www.sashas.org/site-management/marketing-promotions.html)
  - [Content Management](https://www.sashas.org/site-management/content-management.html)
  - [Reporting & Analytics](https://www.sashas.org/site-management/reporting-analytics.html)
- [Optimization](https://www.sashas.org/optimization.html)
  - [Performance](https://www.sashas.org/optimization/performance.html)
  - [Monitoring](https://www.sashas.org/optimization/monitoring.html)
  - [Troubleshooting & Debugging](https://www.sashas.org/optimization/troubleshooting-debugging.html)
- [Blog](https://www.sashas.org/blog)
- [About Us](https://www.sashas.org/about-us.html)
- [Contact Us](https://www.sashas.org/contact.html)
- [Privacy Policy](https://www.sashas.org/privacy-and-refund-policy.html)
- [Refund Policy](https://www.sashas.org/refund-policy.html)
