On theretailer-child/woocommerce/content-single-product.php I have commented this line:
[php]
if(strlen($term_list) > 0){ echo ‘
‘; };
[/php]
On the same file I commented this block:
[php]
if ($i >= 1) {
?>
Add ftp credentials to wp-config.php
You can add ftp credentials to wp-config.php file using this
[php]
define( ‘FTP_USER’, ‘the_username’ );
define( ‘FTP_PASS’, ‘the_password’ );
define( ‘FTP_HOST’, ‘the_host’ );
define(‘FTP_SSL’, false);
[/php]
Note: FTP_SSL is set as false when dealing with ssh connections
Pending products invisible in admin
Even if the number of products (Published + Pending) is okay, when going to Pending page, products aren’t visible.
Went to woocommerce-seo-latest plugin and edited the woocommerce-seo-widgets.php like this:
[php]
/*
if( function_exists( ‘woocommerce_layered_nav_query’ ) ){
add_filter(‘loop_shop_post_in’, ‘woocommerce_layered_nav_query’);
} else { //woocommerce_layered_nav_query moved inside WC_Query class in Woocommerce 2.1
$wc_query = new WC_Query();
add_filter(‘loop_shop_post_in’, array( $wc_query, ‘layered_nav_query’ ) );
}
*/
add_filter(‘loop_shop_post_in’, ‘woocommerce_layered_nav_query’);
//daniel:: if above commented code is used, pending products aren’t visible in admin
[/php]
This seems to fix the problem
Change comma to dot in Product Information
Need to add “,” instead of “.” on “Product Information” for Høyde and Bredde.
In theretailer-child/woocommerce/single-product/meta.php:
[php]
if ( $attribute[‘is_taxonomy’] ) {
$values = woocommerce_get_product_terms( $product->id, $attribute[‘name’], ‘names’ );
if ($woocommerce->attribute_label( $attribute[‘name’] ) == ‘Bredde (cm)’ ||
$woocommerce->attribute_label( $attribute[‘name’] ) == ‘Høyde (cm)’ ){
echo apply_filters( ‘woocommerce_attribute’, wpautop( str_replace (".", ",", wptexturize( implode( ”, $values ) ) ) ), $attribute, $values );
}
else echo apply_filters( ‘woocommerce_attribute’, wpautop( wptexturize( implode( ‘, ‘, $values ) ) ), $attribute, $values );
//echo apply_filters( ‘woocommerce_attribute’, wpautop( wptexturize( implode( ‘, ‘, $values ) ) ), $attribute, $values );
} else {
[/php]
And in product’s admin for those values I use “.” that gets replaced by “,” on front end
Move/convert all categories/subcategories to models/submodel attribute
I added in header.php the following code
[php]
$catTerms = get_terms(‘product_cat’, array(‘hide_empty’ => 0, ‘orderby’ => ‘ASC’));
foreach($catTerms as $catTerm) :
//if ($catTerm->parent == 6991){
var_dump($catTerm);
$parent = get_term_by( ‘id’, $catTerm->parent, ‘product_cat’ );
var_dump($parent);
$models = get_terms("pa_modell");
foreach ($models as $model){
if ($model->name == $parent->name){
$y = wp_insert_term($catTerm->name, ‘pa_modell’, array(‘parent’ => $catTerm->parent));
//var_dump($y);die();
}
}
//}
endforeach;
[/php]
It searches for all categories and saves their subcategories as sub-models.
Everything is based on “term”