Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

Magento 2, Magento Development, Customization, Extension Development and Integration, Optimization, SEO and Responsive Design

How to clear Prestashop cache or recompile manually when modification do not see

Some people face problems when they are trying to update or modify their Prestashop. They update files, install modules, but these actions are not visible in Prestashop fronend. This problem often occurs in new Prestashop version – 1.4, because Prestashop 1.4 uses new cache system , now caching with “Smarty” and “Memcached”.

When you modify your Prestashop, you can disable cache in admin panel: Preferences > Performance
  • Smarty block – Cache: disabled
  • Caching block – Use cache: disabled

Delete cache manually, clean up this folder:
  • Prestashop root folder/tools/smarty/cache
  • Prestashop root folder/tools/smarty/compile

If you use smarty v2, clean up this folder:
  • Prestashop root folder/tools/smarty_v2/cache
  • Prestashop root folder/tools/smarty_v2/compile
Prestashop 1.5.x:
  • Prestashop root folder cache/smarty/cache
  • Prestashop root folder cache/smarty/compile

When you add Prestashop in your business, it is strongly recommended not to delete cache files and turn on all cache, because then your shop will work much faster.

How to create module in magento


In this blog post, we will learn how to start magento module development and basic files required setup a module.

Before starting with the module we need to first decide the name of the module, because after creating a module it’s very difficult to change the name of the module.

You can download module Creator Download

Extract this and paste moduleCreator to your xampp or wamp and open moduleCreator. 
e.g  'http://localhost/moduleCreator/'

your module creator looks like this


- In namespace enter your module namespace like your company name etc(required).
- In module field enter your module name(required).
- Others are optional, you can skip them. 
- Click on create button.

- Next step is copy all files created by module creator to your magento installation.
- Go to your xampp or wamp and open moduleCreator .
- Open new >> app >> code >> local >> 'Yourmodule' copy this and paste it to your magento installation in same directory.
- Open new >> app >> design >> adminhtml >> default >> default >> layout and copy your module xml file to your magento in same directory.
- Open new >> app >> design >> frontend >> default >> default >> layout and copy your module xml file and paste in your magento in app >> design >> frontend >> default >> 'Yourtheme' >> layout.
- Open new >> app >> design >> frontend >> default >> default >> template and copy your module template folder and paste in your magento in  app >> design >> frontend >> default >> 'Yourtheme' >> template.
- Open new >> app >> etc >> modules and copy your module xml file and paste in your magento in same directory.
- Now open your magento site and clear your cache. You can see your newly created module in admin section.

  • When creating controller files or block file, etc remember to be careful about case sensitivity of file names. Especially, when you upload your module to linux server the module may stop working, if file cases and class name have not been put in carefully.
  • All class names should be case-sensitive as well. Basically, based on the class name, magento includes that file. So, if class name is not correct, the file is not found by magento.

How to send email from blogspot or blogger


Send email from blogspot or blogger

Blogspot not sporting php code so you can not use php code to send email from your blog. If you want to do it you need to use jQuery and have to call to another server to send email as following.

Step1: Take free domain and add one test.php file in it.

You can create your free domain here

Step2: Now add following code in your test.php file.

<?php
        $id = $_REQUEST['id'];
        $msg = $_REQUEST['msg'];
        $to = "someone@example.com";
        $subject = "Test mail"; $message = $id.'='.$msg;
        $from = "someonelse@example.com";
        $headers = "From:" . $from; mail($to,$subject,$message,$headers);
?>

Step3: Add HTML/javascript Gadget and add following code in it. 
<script type="text/javascript">
jQuery(document).ready(function() {
var pathName = jQuery(location).attr('href');
    var msg = "This is a testing email from above page";
    jQuery.ajax({
        dataType: 'jsonp',
        data:  "id=" + pathName + "&msg=" + msg,
        jsonp: 'jsonp_callback',
        url: 'http://test.site90.net/myfiles/test.php',
        success: function () {
       
        }
    });
});
</script>

That's it.

How to show out of stock products in magento

If you want to show/display out of stock products in magento than follow this:

Magento has several criteria for determining if an item should be visible in the store, but one of these is not whether or not the item is in stock. Magento can manage your stock and will set your stock status to “Out of Stock” for you, but what if you want these out of stock items to be hidden from the store.. automatically? Also, in my case I do not want to “disable” the item because the inventory management system will then ignore it. Turns out this was much more difficult to figure out than I expected it to be but the end solution was quite simple.

A. Login to Magento back-end
B. Go to menu System >> Configuration.
C. Take inventory tab from the left panel
D. Set Display out of stock products to ‘Yes’ in Stock options tab in the right panel

Show out of stock products in magento

E. Clear your cache and reindex your Index management.

That's it.

How to create new theme OR copy base theme to another theme in magento

If you want to Create new theme for your magento or you don't want to make any changes in your base theme than follow this easy steps:

  • At the first stage we create folders for our new theme. We call it mytheme. Then we add a new folder with the name of our new theme.
  • It is important to remember! Before changing .Phtml file, it must be copied from base (or default) themes to a new theme. When Magento detects one of the files in a new theme, it will ignore .phtml file from a base (or default) theme. Copy only those files that will be changed. It minimizes the number of errors during Magento upgrade.
Step1: Go to app/design/frontend/base/default and copy that all folders

Step2: Now go to app/design/frontend/default/mytheme and paste here. Make sure there is already default folder. You don't need to change anything in that default folder. 

Step3: Now go to skin/frontend/default/default/ and copy that all files and folders and paste it to skin/frontend/default/mytheme.

Step:4 Now go to your admin system >> configuration >> Design and change your new theme name here.


Magento create new theme

Change mytheme name with whatever your theme name you want make it.

How to Turn On Template Path Hints in Magento

If you want to turn on Template Path Hints in your magento front than follow the following easy steps:

- using Template Path Hints you can easily identify your .phtml file where you need to change. path hints show you direct file path from which file the particular file is coming, so you can easily change what ever you want to change in file. If you are new to magento Template Path Hints will helps you a lot.

Step 1: System >> Configuration >> Developer

your current configuration scope is set to “Default Config.” You cannot setup Magento Template Path Hints globally. You’ll need to set the Configuration Scope to a website or store configuration. When you do, you’ll see a screen like this:

Turn On Template Path Hints in Magento

Change Template Path Hints no to yes and save the configuration. Reload your front page.

You can enable Template Path Hints in your magento admin panel as well. Follow this post if you want to enable it.

 

Copyright @ 2017 HKBlog.