<script type="text/javascript">
{% if customer %}
{% assign customerid = '"<?php echo base_url('checkout?id='.$postdata['cart_id']); ?>' | append: '&customer=' | append: customer.id | append: '"' %}
{% else %}
{% assign customerid = '"<?php echo base_url('checkout?id='.$postdata['cart_id']); ?>' | append: '"' %}
{% endif %}
var checkouturl = {{customerid}};
window.location.replace(checkouturl);
</script>
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Monday, 24 June 2019
How to concat string and variable in Liquid Shopify in PHP with proxy URL
Wednesday, 19 June 2019
How to Install FREE SSL certificate into your howsting usign zerossl
Step 1 : Open : https://zerossl.com/free-ssl/#crt
Step 2 : Add your domains
Step 3 : After Click Next in previous step you can see like below image and Click Next
Step 4 : Now You can get both key like below image
Step 5 : Click Next and you can get two files, see like below image
Step 6 : Download both key and upload into your server (like : public_html/.well-known/acme-challenge )
Step 7 : Click Next, You can see something like below image
Step 8 : Now Download certificate and private key file
Step 9 : Upload certificate into cpanel into see below image
Step 10 : Upload your certificate (domain-crt.txt) and save certificate code see below image
Step 11 : Install certificate see below image
Step 12 : Upload private key (domain-key.txt)
Step 13 : Click Install Certificate and Enjoy with FREE SSL
Friday, 14 June 2019
How to open simple HTML CSS popup
HTML
<div class="main-roomle-popup-bg"></div>
<div class="main-roomle-popup">
<div class="main-roomle-box">
<h4>Popup heading</h4>
<p>You can put message here.</p>
<div class="modul-close-btn"><a href="#"><img src="close.png"/></a></div>
</div>
</div>
CSS
<style type="text/css">
body {margin: 0;padding: 0;width: 100%;} .main-roomle-popup-bg {position: fixed;left: 0;top: 0;width: 100%;height: 100%;overflow: auto;background-color: #000; opacity: 0.5;} .main-roomle-popup {margin:0;width: 100%;text-align: center;z-index: 1;} .main-roomle-box {margin: auto;padding: 20px;width: 360px;height: 130px;background: #000;position: absolute;top: 0;right: 0;left: 0;bottom: 0;} .main-roomle-box h4 {margin: 0;padding: 0 0 40px 0;font-size: 22px;color: #fff;line-height: 22px;} .main-roomle-box p {margin: 0;padding: 0;font-size: 18px;color: #fff;} .modul-close-btn {margin: 0;padding: 0;width: 30px;height: 30px;position: absolute;right: -10px;top: -10px;}
</style>
Thursday, 13 June 2019
Make Convert formatted price for sum to float number in PHP - FILTER_SANITIZE_NUMBER_FLOAT
<?php
$number="7-2f+3.3jk";
var_dump(filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION));
?>
Output : string(7) "7-2+3.3"
Wednesday, 12 June 2019
How to check URL and server OR SSL error and using terminal and curl
There are several way to check issue of URL and server OR SSL error and using terminal and curl
curl https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L
curl -vo /dev/null https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L
curl -I https://cdn.example.com/assets/storetheme/.htaccess.txt -L
curl -v /dev/null https://cdn.example.com/assets/storetheme/version2.3/new_theme.js -L
Saturday, 8 June 2019
How to add Language of custom plugin in Admin dashboard in wordpress
Add text for language like this "<?php echo __('General options', 'roomle'); ?>"
Step 1 : Create plugin like "roomle"
Step 2 : Set domain path into plugin file like following screenshot
Step 3 : Create "roomle.pot" inside /wp-content/plugins/roomle/languages/
Step 4 : Add like following text inside "roomle.pot" file (FYI : Don't add any translation language just add as (msgstr = ""))
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-06-08 12:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: functions.php:29
#, php-format
msgid "Roomle"
msgstr ""
#: functions.php:47
#, php-format
msgid "Select"
msgstr ""
#: functions.php:56
msgid "Roomle product type"
msgstr ""
Step 5 : Download the free plugin called Loco Translate from here. Or add directly from the WordPress administration via Plugins > Add New. (https://wordpress.org/plugins/loco-translate/)
Step 6 : Install and Activate Loco plugin
Step 7 : Click on Plugin inner menu of Loco after that click into your plugin from list.
Step 8 : Click on New language
Step 9 : Choose a language which you wish to translate (Here translate from English to Spanish)
Step 10 : See Source text (its from "roomle.pot" ) you need to add text of translate language.
Step 11 : After create all text to Spanish language, Check "/roomle/wp-content/languages/plugins/" directory. your 2 file is created here like "roomle-es_ES.mo" and "roomle-es_ES.po"
Step 12 : If you wish to check so you need to download wordpress in spanish language and setup wordpress and check
Also this answer for following question
- How to Change the Admin plugin Language
- How to add language into your plugin
- How to add language into your custom plugin
AWS SSH and SFTP Disconnected: No supported authentication methods available (server sent: publickey)
Disconnected: No supported authentication methods available (server sent: publickey)
Could not connect to server
Could not connect to server
Step 1 : Login aws console
Step 2 : Go to instance list
Step 3 : Stop instance which have issue
Step 4 : After stop instance, Click and open "View/Change User Data" (See image)
Step 5 : Add Following code into textarea
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
cloud_final_modules:
- [scripts-user, always]
--//
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata.txt"
#!/bin/bash
ls -Al
ls -Al /home
ls -Al /home/ubuntu
ls -Al /home/ubuntu/.ssh
sudo cat /home/ubuntu/.ssh/authorized_keys
chown root:root /home
chmod 755 /home
chown ubuntu:ubuntu /home/ubuntu -R
chmod 700 /home/ubuntu
chmod 700 /home/ubuntu/.ssh
chmod 600 /home/ubuntu/.ssh/authorized_keys
ls -Al
ls -Al /home
ls -Al /home/ubuntu
ls -Al /home/ubuntu/.ssh
sudo cat /home/ubuntu/.ssh/authorized_keys
sudo ufw disable
sudo service sshd restart
--//
Step 6 : Click on save button
Step 7 : Finish! Check your SSH and SFTP detail
Subscribe to:
Posts (Atom)