How to Uninstall a Module in Magento - Reinstall Magento Module and Run Install Script

If you want Magento to reinstall the module and re-run any database setup, take a look at the core_resource table.

Delete your module from this table and DROP any tables that the module had created. Clear Magento’s cache and the module will re-install.

The mysql4-install-X.X.X.php files will only be run once by Magento. By changing the version value in your XML config (Namespace/Module/etc/config.xml), you’re telling Magento which install file it should use:

Add a Link to Admin Menu or Sub-menu in Magento Module

<?xml version="1.0"?>
    <tutorial_menu translate="title" module="custompricing">
      <title>Custom Pricing Reports</title>
        <first_page module="custompricing">
          <title>Our First Page</title>
          <title>Here Too!</title>

Custom Add to Cart button on CMS Page in Magento

Magento provides an easy way of adding products to shopping cart via query string. To create a simple add to cart button on any magento’s CMS page open it in WYSIWYG editor and the following HTML to its contents:

<button onclick=”location.href ={{config path=”web/unsecure/base_url”}}/checkout/cart/add?product=1&qty=1′”>
Buy It Now</button>

Save the page and refresh the cache. Now if you open the page in you should be able to see “Buy It Now” button. When clicked it adds 1 product with ID=1 to your shopping cart.

Magento Checkout Success Page - Order Details, Product Price, SKU retrival

    $_customerId = Mage::getSingleton('customer/session')->getCustomerId();
    $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
    $order = Mage::getSingleton('sales/order'); 
    $_totalData =$order->getData(); 
    $_sub = $_totalData['subtotal'];
    //USD ==> global_currency_code,base_currency_code order_currency_code
    //print_r($order); print_r($_totalData);
    $_order   = $this->getOrder();
    $allitems = $order->getAllItems();
    $index    = 1;
    $data   = "";//Needed format ==> &ITEM1=3

Syndicate content