Jump to content

langziyang

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by langziyang

  1. Firstly,i use https://validator.prestashop.com/generator generate new module,name "mymodule" then,i use compoer init to generate composer json like this: { "name": "jinber/mymodule", "autoload": { "psr-4": { "Jinber\\Mymodule\\": "src/" }, "classmap": [ "mymodule.php", "controllers/", "classes/" ] }, "require": {}, "config": { "preferred-install": "dist", "classmap-authoritative": true, "optimize-autoloader": true, "prepend-autoloader": false } } next i use composer require wechatpay/wechatpay to install this sdk now,my vendor like this: this sdk use guzzlehttp 7+ when i follow sdk doc created some code, i got error: AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\\Utils::chooseHandler() in /www/wwwroot/p.shoucangjie.xin/modules/mymodule/vendor/guzzlehttp/guzzle/src/HandlerStack.php:49\nStack trace:\n#0 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/vendor/wechatpay/wechatpay/src/ClientXmlTrait.php(123): GuzzleHttp\\HandlerStack::create()\n#1 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/vendor/wechatpay/wechatpay/src/ClientDecorator.php(103): WeChatPay\\ClientDecorator::xmlBased()\n#2 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/vendor/wechatpay/wechatpay/src/Builder.php(43): WeChatPay\\ClientDecorator->__construct()\n#3 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/classes/WePayServer.php(9): WeChatPay\\Builder::factory()\n#4 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/mymodule.php(244): WePayServer->jsapiPay()\n#5 /www/wwwroot/p.shoucangjie.xin/modules/mymodule/controllers/front/jsapi.php(12): Etrestapi->getPayInfo()\n#6 /www/wwwroot/p.shoucangjie.xin/classes/contro...', referer: https://servicewechat.com/wx8bf53686614eb4e6/devtools/page-frame.html no matter include vendor/autoload.php or not and run composer dump-autoload on modules/mymodule/ . always show this error note: this sdk in symfony project work fine and chooseHandler function exists
  2. http://www.domain.com/api/product/?ws_key=VQ53VDUZLEDMHW444911GHDJWA4WBNYG&language=1&output_format=JSON&display=full&id_category=3&attribute=3 i can use this like to filter product,but if i have two and more attribute or id_category,how get it?
  3. this module can update image to CDN, your server only need one origin image. no need resize other small image. https://github.com/langziyang/etcloudimage
  4. https://devdocs.prestashop.com/1.7/modules/concepts/forms/admin-forms/ this doc is add new field to admin configuation but if i want add other options to caching type like: Memcache CacheMemcached CacheApc Xcache MyOptions can any one help me?
  5. when i edit/add product on backoffice,i want display some filter suppliers(use condition to display some supplier on php),which hook can do it? or any other way do it?
  6. hi,i want add new field on product list page,i register hook ActionProductGridDefinitionModifier. but not work.how change it?
  7. hi,if i want create new module like mymodule and i want install third party library on modules/mymodule/libraries/ but the third party library use composer install it like: composer require alibabacloud/alimt which is the best way to install it?just run the command?or other best way?thanks
  8. no, new OwnObject(primaryid) will be ok. i sure is $object = new OwnObject(); $object->id=primaryid; object->save();
  9. if i have own ObjectModule; fields and data is fields_id, fields_a, fields_b, fields_c, primary id is fields 1 11 11 11 2 22 22 22 now do this: $object=new OwnObject(); $object->id=2; $object->fields_b='222'; $object->save(); when exec save() function; fields_a and flelds_c will be 0
  10. hi,i have new module name is "etalimama" this is my tab code: $moduleName = $this->name; TabManager::addTab('AdminTaoBao', 'TaoBao', $moduleName, 'AdminTools'); i have admin controller on etalimama/controllers/admin/AdminTaoBaoController.php <?php //etalimama/controllers/admin/AdminTaoBaoController.php namespace EtAliMaMa\Controller\Admin; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use PrestaShopBundle\Security\Annotation\AdminSecurity; use Symfony\Component\HttpFoundation\Response; class AdminTaoBaoController extends FrameworkBundleAdminController { /** * @see https://devdocs.prestashop.com/1.7/development/architecture/migration-guide/controller-routing/#security * @AdminSecurity( * "is_granted(['read'], request.get('_legacy_controller'))", * message="You do not have permission to access Exemple page." * ) * * @return Response */ public function indexAction() { return $this->render("@Modules/etalimama/views/templates/admin/index.html.twig"); } } then,this is my composer.json on etalimama/composer.json { "name": "prestashop/alimama", "description": "A module for etalimama", "autoload": { "psr-4": { "EtAliMaMa\\": "controllers/" } }, "license": "MIT", "type": "prestashop-module" } routes.yml on config/ etalimama_admin_index: path: etalimama methods: [GET] defaults: _controller: 'EtAliMaMa\Controller\Admin\AdminTaoBaoController::indexAction' _legacy_controller: 'AdminTaoBao' _legacy_link: AdminTaoBao i run command on modules/ and modules/etalimama/ composer dumpautoload when i view admin tab.then say: Class "EtAliMaMa\Controller\Admin\AdminTaoBaoController" does not exist. please tell me why?
  11. when i set _PS_DEBUG_PROFILING_ = true this is my website profiling: the Category.php query too long.how to optimize it
  12. i am Chinese,i use ban wire get my addons money,but It’s been tow months,i haven't get the money yet. can anybody tell me how long get your money?
  13. i have test the multishop,and the image is my shop data i give each store an employee. when i add product on test5 shop,why the test3 shop can see the product?i down want test3 or other shop use the product.how to config it?
  14. class AdminTabsController extends AdminTabsControllerCore { public function renderList() { $this->_where .= 'not working'; return parent::renderList(); } } the $this->_where not working
  15. in my module,hootDisplayHeader function ,i add this code $this->context->controller->addJqueryUi('ui.datepicker'); on my tpl file i add this code: <input id="travel_date" type="text" data-hex="true" class="datepicker hasDatepicker" name="travel_date" value=""> and the js file add: $("#travel_date").datepicker(); but the datepicker is not gender,is it the bug?
  16. i create module,have sdk use composer get it.so i use the code include require_once(dirname(__FILE__) . '/libraries/vendor/autoload.php'); when i view the moduel config page,i get the error: FatalThrowableError in E:\wamp64\www\ps17\modules\etwechat\libraries\vendor\guzzlehttp\guzzle\src\Client.php line 128: Type error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in E:\wamp64\www\ps17\modules\etwechat\libraries\vendor\guzzlehttp\guzzle\src\Client.php on line 89 in E:\wamp64\www\ps17\modules\etwechat\libraries\vendor\guzzlehttp\guzzle\src\Client.php line 128 at Client->request('setDefaultOption', 'verify', 'E:\wamp64\www\ps17/app/cache/dev\cacert.pem') in Client.php line 89 at Client->__call('setDefaultOption', array('verify', 'E:\wamp64\www\ps17/app/cache/dev\cacert.pem')) in ApiClient.php line 64 at ApiClient->setSslVerification('E:\wamp64\www\ps17/app/cache/dev\cacert.pem') in ModuleManagerBuilder.php line 165 at ModuleManagerBuilder->__construct() in ModuleManagerBuilder.php line 74 at ModuleManagerBuilder::getInstance() in AdminModulesController.php line 1141 at AdminModulesControllerCore->postProcess() in Controller.php line 194 at ControllerCore->run() in Dispatcher.php line 379 at DispatcherCore->dispatch() in index.php line 95
  17. i have one module,on config page i render some helperlist.the code is this: protected function renderList() { $query = new DbQuery(); $query->select('*'); $query->from('carrier'); $query->where('active=1 AND deleted=0'); $rates = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query->build()); $fields_list = array( 'id_carrier' => array( 'title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs' ), 'name' => array( 'title' => $this->l('Carrier') ), 'test' => array( 'title' => $this->l('test'), 'callback' => 'getSetCarrier', ), 'active' => array( 'title' => $this->l('Active'), ) ); $helper = new HelperList(); $helper->shopLinkType = 'shop'; $helper->simple_header = true; $helper->actions = array("edit"); $helper->show_toolbar = false; $helper->module = $this; $helper->listTotal = count($rates); $helper->identifier = 'id_carrier'; $helper->title = ''; $helper->table = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; return $helper->generateList($rates, $fields_list); } public function getSetCarrier() { return 'aaa'; } in the renderList function,i set the callback is getSetCarrier. And in getSetCarrier function,i return string 'aaa'. but,the carrier list is not echo 'aaa'
  18. the module js file before the jquery-1.11.0.min.js. so the js error is: Uncaught ReferenceError: $ is not defined at back.js:28 this is my code public function hookDisplayBackOfficeHeader() { if (Module::isInstalled($this->name) && Module::isEnabled($this->name) && ($this->context->controller instanceof AdminSplitStatus || $this->context->controller instanceof AdminOrdersController)) { $this->context->controller->addJS($this->_path . 'views/js/back.js'); } } how fix it?
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More