Social Icons

twitterfacebookgoogle pluslinkedinemail

Sunday, 6 August 2017

Share Facebook and twitter in magento

Hello Friends,

This article is use to share your product in facebook and twitter. Here is the simple code to add into app/design/frontend/<theme>/<theme>/template/catalog/product/view.phtml

Please check first your theme path and also detail page file. here is the default path
 app/design/frontend/base/default/template/catalog/product/view.phtml

You can find file path to enable path hint from back-end.

Add below code and save the file

<?php $_productName = urlencode(trim($_helper->productAttribute($_product, $_product->getName(), 'name')))?>
                    <?php $_productImageUrl = urlencode(trim($this->helper('catalog/image')->init($_product, 'image')))?>
                    <?php $_productUrl = urlencode(trim($_product->getProductUrl()))?>
<?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>   
                    <div class="social-links" style="float: right;">
                        <a href="javascript:void(0);" title="<?php echo $this->__('Share on Facebook') ?>" class="link-facebook svg-replace" onclick="window.open( '<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>' , '_blank' ,'height=500,width=500'); return false">
                            <img class="fb-icon" style="" src="<?php echo $this->getSkinUrl(); ?>images/social-fb-icon.png" alt="Share Facebook" />
                        </a>
                       
                        <a href="javascript:void(0);" target="_blank" title="<?php echo $this->__('Share on Twitter') ?>" class="link-twitter svg-replace" onclick="window.open( '<?php echo 'http://twitter.com/home?status=' . $_productName . '+' . $_productUrl; ?>' , '_blank' ,'height=500,width=500'); return false">
                            <img class="twitter-icon" style="" src="<?php echo $this->getSkinUrl(); ?>images/social-twitter-icon.png" />
                        </a>
                    </div>

Notes: This code will help you in core php, WordPress, Drupal, Joomla and other framework also you just need to setup parameter and it will work.

Thank you,
Enjoy Your Self,

Thursday, 6 October 2016

Magento 2: how to create new admin user without access backend

Hello Friends,

In Magento2, Sometime your account is disabled or forgot the password of your current admin user and you can not update the password from database because magento 2 use the encrypted technique
So, don't worry about it. here is the very simple trick to create new user.


For this you must have ssh access because you can create new user using the command in magento 2.



php setup_magento2/bin/magento admin:user:create --admin-user anant --admin-password anant101289 --admin-email anantprajapati111@email.com --admin-firstname Anant --admin-lastname Prajapati






Now You can login with this user and update your current user password from back-end.

Hope, this trick will help you to resolve your reset password / forgot password / new user issue.

Thanks
Enjoy Your Self

Sunday, 4 September 2016

How to get current category details on listing page - magento 2

Hello Friends,

Here is the code to get details of current category in magento 2.

Please add below code in list.phtml (or you want any page of catalog) and you will get the category details in magento 2.


$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
var_dump($category->getData());

You will get output like this

Friday, 17 June 2016

How To setup magento2 on server

Hello Friend,

Today, we are talking about the magento2 commands which are useful to run successfully Magento2 Project on your server.

Here i am writing the steps of the setup new project on your server. (NOTE : this is the depend on the hosting server. So, may be it will not work on all server.)

Step1 : Please upload your theme or magento2 setup on server via FTP or Cpanel.

Step2 : Please extract the uploaded folder on server from Cpanel.

Step3 : Please create database name from the phpmyadmin on server.

Step4 : Please start the setup of the magento2 like run the url where you extract magento2 folder.

Step5 : once setup magento2 Please open ssh and connect it with ssh.

Step6 :  Run this command in terminal(CMD):
php bin/magento setup:upgrade

Step6 : Now , Run this command to check for static content
php bin/magento setup:static-content:deploy
  
Now You can run url of the site to check if is it working fine or not.

Hope This article will help you to setup magento2 project
Thank you
Enjoy Your Self

Saturday, 14 March 2015

wysiwyg editor remove allowfullscreen from iframe in magento

Hello Friends,

Today  I want to saw you that how to add "allowfullscreen" or other attribute in TinyMCE for iframe.

Basically i want to allow "allowfullscreen" to TinyMCE html editor for magento and I also searched this on Google but not found the any solution. so i start to check the tiny_mce.js. and i got the one code and add this attribute in that code. let me share the code for you. so, you can fix this issue yourself.

I tried this for the magento Tiny_Mce but i think this for all framework and cms.

 

Free Advertisement

Free Advertisement

Free Advertisement

Free Advertisement