Jump to content

gonebdg - webindoshop.com

Members
  • Posts

    1,491
  • Joined

  • Last visited

  • Days Won

    1

gonebdg - webindoshop.com last won the day on November 5 2011

gonebdg - webindoshop.com had the most liked content!

7 Followers

Contact Methods

Profile Information

  • Location
    Bandung
  • Activity
    Developer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

gonebdg - webindoshop.com's Achievements

  1. I'm not sure why almost nobody reply to this thread, even the Prestashop team. Prestashop Doc. also doesn't mentioned about this issue and cannot found any clue at all on Prestashop bugs tracker https://devdocs.prestashop.com/1.7/modules/creation/module-translation/classic-system/ I just remember and back to this thread again because my client who still use PS 1.7.6.x had a translation problem with one of my module front controller file. So here it is the work around of this problem : For ModuleFrontController file the PHP code which should be use to make the translation work should be written like this : $this->l('Text to translate', 'controller_filename'); // OR $this->module->l('Text to translate', 'controller_filename'); Example if your ModuleFrontController filename is default.php, then the PHP code for the translation text should be like this : $this->l('Text to translate', 'default'); // OR $this->module->l('Text to translate', 'default');
  2. PROBLEM SOLVED Basically it's so simple ... but sometime forgotten OrderController.php yet declare the necessary class which require to call the corresponding class method. So simply (add) declare following code in the top of the file along with the available code declarations use Db; use PrestaShopDatabaseException;
  3. Ok please forget about order message issue, since I already figuring out what is the cause of the problem. NOTE: order message issue in here are happened on Dev Site which are the upgraded version from an old PS version the related/necessary data are missing from the database which cause order message are not displayed on admin order Back to the topic of this thread which is "How to call class method in OrderController ?" I guess since PS 1.7.7.0 we can't call Prestashop class method anymore directly from PS-symfony controller we had to override the related controller by creating custom module and then call PS class method from there If someone know how to call Prestashop class method (directly) inside PS-symfony controller please let me know how ...
  4. Hmmm ... I'm not sure what is wrong with my dev site on live server because in my locahost the order message was displayed normally and the debug code show the messages as it should. However I still can't figuring out how to call class method inside Prestashop > Symfony controller ... $debug_message = $orderForViewing->getMessages(); dump($debug_message); exit;
  5. Anyone ??? The reason I would like to do this is because I couldn't get the order message from `ps_message` DB table from this code $debug_message = $orderForViewing->getMessages(); dump($debug_message); exit;
  6. Does anyone know how to call Class method inside OrderController.php > viewAction ? For example, I'm trying to get the related order message from db table `ps_message` with this method $message = Message::getMessagesByOrderId($orderId); But it's error
  7. Reference: https://devdocs.prestashop.com/1.7/modules/creation/module-translation/new-system/ PrestaShop version: 1.7.6.1 Debug mode: Active Hello, I've been monitoring this issues since PrestaShop 1.7 releases, so I was using the Classic translation system for my module until now. PrestaShop 1.7.6.2 has been released and I still get a problem with New module translation system 1.7.6.x. Here we go ... My custom module name is `Ecmo` (ecmo.php) and it had two Admin controllers files: adminecmo.php and AdminEcmoTwo.php also had two Front controllers: sales.php and product.php In my core module file ecmo.php I decide to use "translation domain naming scheme" : 'Modules.Ecmo.Core' and it working fine where the translations text appearing normally in Admin > International > Translations >> Modules >>> Ecmo : Core and the translation text also working fine when displayed on Admin Installed modules. e.g : $this->displayName = $this->trans('Export CSV Master Order', array(), 'Modules.Ecmo.Core'); The problem begin when I'm starting to develop Admin Module Controller : adminecmo.php which is extending AdminOrdersControllerCore >> class AdminEcmoController extends AdminOrdersControllerCore When opening the Admin Module Page an error displayed: Call to a member function trans() on null That happen if I'm following the new module translation system as stated on the references. e.g: (this should work but it doesn't) $this->trans('ID', array(), 'Modules.Ecmo.Adminecmo') Next I was thinking that maybe it doesn't work because in this controller I was extending "AdminOrdersControllerCore" instead "ModuleAdminController", so I try another approach and still get an error (a different error) Call to protected method ModuleCore::trans() from context 'AdminEcmoController' That happen if I'm using this approach : $this->module->trans('ID', array(), 'Modules.Ecmo.Adminecmo') Note: $this->module has been defined on the __construct() method. $this->module = Module::getInstanceByName('ecmo'); Next I try another approach which is working but this approach doesn't following the standard coding as stated on the references. $this->context->getTranslator()->trans('ID', array(), 'Modules.Ecmo.Adminecmo') Note: $this->context has been defined on the __construct() method. $this->context = Context::getContext(); Now let's continue with the other Admin controller on my module: AdminEcmoTwo.php which is extending ModuleAdminController >> class AdminEcmoTwoController extends ModuleAdminController and the same problem happening so the same workaround also applied. The Question: Is this a bugs or just an error on my module ? Why $this->trans method doesn't work on my module Admin Controller ? I didn't check the bugs tracker yet but already searching the similar topic on the forum but did not find an answer. I didn't yet digging into the related core Prestashop to figuring out why this problem happening. Also this discussion yet talking about the translation my module front controller.
  8. PrestaShop Meetup Session 7 insya allah diadakan pada Hari : Sabtu 7 April 2018 Pukul : 17.00 WIB s/d 21.30 WIB Lokasi : Ludwick Café Bandung https://goo.gl/maps/og43rE7TiMx Jalan Budi Luhur I No.11B, Gegerkalong, Sukasari Kota Bandung, Jawa Barat 40153 (022) 87783428 https://www.meetup.com/Prestashop-Bandung-Ecommerce-Meetup/events/249029029/
  9. ganti nama directory /admin/ dengan nama lain, jgn lupa hapus directory /install/
  10. sama saja utk web server localhost maupun live, coba anda cermati lagi uraian diatas dan coba anda implementasikan.
  11. Untuk diketahui bagi yang mengalami masalah `lola` alias loading lama, khusunya saat mengunjungi halaman Admin Dashboard dan Admin Modules. Saat mengunjungi halaman Admin Modules, PrestaShop anda akan berupaya untuk terkoneksi ke situs PrestaShop Addons untuk memeriksa dan mengambil daftar dan data modules (native, must have, bought) berdasarkan file berekstensi XML yang diciptakan dan disimpan di ../config/xml/ File-file XML tsb akan diperbarui kembali dalam jangka waktu tertentu (ada yang per minggu dan ada yang perhari) Process tsb akan memakan waktu lama bahkan bisa berakhir error, apabila : Koneksi internet yang anda gunakan lambat Ada permasalahan DNS pada jaringan internet yang digunakan (tidak peduli secepat apapun koneksi internet anda) sehingga koneksi ke situs PrestaShop Addons dari Indonesia terganggu Ada permasalahan pada sistem/situs PrestaShop Addons sendiri (*.prestashop.com, addons.prestashop.com, *.prestastore.com) Ada permasalahan dengan networking server anda Memory limit server anda kurang memadai Bagaimana solusinya ? Jika memiliki VPN, silahkan coba gunakan koneksi melalui VPN. JIka bisa dan memiliki tunelling, silahkan gunakan koneksi internet dengan tunelling. Kedua hal tsb akan meyelesaikan masalah jika penyebab permasalahan adalah DNS sebagaimana disebutkan pada poin-2 Salah satu caranya adalah menonaktifkan pemeriksaan dan pengambilan data modules tersebut, dengan cara mengedit classes file ../classes/modules.Module.php Untuk PrestaShop 1.6 lihat line: 1445-1537 sedangkan untuk PrestaShop 1.7 lihat line: 1388-1484 Sebelum // Get Default Country Modules and customer module $files_list = array( array('type' => 'addonsNative', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0), array('type' => 'addonsMustHave', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_MUST_HAVE_MODULES_LIST, 'loggedOnAddons' => 0), array('type' => 'addonsBought', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1), ); foreach ($files_list as $f) { ... code php lainnya disini ... } Sesudah (ubah menjadi sebagai berikut) : // Get Default Country Modules and customer module // $files_list = array( // array('type' => 'addonsNative', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0), // array('type' => 'addonsMustHave', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_MUST_HAVE_MODULES_LIST, 'loggedOnAddons' => 0), // array('type' => 'addonsBought', 'file' => _PS_ROOT_DIR_.self::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1), // ); $files_list = array(); if ($files_list) { foreach ($files_list as $f) { ... code php lainnya disini ... } } Perubahan dilakukan dengan menonaktifkan 5 baris code dengan php commenting (tambah // didepan baris kode) kemudian mendefinisikan variable $file_list sebagai array kosong. Dengan demikian proses pemeriksaan dan pengambilan data modules (native, must have, bought) tidak akan dilakukan karena array variabel $files_list ditentukan menjadi array kosong dan proses foreach loop tidak akan dilakukan dan tidak akan ada koneksi diperlukan ke situs PrestaShop Addons dan pemuatan halaman Admin Modules pun akan berlangsung dengan cepat. Konsekwensi yang perlu diketahui dari perubahan diatas. Data module terkait, tidak akan diperiksa, tidak akan diperbarui, tidak akan ditampilkan. Daftar module yang ditampilkan di Admin Modules anda hanya akan menampilkan daftar modules yang ada di dalam direktori ../modules/ dan data modules yang sebelumnya telah berhasil dimuat (tersimpan dalam file XML). Jika merasa tidak perlu memperoleh data modules terkini berikut segala informasi pembaruannya, maka silahkan lakukan hal berikut ini : Hapus semua file XML dalam direktori ../config/xml/ Tidak perlu khawatir dengan proses penghapusan file XML tsb, karena tidak akan menyebabkan error apapun, dan file XML yang dihapus akan diciptakan kembali oleh sistem PrestaShop. Edit classes file ../classes/Tools.php dan cari/ubah : (berlaku untuk PrestaShop 1.6 dan 1.7) Sebelum protected static $is_addons_up = true; Sesudah (ubah menjadi sebagai berikut) : protected static $is_addons_up = false; dengan demikian nantinya saat generasi file XML dilakukan, beberapa file XML konten nya akan kosong dan yang lainnya hanya seperlunya. Bagi yang tidak ingin memperoleh dan tidak ingin menampilkan informasi PrestaShop di Admin Dashboard karena proses informasi tsb dapat menyebabkan `lola` juga saat membuka/mengunjungi halaman admin Dashboard karena alasan yg sama, silahkan lakukan hal berikut : Hapus file XML ../config/xml/blog-en.xml dan ../config/xml/blog-id.xml (serta yang lainnya jika terdapat bahasa lainnya yang terpasang di PrestaShop anda) Edit file ../controllers/admin/AdminDashboardController.php (berlaku untuk PrestaShop 1.6 dan 1.7) Tambahkan 2 baris kode PHP dalam method ajaxProcessGetBlogRss() public function ajaxProcessGetBlogRss() { $return = array();// tambahkan ini die(Tools::jsonEncode($return));// dan ini ... code php asli/lainnya disini ... } Selain dari pada apa yang telah diuraikan diatas, jika masih mengalami `lola` di Admin, maka periksa module-module pihak ketiga yang aktif digunakan serta periksa konfigurasi server hosting anda.
  12. Coba periksa dengan browser developer tools, mungkin filed tsb tersembunyikan (hidden) karena CSS.
  13. "Cannot retrieve test results" mean no data yet, and it can be happen if Google Analytics (ganalytics) module yet installed & configured. If you just install the Google Analytics API (gapi) module but yet install Google Analytics (ganalytics) module then there wont be any analytics data. You have to install Google Analytics (ganalytics) module first and make sure it working well then wait for a few days until the analytics data gathered. Next Google Analytics API (gapi) module can be installed & configured and and you will get the result.
  14. Product meta_title characters limit is controller by it's classes Product.php, size = 128 it's also set as `Length/Values` of database table ps_product_lang column meta_title If you want to have more than 128 characters, you have to modify/override Product class, set the size value more than 128 also don't forget to change the related DB table columns as mentioned above However it's not recommended, and I suggest you to create custom module which able to add extra text after meta_title where the module should have it's own database table to store the necessary/related data.
  15. I believe you are talking about module mailalert You should select the shop context instead all shop context (it's available on the top, before Cart icon) Then you can set different Merchant Email address per shop and save Almost all modules settings can had it's own settings value for each shop
×
×
  • Create New...