How to Add Google Translate in WordPress

Today I will show you how you can add google translator plugin on the wordpress site in easy steps. First of all you have install this plugin Google Language Translator

After activating the plugin go to Settings » Google Language Translator to configure the plugin.

Make sure that the plugin is activated. After that you need to select your website’s default language, and the languages you want to be available for translation. Once you are done simply save your plugin settings.

Now after then you have to use the widget code on the widget section to display the translator on the site (simply drag and drop).

If you want to do that custom then you need to copy the code as per below screenshot and paste in your template file.

Now you have done you website in multi language option….. Thanks!!

How to Export Magento Product Database

In this tutorial I will show you how you can export entire Magento product database.
Most people can find their way to the standard Export options under System -> Import/Export, but that often doesn’t produce the results they’re expecting. A better approach is to use the Dataflow – Profiles that Magento provides. These out-of-the-box export “profiles” take care of a lot of the configurations you will need to make if you use the standard Magento Export option. Depending on the data you wish to export there are options for customers, products and stock.
In this post, we are going to look specifically at the Export All Products option.

We are going to use Magento Data-Profiles to Export your entire product database:

1-Navigate to System -> Import/Export -> Data-Profiles

2- Select Export All Products:

3- Review your options in the Profile Wizard. You may wish to change the name of your export file under File Information -> File Name.

4. To define which product attributes you wish to export for each product, under Profile Wizard -> Data Format -> Export you can choose to export All Fields, or select specific product attributes you wish to export by selecting Only Mapped Fields and selecting your required attributes.

5. To define a specific range of products you wish to export under Profile Wizard -> Export Filters -> you can filter your products by name, sku, product type, attribute set, price, stock quantity, visibility or status. Save and Continue Edit, and we’re ready to export.

6. Now that the parameters for your export are set, choose the Run Profile tab and click the Run Profile in Popup button. Your export will start automatically in a pop up window.

7. Once your export is complete, you now need to retrieve it from your server via SFTP. If you are unsure of how to connect to your server, please contact your hosting provider or web support. We recommend Filezilla as a good FTP program you could use.

8. Once logged into ftp, you will find you exported csv file waiting for you inside the var/export folder. Download the file, and there you have it!

 

How to put Magento in Maintenance Mode only for Front end

In this tutorial we will show you how to put your Magento online store in maintenance mode only for front end site. The admin can access the site without any issue

To put a Magento site in maintenance mode, you need to create an empty maintenance.flag file and upload it to the root folder of your site.

When you will upload maintenance.flag file then your website will be down and will show the error message

Service temporarily unavailable.

So for this message will show for all types of users. Now we will come to point and restrict the above message only for front users. For this follow the below instructions :

You need to replace the below code in index.php file (keep in mind when you will upgrade the site site then you must revert this process).

if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . ‘/errors/503.php’;
exit;
}

To this

if (file_exists($maintenanceFile) && strpos($_SERVER[‘REQUEST_URI’], ‘/admin/’) === false) {
include_once dirname(__FILE__) . ‘/errors/503.php’;
exit;
}

Please note the the code above is quick and dirty hack and I just check if /admin/ exists in url. If you have another url then you should replace with that.

How To Get Base, Media, Link Url In Magento2

How To Get Base, Media, Link Url In Magento2

To get the base URL, media URL, and link URL in Magento 2, you can use Magento’s built-in functions to retrieve these URLs programmatically. To get the base URL, use the following code:

$baseUrl = $this->_url->getBaseUrl();
For the media URL, which points to the media directory where files like images are stored, you can use:
$mediaUrl = $this->_mediaDirectory->getAbsolutePath('media');
To get a specific link URL for a page, product, or category, you can use:
$linkUrl = $this->_url->getUrl('path_to_resource');

You can access these values through the constructor by injecting the necessary dependencies, like \Magento\Framework\UrlInterface for the base URL and \Magento\MediaStorage\Model\File\Storage\Database for media URLs.

These methods provide a flexible and dynamic way to retrieve URLs based on your Magento 2 configuration.

How to Enable Template Path Hints in Magento 2

How to Enable Template Path Hints in Magento 2:

Go to Magento 2 admin panel and login with your credentials.
Go to Stores –> Configuration.
Select Developer option from the Advanced tab at the end.
Open Debug dropdown and set Enabled Template Path Hints for Storefront to yes.

Click to Save Config.

How to Change Magento 2 Logo

Here are the steps that you will follow to change Logo in Magento 2

Go to your Magento 2 admin.
Go to STORES > Configuration > Design > Header
Click Choose file and select your logo
Click Save Config

Get page id in wordpress

Here is the tips for getting page id in wordpress. First of all I will show page id in admin area.

Go to the pages and clcik on that, then you can see all pages list. Look the below screenhsot.

After then click on the desired page and you can see the page id on the address bar as I have marked. attached screenshot.

If you want to check page id on the front side then you should use the code. Use the blow wordpress function . It will give you the page id on the pages
get_the_ID();

More detail you can get here

If you want to show page id only for specific page then you can use the below code
<?php if(get_the_ID() == ‘475’) {?>
I am your page
<?php } ?>

Static blocks not working – Magento 1.9.x

After updating Magento to version 1.9.x, or installing security patch SUPEE-6788 on an older version, lots of people are noticing that their static block shortcodes are no longer working. So may be some developers frustrated or confused why this happen. The solution is simple magento people added security feature on the newer version.
Simply navigate to

System => Permissions => Blocks

And add the block type you wish to display.

Burger menu not working on ipad/tablet in wordpress

Burger menu not working on ipad/tablet in wordpress

If you are working with wordpress enfold theme then may be you get the issue of menu on the tablet/ipad in landscape mode. Them menu does not appears as a burger so try this media query, may be it will help :


@media only screen and (max-width: 1024px) { /*** put your css code here ****/}

 

How to change sign-up fee text in WooCommerce Subscriptions

How to change sign-up fee text in WooCommerce Subscriptions

Try this:

function change_subscription_product_string( $subscription_string, $product, $include )
{
if( $include['sign_up_fee'] ){
$subscription_string = str_replace('sign-up fee', 'your text', $subscription_string);
}
return $subscription_string;
}
add_filter( 'woocommerce_subscriptions_product_price_string', 'change_subscription_product_string', 10, 3 );