prestashop

Prestashop custom admin module draggable sort/order not working

匆匆过客 提交于 2019-12-12 14:30:14
问题 I'm building a very simple module for Prestashop 1.6 and I added an admin interface that allows to list my records, a form to add and edit and delete. This is working fine as you can see here: The problem is that draggable reorder button is not draggable. Hence the reordering is not working... According to the official docs, if you set the position option in your controller, you get the draggable functionality: ['position'] => 'position', // If set to position, the field will display arrows

How to call a php function inside a smarty .tpl file?

为君一笑 提交于 2019-12-12 11:00:03
问题 Hi i have written a function in .php file. i.e. public static function getCategories($id_lang = false, $active = true, $order = true, $sql_filter = '', $sql_sort = '',$sql_limit = '') { if (!Validate::isBool($active)) die(Tools::displayError()); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT * FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category` WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)($id

Prestashop: How to get accessories for product

允我心安 提交于 2019-12-12 10:08:07
问题 how can I get accessories for each product? In a loop: {foreach $products as $product} // get accessories {/foreach} 回答1: The problem is that the module HomeFeatured doesn't retrieve accessories for products so they aren't available in the template. You have the choices : edit the PHP code of the module : simple but not upgrade proof duplicate the module to myhomefeatured : easy too but less, and upgrade proof I prefer the 2nd, more future proof & you can add more and more logic after if you

PrestaShop create customer

。_饼干妹妹 提交于 2019-12-12 08:09:18
问题 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)@"!*'();:@&=+$,/?%

PHP curl returning strange characters

旧城冷巷雨未停 提交于 2019-12-12 07:56:20
问题 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,

Prestashop - change product category in database

北城以北 提交于 2019-12-12 05:53:50
问题 I need to mass change product categories. I updated two tables in database: ps_category_product (changed old id_category) and ps_products (changed old id_category_default) but in BO product table and webshop I still see old category (home). When I edit product, select tab associations I see that product is associated with my new caterogy. Only when I save the product by click save button I see that product in properly categories. I compared two rows in database (product with changed category

prestashop multiple checkboxes do not save values

断了今生、忘了曾经 提交于 2019-12-12 05:36:31
问题 I can't figure out why the checkbox values are not saved in the database using helpers. Trying to save some customers ids from my module's setting : The array : $custs = Customer::getCustomers(); foreach ($custs as $key => $value) { $options[] = array( 'id_customer' => (int)$value['id_customer'], 'infos' => $value['firstname'].' '.$value['lastname'].' | '.$value['email'] ); } The checkboxes : 'input' => array( array( 'type' => 'checkbox', 'label' => $this->l('Customers'), 'desc' => $this->l(

Filter employees by profile_id in back office Employees tab

喜夏-厌秋 提交于 2019-12-12 04:54:54
问题 i try to apply a filter by profile on my tab "employees" in back-office, just need to list the employees with profile_id = 6. I found this part of code in AdminEmployeesController.php, line 175 to 184 : public function renderList() { $this->_select = 'pl.`name` AS profile '; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = ' .(int)$this->context->language-

PrestaShop - Login programmatically

ぃ、小莉子 提交于 2019-12-12 04:47:02
问题 I am writing a android and windows native app. The native app stores the login details as reated for mulitple other web apps, and logs them into this when browsing to them from the native app. one of the buttons in my app open a prestashop site for a authenticated user. How can i set the username and password and log that user in to the site programmitcally, giving the illusion and user experience that he has been seemlessly authenticated and accessed to his shop. 回答1: Basically do the same

Prestashop - Paypal Web hosted Solution IFrame Integration

不羁的心 提交于 2019-12-12 04:44:21
问题 I'm working on Paypal web hosted solution (sand box). In that i would like to integrate with IFrame. but when i integrate sometime the iframe is loaded but when i work with new browser or new proxy server it does not load the iframe. rather if i logged already in paypal account. the iframe is loading the problem is that iframe should work when i load the page. Thanks 回答1: To clarify: Hosted Solution is a new product that allows irame in templateD mode. https://cms.paypal.com/cms_content/GB/en