在simplecart js中进行sendform签出后,如何在php变量中获取项目大小?

在simplecart js中进行sendform签出后,如何在php变量中获取项目大小?,php,javascript,simplecart,Php,Javascript,Simplecart,我在javascript中是一个真正的noob,我自己找不到解决方案……我想在一些php变量中的sendform签出后返回项目的大小 上下文: 1-我提供一个产品页面,客户可以在其中选择尺寸和数量,并将产品添加到购物篮中。 2-签出页面,包含拇指、数量、大小、价格等以及sendform验证(我在签出页面上没有任何表单,它只是用于获取php中的所有项目变量) 3-返回php中所有项目的页面(客户必须上传每个项目的图片): 存储在名为 item_options 因此,必须在php变量中获取item

我在javascript中是一个真正的noob,我自己找不到解决方案……我想在一些php变量中的sendform签出后返回项目的大小

上下文:
1-我提供一个产品页面,客户可以在其中选择尺寸和数量,并将产品添加到购物篮中。
2-签出页面,包含拇指、数量、大小、价格等以及sendform验证(我在签出页面上没有任何表单,它只是用于获取php中的所有项目变量)
3-返回php中所有项目的页面(客户必须上传每个项目的图片):

存储在名为

item_options
因此,必须在php变量中获取item_选项,并使用explode函数拆分字符链:

$content = $_POST;

$item_number = array(); // compteur d items
$item = array(); // tableaux qui récupere les valeurs de chaque items

for($i=1; $i < $content['itemCount'] + 1; $i++) 
{
  //I passed two params in item_options, the size and a path to an picture
  $options = 'item_options_'.$i; //let s get the name of the java var in a php var

  $item_number['total'] = $i; //let s count the number of items

  $item[$i]['options'] = $content[$options]; //let s get the values of item_options
}

$total = $item_number['total'];
$line = 0;

while ($line <= $total -1) 
{
$line++;
$split_options = explode(",", $item[$line]['options']); // explode the chain in few chains                                                  
$split_thumb = explode(":", $split_options[0]); // for each chain, cut the useless part before ":", for exemple thumbPath: ../pictures                                           
$split_size = explode(":", $split_options[1]);

echo $split_thumb[1]; // display the path of my thumb
echo $split_size[1]; // display the size of my item
}?>
$content=$\u POST;
$item_number=array();//计算机辅助项目
$item=array();//关于查克项目的会议桌
对于($i=1;$i<$content['itemCount']+1;$i++)
{
//我在item_选项中传递了两个参数,大小和图片路径
$options='item_options.'$i;//让我们在php变量中获取java变量的名称
$item_number['total']=$i;//让我们计算一下项目的数量
$item[$i]['options']=$content[$options];//让我们获取item\u选项的值
}
$total=$item_number['total'];
$line=0;
而($行
您可以添加项目
data[“item\u size\u”+计数器]=item.get(“size”);
到SendForm函数中的simplecart.js文件

item_options
$content = $_POST;

$item_number = array(); // compteur d items
$item = array(); // tableaux qui récupere les valeurs de chaque items

for($i=1; $i < $content['itemCount'] + 1; $i++) 
{
  //I passed two params in item_options, the size and a path to an picture
  $options = 'item_options_'.$i; //let s get the name of the java var in a php var

  $item_number['total'] = $i; //let s count the number of items

  $item[$i]['options'] = $content[$options]; //let s get the values of item_options
}

$total = $item_number['total'];
$line = 0;

while ($line <= $total -1) 
{
$line++;
$split_options = explode(",", $item[$line]['options']); // explode the chain in few chains                                                  
$split_thumb = explode(":", $split_options[0]); // for each chain, cut the useless part before ":", for exemple thumbPath: ../pictures                                           
$split_size = explode(":", $split_options[1]);

echo $split_thumb[1]; // display the path of my thumb
echo $split_size[1]; // display the size of my item
}?>