Posts

Upload Multiple files to folder in Magento ,Magento2

Upload Multiple images in Magento, Magento2.                         /*   $fname get the all images and $upload change array to comma seperated */                         $fname = $_FILES['upload_file']['name'];                                   $upload = implode (", ", $fname);                                                                                       if(isset($_POST['submit_image']))    /*  submit_image   name of the submit button */                         {     ...

Add Read More OR View More at any place in between to other file

Add Read More at any place to open in next page. <?php $string = $col->getDetails();     /*  Collection data getting is equal to string   */                  if (strlen($string) > 25) {                  $trimstring = substr($string, 0, 250). ' <a href="event/index/new"> Readmore... </a>';                   } else {                   $trimstring = $string;                   }                   echo $trimstring;                   ?>

UPload Single File In Magento

Upload Single file in Magento <?php /* UPLOAD FILE IN MAGENTO  [filename = name of file ]*/    if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '')                     {                         try                         {                                 $path = Mage::getBaseDir('media').DS."vendorplace/uploadedfiles/uploadfiles".DS; //desitnation directory where upload files are saved                             $fname = $_FILES['filename']['name']; //file name  comes out                             // echo "<pre>++++"; ...

Create a new Website ,Store and Store View by Programming in magento2

Create a file with any name in root and run it. <?php ini_set('display_errors', 1); error_reporting(E_ALL | E_STRICT); use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); $storeManager = $obj->get('\Magento\Store\Model\StoreManagerInterface'); $websiteFactory = $obj->get('\Magento\Store\Model\WebsiteFactory'); $groupResourceModel=$obj->get('Magento\Store\Model\ResourceModel\Group'); $storeFactory=$obj->get('Magento\Store\Model\StoreFactory'); $groupFactory=$obj->get('Magento\Store\Model\GroupFactory'); $eventManager=$obj->get('Magento\Framework\Event'); $storeModel     = $obj->create('Magento\Store\Model\Store'); $new_store = $websiteFactory->cr...

Create website ,store and storeview through programmatically for Magento2

(1) Save this in file in root and run it . it will create automatically <?php ini_set('display_errors', 1); error_reporting(E_ALL | E_STRICT); use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); $storeManager = $obj->get('\Magento\Store\Model\StoreManagerInterface'); $websiteFactory = $obj->get('\Magento\Store\Model\WebsiteFactory'); $groupResourceModel=$obj->get('Magento\Store\Model\ResourceModel\Group'); $storeFactory=$obj->get('Magento\Store\Model\StoreFactory'); $groupFactory=$obj->get('Magento\Store\Model\GroupFactory'); $eventManager=$obj->get('Magento\Framework\Event'); $storeModel     = $obj->create('Magento\Store\Model\Store'); $new_store = $websiteFactory->create(...

Add custom attribute for category

Image
Follow bellow steps Step : 1  app\etc\modules\AR_Dbchange.xml <? xml version = "1.0" ?> <config> <modules> <AR_Dbchange> <active> true </active> <codePool> local </codePool> </AR_Dbchange> </modules> </config> Step : 2  app\code\local\AR\Dbchange\etc\config.xml <? xml version = "1.0" ?> <config> <modules> <AR_Dbchange> <version> 0.1.0 </version> </AR_Dbchange> </modules> <global> <resources> <ar_dbchange_setup> <setup> <module> AR_Dbchange </module> <class> Mage_Catalog_Model_Resource_Eav_Mysql4_Setup </class> </setup> </ar_dbchange_setup> </resources> </global> </config> Step : 3 ...

ADD NEW FIELD CUSTOMER REGISTRATION FORM IN MAGENTO

Image
Step 1: Create file app/etc/modules/Jwd_Customer.xml Add this code 1 2 3 4 5 6 7 8 9 <?xml version="1.0" encoding="UTF-8"?> <config>      <modules>          <Jwd_Customer>          <codePool>local</codePool>          <active>true</active>          </Jwd_Customer>      </modules> </config> Step 2: Create files and folder app/code/local/Jwd/Customer/etc/config.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 <?xml version="1.0"?> <config>      <modules>          <Jwd_Customer>              <version>1.7.0.0</version>  ...