Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 根据usnig产品id,如何在环路外使用woocammerse挂钩_Php_Jquery_Ajax_Wordpress - Fatal编程技术网

Php 根据usnig产品id,如何在环路外使用woocammerse挂钩

Php 根据usnig产品id,如何在环路外使用woocammerse挂钩,php,jquery,ajax,wordpress,Php,Jquery,Ajax,Wordpress,我正在尝试使用ajax预览一个产品,在操作页面上,我想获得一些产品挂钩,比如woocommerce\u template\u single\u title() 但是我不在Woocommerce循环中,我有产品id,我不知道如何使用产品id来使用Woocommerce挂钩和操作 这是我的ajax调用: jQuery('.main_ajax_loader').hide(); jQuery(".ajax_link").click(function (e) {

我正在尝试使用ajax预览一个产品,在操作页面上,我想获得一些产品挂钩,比如
woocommerce\u template\u single\u title()
但是我不在Woocommerce循环中,我有产品id,我不知道如何使用产品id来使用Woocommerce挂钩和操作

这是我的ajax调用:

jQuery('.main_ajax_loader').hide();
    jQuery(".ajax_link").click(function (e) {
        e.preventDefault();
        post1 = jQuery(this).attr("post_id");
        console.log(post1);
        jQuery.ajax({
            url : myAjax.ajaxurl,
            type: "post",
            data: {action: "product_ajax", post1},
            
            success: function (response) {
                jQuery('.main_ajax_loader').show();
                jQuery(".ajax_content").html(response);
                jQuery('.main_ajax_loader').hide();

            },
            error: function (response) {
            }
        })
    })
这就是我想要的标题:

<div class="row">
  <div id="product-<?php $post_ids = $_POST['post1']; echo ($post_ids);?>" 
  <?php wc_product_class( '', $product ); ?>>
    <div class="col-md-6">
      <div class="description-prodact-modal">
        <?php woocommerce_template_single_title(); ?>
        <p>...</p>
        <div class="prise-modal">
          <p>...</p>
</div>