小编kri*_*a89的帖子

Woocommerce - woocommerce_locate_template的替代品

我正在开发一个基于woocommerce的插件,作为我不得不覆盖woocommerce的默认模板文件位置的一部分.我的意思是我希望从我的插件中加载一个自定义的woocommerce模板.

为此,我根据本文阅读了woocommerce中的woocommerce_locate_template ,但我注意到根据此链接已弃用相同的功能.现在我想知道什么是替代功能.

我的目的是将默认的woocommerce模板加载位置更改为我的插件文件夹.有什么帮助解决这个问题?提前致谢.

php wordpress woocommerce

5
推荐指数
2
解决办法
2087
查看次数

PHP FPDF无法在Chrome中加载PDF文档

我正在尝试使用fpdf库和php生成pdf文档,但是在chrome中出现错误Failed to load PDF document。我可以在Firefox中正确查看文档。以下是我尝试生成pdf的代码。谁能帮忙吗?提前致谢。

<?php
 ini_set('display_startup_errors', 1);
 ini_set('display_errors', 1);
 error_reporting(-1);
 ob_start();
 $pdf = new FPDF();
 $pdf->AddPage();
 $pdf->SetFont('Arial', 'B', 16);
 $pdf->Cell(40, 10, 'Hello World!');
 header('Content-type: application/pdf');
 header('Content-Transfer-Encoding: binary');
 header("Content-Disposition: inline; filename='example2.pdf'");
 $pdf->Output('example2.pdf', 'I');
 ob_end_flush();
?>
Run Code Online (Sandbox Code Playgroud)

php pdf google-chrome fpdf

5
推荐指数
1
解决办法
3336
查看次数

PHP - setlocale(LC_MONETARY,'en_IN'); 不工作

我正在尝试将数字字符串转换为印度数字系统(Lakhs格式),为此我用Google搜索并尝试以下代码.

这个代码部分在linux共享托管服务器上测试时给了我正确的输出,但它不能在windows共享主机中工作,不确定这是否是由于某些版本问题,任何线索是否有任何替代setlocate

$amount = '120090';
setlocale(LC_MONETARY, 'en_IN');
$amount = money_format('%!i', $amount);
print $amount;
Run Code Online (Sandbox Code Playgroud)

php currency-formatting server

2
推荐指数
1
解决办法
1000
查看次数

woocommerce checkout ajax 500错误

我最近将我的网站中的woocommerce插件更新到2.6.0版本,现在我在结账时遇到500错误,并且根据付款方式更改了此错误消息.

我有几个付款方式为Direct Bank TransferCash On Delivery.

当我使用时,Direct Bank Transfer我收到错误消息错误,Internal Server Error并在浏览器控制台中,我能够看到问题所在http://example.com/checkout-2/?wc-ajax=checkout Failed to load resource: the server responded with a status of 500 (Internal Server Error)

另一方面,当我Cash On Delivery用作付款方式时,我看到了一个错误String could not be parsed as XML.

任何人都面临与woocommerce类似的问题?不确定这是因为插件更新还是其他任何功能.

ajax wordpress woocommerce

2
推荐指数
1
解决办法
4254
查看次数

jQuery 数据表 - 未捕获的类型错误:a.charAt 不是函数

我正在尝试将数据表 jQuery 插件集成到我通过 PHP 生成的表中。

使用搜索和排序选项,表格布局和一切看起来都很好,但是当单击表格标题中的任何排序选项时,我遇到了这个错误

未捕获的类型错误:a.charAt 不是函数

以前有人遇到过这个问题吗?任何帮助,将不胜感激。

php jquery datatables

2
推荐指数
1
解决办法
4429
查看次数

php - 使用strtotime日期到20世纪70年代

我试图在monday给定的日期使用下一个,strttotime但我从Jan 1970输出中获取日期.下面是我为下一个星期一的获取日期编写的代码行,我从这里得到了这段代码.谁能帮助我理解为什么会这样.提前致谢.

码:

$date_init = date('Y m d', strtotime('next monday', strtotime('2016 06 22')));
Run Code Online (Sandbox Code Playgroud)

预期产出:

2016 06 27
Run Code Online (Sandbox Code Playgroud)

实际产量:

1970 01 05
Run Code Online (Sandbox Code Playgroud)

php date strtotime

1
推荐指数
1
解决办法
72
查看次数

CSS3 - 延迟后使 div 消失

我正在为我的项目编写 css 代码,我只能使用 css3 动画来为 div 设置动画。我尝试使用网络中提供的一些工具生成以下代码并生成了抖动效果动画。

div.error {
    background-color: #E49F5C;
    color: #fff;
    padding: 20px;
    line-height: 50px;
    border-radius: 5px;
    font-size: 13px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 200px;
    text-align: center;
    height: 100px;
    z-index: 99999;
    animation: animationFrames linear 1s;
  animation-iteration-count: 1;
  transform-origin: 50% 50%;
  -webkit-animation: animationFrames linear 1s;
  -webkit-animation-iteration-count: 1;
  -webkit-transform-origin: 50% 50%;
  -moz-animation: animationFrames linear 1s;
  -moz-animation-iteration-count: 1;
  -moz-transform-origin: 50% 50%;
  -o-animation: animationFrames linear 1s;
  -o-animation-iteration-count: 1;
  -o-transform-origin: 50% 50%;
  -ms-animation: animationFrames linear 1s;
  -ms-animation-iteration-count: 1;
  -ms-transform-origin: 50% 50%; …
Run Code Online (Sandbox Code Playgroud)

html css css-animations

0
推荐指数
1
解决办法
1764
查看次数