3
Woocommerce의 체크 아웃 페이지에 각 제품에 대한 간단한 설명을 어떻게 추가합니까? 나는 수 많은 연구를 해왔으며, 이것이 내가 생각해 낸 최고 다.체크 아웃 woocommerce wordpress에서 간단한 설명
<?php
if (sizeof($woocommerce->cart->get_cart())>0) :
foreach ($woocommerce->cart->get_cart() as $item_id => $values) :
$_product = $values['data'];
if ($_product->exists() && $values['quantity']>0) :
echo '
<tr class = "' . esc_attr(apply_filters('woocommerce_checkout_table_item_class', 'checkout_table_item', $values, $item_id)) . '">
<td class="product-name">'.$_product->get_title().$woocommerce->cart->get_item_data($values).'</td>
<td class="short_description">'.$_product->get_post_data().$woocommerce->post->get_post_excerpt($values).'</td>
<td class="product-quantity">'.$values['quantity'].'</td>
<td class="basispreis">'.$_product->get_price().$woocommerce->post->get_post_excerpt($values).'</td>
<td class="product-total">' . apply_filters('woocommerce_checkout_item_subtotal', $woocommerce->cart->get_product_subtotal($_product, $values['quantity']), $values, $item_id) . '</td>
</tr>';
endif;
endforeach;
endif;
do_action('woocommerce_cart_contents_review_order');
?>
나는 오류를 얻을
잡아낼 치명적인 오류 :에 /wp-content/plugins/woocommerce/templates/checkout/form-checkout.php 에서 문자열로 변환 할 수 없습니다 WP_Post 클래스의 객체 이 라인
<td class="short_description">'.$_product->get_post_data().$woocommerce->post->get_post_excerpt($values).'</td>
감사합니다. 이 기능을 작동 시키려면 어떻게해야합니까? 클래스 -wc-cart.php에 넣고 php echo add_filter ('woocommerce_get_item_data', 'wc_checkout_description_so_15127954', 10, 2); ?> 페이지에 나타납니다. 틀렸어? 출력이 1이됩니다. – SilverNightaFall
죄송합니다. 테마의'functions.php' 파일에 해당 파일을 놓기 만하면됩니다. 그대로, '에코'가 없습니다. – brasofilo
WooCommerce 2.2+ 업데이트에 대한 [이 답변] (http://stackoverflow.com/a/27918859/383847)을 참조하십시오. – helgatheviking