$chars = array(
0 => '0',
1 => '1',
2 => '2',
3 => '3',
4 => '4',
5 => '5',
6 => '6',
7 => '7',
8 => '8',
9 => '9',
10 => 'A',
11 => 'B',
12 => 'C',
13 => 'D',
14 => 'E',
15 => 'F',
16 => 'G',
17 => 'H',
18 => 'I',
19 => 'J',
20 => 'K',
21 => 'L',
22 => 'M',
23 => 'N',
24 => 'O',
25 => 'P',
26 => 'Q',
27 => 'R',
28 => 'S',
29 => 'T',
30 => 'U',
31 => 'V',
32 => 'W',
33 => 'X',
34 => 'Y',
35 => 'Z',
36 => '-',
37 => '.',
38 => ' ',
39 => '$',
40 => '/',
41 => '+',
42 => '%'
);
$n = 'CODE39';
$nstr = $n . "";
$sum = 0;
for ($i = 0; $i < strlen($nstr); ++$i)
{
$k = substr($n, $i, 1);
$m = array_search($k, $chars);
$sum += $m;
}
$ns=($sum % 43);
print "<a>$n$chars[$ns]</a>";
$dosl=urlencode($dosl);
в недостающих блоках кода. while($p=$q->fetchArray()){$i++;
$V=$db->query("select * from lbgDB52 where p3='$p[24]'");
$sl.="<tr><td>$i<td>$p[12] $p[13]<td>$p[26]<td>";
$ii=0;$N=0;
while($v=$V->fetchArray()){$ii++;
$a=explode('<td>',$v[4]);
$sl.="$ii. $a[1]<br>";
$N+=(int)str_replace(',','.',$v[7]);
$M="$v[7]<br>";
}
$sl.="<td align=center>$ii<td>послуга<td align=center>";
while($v=$V->fetchArray()){$ii++;
$sl.="$v[7]<br>";
$N+=(int)str_replace(',','.',$v[7]);
}
$sl.="<td align=center>$N.00";
$pr+=$N;
}
function devise_wc_ga_integration( $order_id ) {
$order = new WC_Order( $order_id ); ?>
<script type="text/javascript">
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '<?php echo $order_id;?>',
'affiliation': '<?php echo get_option( "blogname" );?>',
'revenue': '<?php echo $order->get_total();?>',
'shipping': '<?php echo $order->get_total_shipping();?>',
'tax': '<?php echo $order->get_total_tax();?>',
'currency': '<?php echo get_woocommerce_currency();?>'
});
<?php
if ( sizeof( $order->get_items() ) > 0 ) {
foreach( $order->get_items() as $item ) {
$product_cats = get_the_terms( $item["product_id"], 'product_cat' );
if ($product_cats) {
$cat = $product_cats[0];
} ?>
ga('ecommerce:addItem', {
'id': '<?php echo $order_id;?>',
'name': '<?php echo $item['name'];?>',
'sku': '<?php echo get_post_meta($item["product_id"], '_sku', true);?>',
'category': '<?php echo $cat->name;?>',
'price': '<?php echo $item['line_subtotal'];?>',
'quantity': '<?php echo $item['qty'];?>',
'currency': '<?php echo get_woocommerce_currency();?>'
});
<?php
}
} ?>
ga('ecommerce:send');
</script>
<?php }
add_action( 'woocommerce_thankyou', 'devise_wc_ga_integration' );
jQuery('#scrollToContent').click(function(e){
e.preventDefault();
jQuery.scrollTo("#portfolio", 1000, { offset:-(jQuery('#header .top').height()), axis:'y' });
});
jQuery('nav > ul > li > a').click(function(e){
e.preventDefault();
jQuery.scrollTo(jQuery(this).attr('href'), 400, { offset:-(jQuery('#header .top').height()), axis:'y' });
})