prestashop

Add custom field in Prestashop 1.7.6 category with a module. How to save in database?

余生长醉 提交于 2019-12-04 05:45:18
问题 I'm creating a module in Prestashop 1.7.6 to add some custom fields in my categories administration page. Here is my code (from this source in French, new Symfony model used) : modules/categorycustomfields/categorycustomfields.php class Categorycustomfields extends Module { protected $config_form = false; public function __construct() { $this->name = 'categorycustomfields'; $this->tab = 'administration'; $this->version = '1.0.0'; $this->author = 'abc'; $this->need_instance = 0; $this-

Prestashop 1.6 get instance of module class

给你一囗甜甜゛ 提交于 2019-12-03 22:34:36
问题 I have an overridden class OrderConfirmationControllerCore . I have a modul with class Abra . I need to get an instance of Abra class in the OrderConfirmationControllerCore My code is: class OrderConfirmationController extends OrderConfirmationControllerCore { public function init() { $abraSetDocs = new Abra(); parent::init(); } } This generates error: Fatal error: Class 'Abra' not found in /../override/controllers/front/OrderConfirmationController.php on line 39 How can I get the instance of

Prestashop Web Service API keeps asking for authentication

倖福魔咒の 提交于 2019-12-03 22:17:31
I am having this problem I enabled the webservice from prestashop and I can access it if I write the URL directly passing the parameter from post method http://underwearstudio.mx/pruebas/api?&ws_key= "mykey". But If I try to access without passing the ws_key as parameter it keeps asking me to authenticate. From what I read when authentication is prompted you need to use the API key as username and leave the blank password, but it just keeps prompting the authentication. What can I do? I was trying to follow this tutorial.( http://doc.prestashop.com/display/PS15/Chapter+2+-+Discovery+-+Testing

Prestashop how to add static contents in different language in tpl file

戏子无情 提交于 2019-12-03 21:42:01
I need add some custom text in Prestashop template file, but there are two languages in my store, and I want to add these contents in different language statically? Can I check current language by language id? statically {if $lang_iso == en } english text {else} Other language {/if} You have multiple ways to achieve this goal depending on the kind of .tpl file you are editing: If it is a .tpl in your Theme, the easiest way is: {l s='My text to translate'} If it is .tpl file included in a module, you should do the following: {l s='My text to translate' mod='modulename'} In both situations,

Add Google AdWords Conversion Tracking (javascript) code into a PrestaShop / Smarty page

对着背影说爱祢 提交于 2019-12-03 21:32:35
I'm running a PrestaShop site and want to integrate it with Google AdWords and with the Conversion Tracking feature. The PrestaShop code is in Smarty 3. Now I've found that I could put Google's JS code at the end of a tpl file: order-confirmation.tpl. Here's the google code: <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = <my id>; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "<my label>"; var google_conversion_value = {$total}; /* ]]> */ </script> <script type="text

Mac OS: Intl extension is not loaded

时光怂恿深爱的人放手 提交于 2019-12-03 19:17:04
问题 macOS Mojave 10.14.3 PHP 7.1.23 Prestashop 1.7.5.1 I tried to install PHP intl extension on my local server in order to use Prestashop. I added extension=php_intl.so to etc/php.ini When I try to install Prestashop I get Intl extension is not loaded . $ php -m | grep intl When I do $ php -m | grep intl , I get: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/php_intl.so' - d lopen(/usr/local/lib/php/pecl/20160303/php_intl.so, 9): image not found in

PrestaShop create customer

老子叫甜甜 提交于 2019-12-03 15:39:25
I have this code where I am trying to create a new customer on my website using prestashop mode. But I keep getting error in the response NSString *xmlPath = [[NSBundle mainBundle] pathForResource:@"Login" ofType:@"xml"]; NSString *xmlStr = [[NSString alloc] initWithContentsOfFile:xmlPath encoding:NSUTF8StringEncoding error:nil]; NSString *encodedurlstring = (__bridge NSString*) CFURLCreateStringByAddingPercentEscapes (NULL, (__bridge CFStringRef) xmlStr, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]",kCFStringEncodingUTF8); NSString *urlStr = [NSString stringWithFormat:@"http://passkey:@farma-web

Prestashop compared to Zen-Cart and osCommerce [closed]

馋奶兔 提交于 2019-12-03 13:25:01
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I'm considering Prestashop for a new project. It seems to be younger than Zen-Cart and osCommerce. Since I just found it by Google, I

PHP curl returning strange characters

依然范特西╮ 提交于 2019-12-03 13:11:23
I am trying to update a page with image products of a Prestashop instance. I am getting the information using prestashop web services. The problem is when I load the page , it asks me the Token/key of the prestashop but I would want to save the login session using the Url and the key which I pass from by CURL and not entering the key each time. However the output of curl_exec is some strange characters like ��#B��R��$3br� Here is the function to save the session: function saveSession($url, $key){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, $key.':'

Prestashop Web service to return JSON

旧街凉风 提交于 2019-12-03 12:40:36
问题 After extensive search over internet i am sure that Prestashop does not return data in JSON format, it only returns in XML format (which leads to cross domain accessing issue unfortunately). Now, I am trying to convert XML(returned by Prestashop) to JSON. I want to write php code which could take XML from web service and sent back JSON. For this purpose i tried many tutorial but in vain. The converted JSON does not have value in it, so is useless. The methods i tried are listed below. http:/