My games no longer listed on Google Playstore 😢😭, but you can find on other platform 🥳😁, please take a look at this link https://apkpure.com/id/developer/Zaidan%20Lab
Continue reading My Android Games
Comments closedIndonesian Magento Developer
My games no longer listed on Google Playstore 😢😭, but you can find on other platform 🥳😁, please take a look at this link https://apkpure.com/id/developer/Zaidan%20Lab
Continue reading My Android Games
Comments closedEnd of year 2023 composer config repositories.mysqlsengine git https://github.com/swissup/module-search-mysql-legacy.git composer require swissup/module-search-mysql-legacy –prefer-source –ignore-platform-reqs php bin/magento setup:upgrade –safe-mode=1 php bin/magento setup:di:compile php bin/magento cache:flush php…
Continue reading Magento 2 : Disable ElasticSearch, Switch Search Engine to MySql (legacy)
Comments closedpublicfunction __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\CatalogInventory\Api\StockStateInterface $stockState, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry ){ $this->storeManager = $storeManager; $this->stockState = $stockState; $this->stockRegistry = $stockRegistry; } public function getSalableQtyByPID($product) $websiteId = $this->storeManager->getStore()->getWebsiteId();…
Continue reading [Magento 2] Get Salable Qty By SKU
Comments closedThis is affects on local only git update-index –assume-unchanged /path/to/file or git update-index –assume-unchanged /path/to/files/* or register files path into .git/info/exclude
Continue reading Ignore git file(s) without .gitignore (local only)
Comments closedhere’s example M2 controller serve XML or JSON public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\RawFactory $resultPageFactory ) { $this->resultPageFactory = $resultPageFactory; parent::__construct($context); } public function execute()…
Continue reading Magento 2 : Controller Return XML or JSON
Comments closedlet’s say you’re going to connect to mysql database server but the database not open to public (security reason), there is workaround to perform this…
Continue reading [Linux] Connect to Mysql through SSH Tunnel
Comments closedLet’s say you lost in the middle of a method and difficult to trace which other methods call the current method, you can debug or back trace…
Continue reading [PHP] Debug Print Call Stack
Comments closedinstall required library apt install libnss3-tools -y download, give permission & copy/move to bin folder: wget https://github.com/FiloSottile/mkcert/releases/download/v1.1.2/mkcert-v1.1.2-linux-amd64chmod +x mkcert-v1.1.2-linux-amd64cp mkcert-v1.1.2-linux-amd64 /usr/local/bin/mkcert Generate local CA sudo…
Continue reading [Ubuntu] Setup https on localhost
Comments closedHere’s steps how to create custom ajax upload file in admin page create controller file
Continue reading Magento 2 : Admin Ajax Upload File
Comments closedIntro from wikipedia: A web cache (or HTTP cache) is an information technology for the temporary storage (caching) of Web documents, such as web pages, images, and other types of Web multimedia, to reduce server lag.…
Continue reading Magento2 : Create Custom Cache to Reduce Server Load
Comments closedok then in your di.xml <?xml version=”1.0″ ?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\Webapi\Controller\Rest\Router”> <plugin disabled=”false” name=”YourModule_ModuleName_Plugin_Magento_Webapi_Controller_Rest_Router” sortOrder=”10″ type=”YourModule\ModuleName\Plugin\Magento\Webapi\Controller\Rest\Router”/> </type> </config> and then finally, use plugin …
Continue reading M2 : Override/Intercept REST API POST params
Comments closedstep-1 Go to following path and open Edit.php app\code\local\Namespace\Modulename\Block\Adminhtml\Modulename\Edit.php and Add this Function protected function _prepareLayout() { // Load Wysiwyg on demand and Prepare layout…
Continue reading Magento : Add WYSIWYG Editor in Custom Module
Leave a Commentjust an example, upgrade php cli version to php 7.1, make sure you have sudo right sudo rm /usr/bin/php sudo ln -s /opt/plesk/php/7.1/bin/php /usr/bin/php or…
Continue reading [Linux]Change PHP Cli Version
Comments closedToday this thing got me frustrated, let’s straight to the main problem, before I forget create js function to load from an URL contains json…
Continue reading Knockoutjs: populate json url data to select options
Comments closedfirst to view current number of connection, use this command ss -p | grep nginx | grep -i estab | wc -l if the number…
Continue reading [Linux/Nginx]Block unwated bot
Comments closedphp -d memory_limit=-1 `which composer` require msp/recaptcha:2.0.0 or php -d memory_limit=-1 /usr/local/bin/composer require msp/recaptcha:2.0.0 simple af
Continue reading [Magento 2]Install via Composer out of memory
Comments closedfor failed login attempt, use this awk ‘/Failed/ {x[$(NF-3)]++} END {for (i in x){printf “%3d %s\n”, x[i], i}}’ /var/log/auth.log | sort -nr and then for…
Continue reading [Linux] How to list IP who successful & failed login into server by ssh
Comments closedwhen your magento on developer mode, but you still have to deploy static content each time you made some changes on static files such as…
Continue reading [Magento 2] Developer mode but static page not linked with modules/theme
Comments closedyou already modified /etc/default/varnish, but still not working? then you have to edit following file nano /lib/systemd/system/varnish.service change : ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80…
Continue reading Fixed Varnish Issue, not listen on port 80 (Ubuntu)
Comments closedprotected $formKey; protected $cart; protected $product; protected $session; public function __construct(MagentoFrameworkSessionSessionManagerInterface $session, MagentoFrameworkAppActionContext $context, MagentoFrameworkDataFormFormKey $formKey, MagentoCheckoutModelCart $cart, MagentoCatalogModelProduct $product, array $data = []) {…
Continue reading [Magento 2] Add Multiple Products Programatically
Comments closedssh -i yourkey.pem serverusername@server-ip filezilla : Edit (Preferences) > Settings > Connection > SFTP, Click “Add key file” that’s it
Continue reading Ubuntu : SSH Login with pem file
Comments closedmy first app build use React Native, https://play.google.com/store/apps/details?id=com.ansyori.todoappv2 horray
Continue reading My First React Native App
Comments closed$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager $resource = $objectManager->get(‘Magento\Framework\App\ResourceConnection’); $connection = $resource->getConnection(); $tableName = $resource->getTableName(‘your_table_name’); //Select Data from table $sql = “Select *…
Continue reading Magento2 : Custom Sql Directive
Comments closedselect a.*, mapping_id.value as attribute_value from catalog_product_entity as a, catalog_product_entity_varchar as attribute_table where attribute_table.entity_id = a.entity_id and attribute_table.attribute_id = (select attribute_id from eav_attribute where attribute_code…
Continue reading Magento2 : Sql query to get product attribute value
Comments closed$dir = Mage::getBaseDir(‘var’) ; unlink($dir.’/log/exception.log’); unlink($dir.’/log/system.log’); be careful, you can also delete other files :p
Continue reading [Magento]Delete Log Files Programatically
Comments closedhere example to load sales order data externally in magento 2, for example you’re going to use this url http://yourmagento2url/test.php <?php use Magento\Framework\App\Bootstrap; require __DIR__…
Continue reading [Magento 2] Run PHP code externally
Comments closedYes, it’s dirty…not a Magento 2 standard… so it just for who love ‘shortcut’ way to create own log file, let’s get started <?php namespace…
Continue reading [Magento 2] Dirty Way to Create Own Log File
Comments closedHave you ever try open some website from chrome mobile like facebook, instagram or other websites.. (actually i forgot ..haha..sorry) then you notice, the color…
Continue reading How to Apply Your Website Theme Color in Android Chrome
Comments closedhere you go $resource = Mage::getResourceModel(‘catalog/category’); $collection = Mage::getModel(‘catalog/category’)->getCollection(); foreach($collection as $category) { $category->setStoreId(0); // 0 for default scope (All Store Views) $category->setData(‘page_layout’, ‘two_columns_left’); $resource->saveAttribute($category,…
Continue reading [Magento] Update category attributes programmatically
Comments closedhere the sql… select entity_id, sku, ( select value from catalog_product_entity_int as y where attribute_id = (select attribute_id from eav_attribute where attribute_code = ‘status’ and…
Continue reading Magento : SQL Directive to Get Products with attributes
Comments closeduse SSH to perform this action, from your Magento root, use this command php bin/magento admin:user:create –admin-firstname=”Admin Fistname” –admin-lastname=”Admin Lastname” –admin-user=”admin_username” –admin-password=”admin_pass” –admin-email=”[email protected]”
Continue reading Magento 2 : Create Admin User From Shell
Comments closedfor example, we want to change ‘label’ and ‘sort order’ attribute ‘postcode’ from ‘customer_address’ attribute type, here upgrade data script <?php namespace MyCompany\MyModule\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use…
Continue reading Magento 2 : Update EAV Attribute
Comments closedlet’s say you want override this html template from your custom module (not from your custom theme) vendor\magento\module-checkout\view\frontend\web\template\shipping.html first, create a module, for example module…
Continue reading Magento 2 : Override HTML Template from Module
Comments closedin your ‘Company/Modulename/setup/InstallData.php’ here example code <?php namespace Company\Modulename\Setup; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\CustomerSetupFactory; class InstallData implements InstallDataInterface { private…
Continue reading Magento 2 : Add Customer Address Attribute
Comments closedhere example layout script how to add external JS & CSS link use Magento way 😉 <reference name=”head”> <block type=”core/text” name=”your_external_url”> <action method=”setText”> <text><![CDATA[ <!–…
Continue reading Magento : Add external JS & CSS from layout
Comments closedi found a nice tips to improve db performance & save some db space, by disabling Magento logs & report here the local.xml settings …
Continue reading Magento : Disable Logging & Report
Comments closedthis is an interesting post i found on StackExchange, how to filter product collection by multiple categories, here the code $productCollection = Mage::getModel(‘catalog/product’) ->getCollection()…
Continue reading Magento : Filter product collection by multiple categories
Comments closedAs a Magento Developer I think this is the best feature on magento to locate template file path & block type. Now I will show…
Continue reading Magento : Quick debug for template path hint & block
Comments closedHere short script to add new attributes & attributes set <?php require_once(‘app/Mage.php’); //Path to Magento umask(0); Mage::app(); function validateAttr($attr_name) { $attributeInfo = Mage::getResourceModel(‘eav/entity_attribute_collection’) ->setCodeFilter($attr_name)…
Continue reading Magento : Add New Attribute & Attribute Set Programatically
Comments closedbelow css code, to disable any related to css animation /*CSS transitions*/ -o-transition-property: none !important; -moz-transition-property: none !important; -ms-transition-property: none !important; -webkit-transition-property: none !important; transition-property: none…
Continue reading CSS: Disable CSS Animations
Comments closedlet say you want to styling overflow div bar, here example css .yourdiv::-webkit-scrollbar { background:red; width:5px; } .yourdiv::-webkit-scrollbar-track { background-color: #eaeaea; border-left: 1px solid #ccc;…
Continue reading CSS: Styling Scroll Bar
Comments closedit took couple days to figure this ‘shit’ out i assume you already understand how to create custom shipping method extension, for example on your…
Continue reading Magento : Change Shipping Price After Save Shipping Method
Comments closedhere we go <?php @mysql_connect(“you-db-host”,”username”,”password”); if(isset($_GET[‘kill’])): mysql_unbuffered_query(‘kill ‘.$_GET[‘kill’]); echo ‘<h1>Process Id : ‘.$_GET[‘kill’].’ has been terminated</h1>’; endif; $sql = ‘show full processlist’; echo ‘ <style>…
Continue reading Simple PHP Script to List & Kill Current Mysql Process
Comments closedhere my script get product collection who has tier price only!!!!!!!!!!!!!!!!!! of course also in stock :p $prefix = Mage::getConfig()->getTablePrefix(); $sql = ‘select distinct entity_id…
Continue reading Magento : Get product collection has tier price only
Comments closedTo filter Payment Method Options we can use observer, i assume you have knowledge of Magento module development, anyway let’s begin on config.xml, register an event…
Continue reading Filter Payment & Shipping Method on Checkout Page
Comments closedhere step how to working with controller, i will create 2 controllers file, my objective is, to run following url http://127.0.0.1/magento21/index.php/hellomagentoworld/index/index and http://127.0.0.1/magento21/index.php/hellomagentoworld/index/test create file app\code\Ansyori\HelloWorld\etc\frontend\routes.xml…
Continue reading Create Magento 2 Module (Controller) Part II
Comments closedhere my first step to understanding magento 2 module development by create hello world extension, haha: create file app/code/Ansyori/HelloWorld/etc/module.xml here module.xml file content <?xml version=”1.0″?> <config…
Continue reading Create Magento 2 Module (Basic) Part I
Comments closed$array_post = array( ‘var1’=>’content1’, ‘var2’=>’content2’, ); $array_post = http_build_query($array_post); $opts = array(‘http’ => array( ‘method’ => ‘POST’, ‘header’ => ‘Content-type: application/x-www-form-urlencoded’, ‘content’ => $array_post )…
Continue reading Magento : Create Fake POST
Comments closedWhen your magento implement in a country with small number digits currency like US or Major Europe countries this issue maybe will not happens, but…
Continue reading Magento : Fixed Issue Price or Total Amount Order More Than 100 Million
Comments closed