问题标签 [prestashop-modules]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1222 浏览

php - PrestaShop: How to get a ProductListingLazyArray out of my products

I'm pretty new to PrestaShop - so sry if i ask basic thing

I'm currently working on a module which should display products you chose in the backend as additional section in the default products template - like "highly recommended products"

I finish the whole Backend part, and get the ID's as an array of the chosen products.

As I mentioned I wanna use the default templates which are available after a fresh installation and what I found is placed here themes\classic\templates\catalog\_partials\products.tpl.

Now my big problem is: I'm not able to get the data like it should be ...

If I debug e.g. the products which are displayed in the default search behaviour (this uses this template too) I see something like

but as I get my products with

it is no ProductListingLazyArray ... its just an array with products ... and i dont see anything in the frontend (of course I dont, cause e.g. {$product.id_product} doesnt look like this in my array ...

Have you any ideas what I can do to "transform" my array of products to an ProductListingLazyArray ?? Or is my thinking wrong ?

THANKS to you all!

0 投票
1 回答
643 浏览

php - 在 prestashop 1.7 上呈现承运人/运输清单并与订单绑定以进行定制运输

在 prestashop 1.7 中,我使用了 API(freightquote)来获取可用的承运人/运输提供商。在CheckoutDeliveryStep.php课堂上我写了以下内容

并在这个函数中渲染

它在订单控制器页面上显示承运人列表。但是选择该项目不会更新或被选为承运人。从 prestashop 管理后端添加的运营商在运营商列表中运行良好。如何将自定义承运人绑定到购物车订单作为常规结账流程?谢谢

0 投票
1 回答
107 浏览

php - 来自php的字符串作为smarty中的文字

我正在构建 prestashop 模块,在配置页面中我有输入字段,用户应该在其中输入 javascript 代码块。

我得到那个代码并将它保存到 smarty 但是当我把它放在 smarty 中时

我把它当作字符串。如何退出字符串并将此值用作代码块。

0 投票
1 回答
750 浏览

php - Prestashop 1.7 Hook actionCustomerAccountAdd 未触发

我正在尝试在我的自定义模块中添加一个钩子,但是在我在 prestashop 后台或使用 web 服务中添加一个客户后它没有被触发。

我要注册的钩子名称是“actionCustomerAccountAdd”。

这是模块的相关代码。请问你能帮帮我吗?我是一名 PHP 开发人员,但这是我第一次在 Prestashop 方面进行开发。

我有这个代码来检查日志文件或页面,但它没有被触发:

谢谢你。

0 投票
1 回答
103 浏览

prestashop-1.6 - 如何在数据库(ps_product)Prestashop 中保存自定义字段?

为了在 Product 类中创建一些自定义字段并将它们保存在我在 ps_product 表中创建的列中,我还需要什么?

如果遇到一些错误,例如:

Unknown column 'price_recent1' in 'field list'

在此处输入图像描述



我做了什么:


我调整了 **Product.php** 以添加三个字段:
然后在 **mymodule.php** 我添加了 displayAdminProductsExtra 挂钩,以便在产品编辑后台显示一个选项卡:
最后我在 **mymodule.tpl** 中显示它们:
我还在 **ps_product** 表中创建了相应的列。
0 投票
1 回答
38 浏览

php - 动态更新从 prestashop 模块检索到的数字

晚上好,我正在开发一个 prestashop 模块,它必须通过从数据库中检索所述数据来显示头部钩子上的一些数据。我想让这些数据动态化,并在它在存储它的数据库中发生变化时更新它。最好的方法是什么?我正在考虑使用 ajax,但在解释如何实现它的模块开发文档中找不到任何参考。

谢谢,古斯塔沃。

0 投票
1 回答
27 浏览

prestashop - 访问 prestashop 后台值

Backoffice Image Here 这是来自 prestashop backoffice 的产品特征图像。谁能告诉我如何在控制器中访问这些特征?从过去的 2-3 天开始,我只在做这个

0 投票
1 回答
338 浏览

prestashop-1.7 - 订单确认后清除 Prestashop 运费

我在 Prestashop 1.7.6 上。我制作了一个简单的测试模块,用于添加自定义载体并以编程方式对其进行管理。

结帐时一切正常:我看到成本正确的新承运人,如果我选择它,则购物车的总数是正确的!(已添加运费)。

选择付款方式并确认订单后(我被重定向到订单确认页面),运费就消失了:总是免费送货!

我不懂为什么..

我报告了这个测试的代码:

0 投票
1 回答
65 浏览

prestashop - Prestashop 中的语言设置

在此处输入图像描述

在 Prestashop for English 网站中,我需要显示阿拉伯语选择器,在阿拉伯语网站上,我需要将英语显示为语言选择器。目前,它在语言选择栏上显示当前网站语言。有没有办法做到这一点?

0 投票
2 回答
357 浏览

mysql - 来自 SQL 数据库的 Prestashop / SQL 查询

我正在尝试创建一个查询,该查询返回特定产品(id 49)的每个订单的名字、姓氏、电子邮件和 key_value,但我无法正确配置 SQL 查询以获取每个客户的每个键。