<?php $product->list_attributes(); ?>
используется метот list_attributes(); Можно на этом остановиться и в своем шаблоне написать global $product;
$product->list_attributes();
public function list_attributes() {
wc_get_template( 'single-product/product-attributes.php', array(
'product' => $this
) );
}
$attributes = $product->get_attributes();
.........
<?php foreach ( $attributes as $attribute ) :
if ( empty( $attribute['is_visible'] ) || ( $attribute['is_taxonomy'] && ! taxonomy_exists( $attribute['name'] ) ) ) {
continue;
} else {
$has_row = true;
}
?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<th><?php echo wc_attribute_label( $attribute['name'] ); ?></th>
<td><?php
if ( $attribute['is_taxonomy'] ) {
$values = wc_get_product_terms( $product->id, $attribute['name'], array( 'fields' => 'names' ) );
echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );
} else {
// Convert pipes to commas and display values
$values = array_map( 'trim', explode( WC_DELIMITER, $attribute['value'] ) );
echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );
}
?></td>
</tr>
<?php endforeach; ?>
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
$(function () {
// Проверяем запись в куках о посещении
// Если запись есть - ничего не происходит
if (!getCookie('hideModal')) {
// если cookie не установлено появится окно
// с задержкой 5 секунд
var delay_popup = 5000;
setTimeout("document.getElementById('overlay').style.display='block'", delay_popup);
} else {
console.log('no way');
}
setCookie('hideModal', true, 7);
});
<?php
function mail_utf8($to, $from_user, $from_email,
$subject = '(No subject)', $message = '')
{
$from_user = "=?UTF-8?B?".base64_encode($from_user)."?=";
$subject = "=?UTF-8?B?".base64_encode($subject)."?=";
$headers = "From: $from_user <$from_email>\r\n".
"MIME-Version: 1.0" . "\r\n" .
"Content-type: text/html; charset=UTF-8" . "\r\n";
return mail($to, $subject, $message, $headers);
}
?>
<form id="add" action="/add" method="POST">
<input type="text" name="firstname">
<input type="text" name="lastname">
<input type="email" name="email">
<input type="submit" id="sendButton" style="display: none;" />
</form>
$(".add").click(function(){
$("#sendButton").click();
});
try {
//тут возможно проблемный код
} catch (error) {
//а тут то, что делать, когда код выше вызвал ошибку
}
@media screen and (max-width:767px) {
}
@media screen and (min-width:768px) and (max-width:991px) {
}
@media screen and (min-width:992px) and (max-width:1199px) {
}
@media screen and (min-width: 1200px) {
}
User-agent: Googlebot
Allow: /*.css*
Allow: /*.js*
Allow: /*.ttf*
Allow: /*.woff*
User-agent: Googlebot-Mobile
Allow: /*.css*
Allow: /*.js*
Allow: /*.ttf*
Allow: /*.woff*
function exampleClickToSave() {
// save content if you need
var ta = $('#ta').val();
var cautid = $('#cid').val();
var cthemeid = $('#tid').val();
//alert(ta+cautid+cthemeid);
$("#ta").val("");
if (ta != ""){
$.ajax({
url: mvmloc+"scrpt/save_page.php?cautid="+cautid+"&cthemeid="+cthemeid+"&ta="+ta,
cache: false,
success: function(html){
$(".shwcmtblckinthme").prepend(html);
}
});
}
}
$('#ta').live('onKeyDown',function(){
if( e.keyCode === 13 ) {
$("#ta").val("");
e.preventDefault();
exampleClickToSave();
}
});
function exampleClickToSave() {
// save content if you need
var ta = $('#ta').val();
var cautid = $('#cid').val();
var cthemeid = $('#tid').val();
if (ta){
$.ajax({
url: mvmloc+"scrpt/save_page.php?cautid="+cautid+"&cthemeid="+cthemeid+"&ta="+ta,
cache: false,
success: function(html){
$(".shwcmtblckinthme").prepend(html);
$("#ta").val("");
}
});
}
}
проверку лучше так делать