prestashop

Prestashop: Session cookies & login

自古美人都是妖i 提交于 2019-11-29 12:58:55
I would like some help with the fundamentals for making a centralized logon (front office) for Prestashop - a separate logon page. I have a Prestashop installation with multiple shops (multistore). I have tried the Webservices API but doesn't find any way to handle logins and session cookies. How do I do this? For example: In my Prestashop I've got three shops with three different URLs, such as: A => mydomain.com/a B => mydomain.com/b C => mydomain.com/c When a customer browses to the URL, mydomain.com (top of domain) a logon page will appear. The user logs in and gets redirected to the shop

how to generate a link to a module controller in prestashop?

跟風遠走 提交于 2019-11-29 09:11:08
问题 What's the exact way to generate a link to a module controller in prestashop? Also, how should really be named the controller's class and how the url params should mirror? 回答1: You will use an instance of the Link class. Generally you don't have to create one, just use context->link (ex. form a controller $this->context-link ). The method is getModuleLink() , so: $this->context->link->getModuleLink('module_folder_name','controller_name',array_of_params); Beware the naming: Module folder name

Prestashop: add customized product to cart

扶醉桌前 提交于 2019-11-29 00:41:30
I'm writnig a custom controller for Prestashop. It is suposed to do a simple task: 1. Create a new cart if it wasn't created (working fine) 2. Get attribute ID from database (working fine) 3. Assign customization (one text field) 4. Add this product to cart. My current code: $idProduct = 1; // for me it's always one $qty= 1; // always add one item $text = (string)Tools::getValue('textField9'); // string of text customization $attribute = (int)Tools::getValue('sel_combination'); // atribute combination ID // get cart id if exists if ($this->context->cookie->id_cart) { $cart = new Cart($this-

How do I find relations between tables that are long-distance related? MySQL

江枫思渺然 提交于 2019-11-28 13:03:37
问题 I have a problem with finding relations between tables ps_product and ps_carrier from a prestashop database. The schema is available at http://doc.prestashop.com/display/PS16/Fundamentals+of+PrestaShop+Development. I need to make an update by joining these two tables in my shop but I'm struggling with finding good keys. How do I compose my query? 回答1: Tables represent business relationships/associations. The "relation[ship]s" you mention are FKs (foreign keys), and which are not needed for

Get name of module in PrestaShop front controller

有些话、适合烂在心里 提交于 2019-11-28 12:45:26
问题 In PrestaShop (specifically v1.7.5) one can get an instance of the module class by calling $module = Module::getInstanceByName('theModuleName'); in the controller of a custom module. Is 'theModuleName' available via some other setting or variable or does it need to be hardcoded? It should also be used as first parameter to getModuleLink(). 回答1: You can access the module name (along with the rest from the module class) by: $theModuleName = $this->module->name; Using Prestashop core module

Add field in product Prestashop 1.7

久未见 提交于 2019-11-28 11:43:04
Why is prestashop don't save my modification into database? Using prestashop 1.7 /override/classes/Product.php class Product extends ProductCore { public $por_gan; public function __construct ($idProduct = null, $idLang = null, $idShop = null) { $definition = self::$definition; $definition['fields']['por_gan'] = array('type' => self::TYPE_INT, 'required' => false); parent::__construct($idProduct, $idLang, $idShop); } } In ProductInformation.php ->add('por_gan', 'Symfony\Component\Form\Extension\Core\Type\NumberType', array( 'required' => false, 'label' => $this->translator->trans('Beneficio',

TypeError: $(…).owlCarousel is not a function

一个人想着一个人 提交于 2019-11-28 07:37:10
问题 I am having troubles adding this carousel to my prestashop template. It returns me the following error: TypeError: $(...).owlCarousel is not a function navigation : true And the code using to initialize it is this one $(document).ready(function() { $("#owl-demo").owlCarousel({ navigation : true }); }); I am trying to solve it, but seems imposible, since on an empty html page it works but not when I use it on the Prestashop. Any clue? Thanks. 回答1: Add owl.carousel.min.js file in your home page

Prestashop: Session cookies & login

北慕城南 提交于 2019-11-28 06:46:23
问题 I would like some help with the fundamentals for making a centralized logon (front office) for Prestashop - a separate logon page. I have a Prestashop installation with multiple shops (multistore). I have tried the Webservices API but doesn't find any way to handle logins and session cookies. How do I do this? For example: In my Prestashop I've got three shops with three different URLs, such as: A => mydomain.com/a B => mydomain.com/b C => mydomain.com/c When a customer browses to the URL,

Show my module JS at footer in prestashop

ぐ巨炮叔叔 提交于 2019-11-28 01:44:17
I am developing a module in prestashop. I have a JS for configuration page for my module. I am using displayBackOfficeHeader hook to add my JS in header. But after installing my module when i configure my module it's give me Jquery issue because my JS in adding at top means before jquery.js Que 1) How to manage that my JS should add in header after Jquery.js ? Que 2) If we can't manage same as que Ist then how to add JS in footer? In most cases to add any asset (JavaScript or CSS) to a back-office (admin pages) you should use the hook actionAdminControllerSetMedia() . Full steps to register

How to create a new page in prestashop admin panel?

北城余情 提交于 2019-11-27 23:13:19
how to create a new page in prestashop admin panel? I tried using creating a new admin controller file and in that set the template path and i created a menu using admin panel and there i mentioned the controller class name for that menu. when i try to open that menu it always shows that controller not found. can anyone help me, how to create a new page in prestashop admin panel? am using PS 1.5 version. <?php class AdminPageController extends AdminController { public function __construct() { parent::__construct(); } public function initContent() { parent::initContent(); $this->setTemplate(_PS