Wow, thanks for the link, downrodeo! It’s written in a very user-friendly way.
Interesting post
I got the rough idea of woocommerce-hooks.php, function.php
I m currently using wootheme superstore and would like to move
have the product description (i think that should be div class woo commerce-tabs)
underneath my image and price add to cart field. I tried to find a solution by looking at the emporium theme by woothemes,
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?>
<?php
/**
* woocommerce_before_single_product hook
*
* @hooked woocommerce_show_messages - 10
*/
do_action( 'woocommerce_before_single_product' );
?>
<div itemscope itemtype="http://schema.org/Product" id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
/**
* woocommerce_show_product_images hook
*
* @hooked woocommerce_show_product_sale_flash - 10
* @hooked woocommerce_show_product_images - 20
*/
do_action( 'woocommerce_before_single_product_summary' );
?>
<div class="summary entry-summary">
<?php
do_action( 'woocommerce_single_product_summary' );
?>
</div><!-- .summary -->
<?php
/**
* woocommerce_after_single_product_summary hook
*
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
* @hooked woocommerce_output_product_data_tabs - 10
* @hooked woocommerce_output_related_products - 20
*/
do_action( 'woocommerce_after_single_product_summary' );
?>
</div><!-- #product-<?php the_ID(); ?> -->
<?php do_action( 'woocommerce_after_single_product' ); ?>
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
trying to understand the way the layout of woocommerce works.
is this right????
the content-single-product.php just calls the two basic divs
then the content is split up in three calls? before-summary / summary / after-summary?
the number at the end of the hooks define the ranking or position of appearance within a call?
so its
div before @hooked 10
@hooked 20
@hooked 30
summary @hooked 10
@hooked 20
@hooked 30
after @hooked 10
@hooked 20
@hooked 30
with the functions.php I can move stuff around between before summary and after and change ranks: e.g.
/*---Move Product Title*/
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_before_single_product_summary',
'woocommerce_template_single_title', 5 );
Is all I need to do now find the right way of
remove_action delete tabs in summary
add_action add tabs to after_summary?
and if review shows up first I ll order the number e.g. @hooked 10 for it to be loaded before review?
add_action add tabs to after_summary?
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 1 );
as you can seee on
all is missing is a way to remove the woocommerce-tabs box of the summary
I tried to edit a woocommerce add_action, but it does not work. Dont know whether this is the right way to customize a woocommerce action?
What I did:
added following code into woocommerce functions.php
global $woocommerce;
$arr=$woocommerce->payment_gateways->get_available_payment_gateways();
remove_action( 'woocommerce_email_before_order_table', array($arr['bacs'] , 'email_instructions' ), 10, 2 );
add_action( 'woocommerce_email_before_order_table', array( $arr['bacs'], 'newemail' ), 10, 2 );
function newemail( $order, $sent_to_admin ) {
if ( $sent_to_admin ) return;
if ( $order->status !== 'on-hold') return;
if ( $order->payment_method !== 'bacs') return;
if ( $description = $arr['bacs']->get_description() )
echo wpautop( wptexturize( $description ) );
?><h2><?php _e( 'FuckingDetails', 'woocommerce' ) ?></h2><ul class="order_details bacs_details"><?php
$fields = apply_filters('woocommerce_bacs_fields', array(
'account_name' => __( 'Account Name', 'woocommerce' ),
'account_number'=> __( 'Account Number', 'woocommerce' ),
'sort_code' => __( 'Sort Code', 'woocommerce' ),
'bank_name' => __( 'Bank Name', 'woocommerce' ),
'iban' => __( 'IBAN', 'woocommerce' ),
'bic' => __( 'BIC', 'woocommerce' )
));
foreach ($fields as $key=>$value) :
if(!empty($arr['bacs']->$key)) :
echo '<li class="'.$key.'">'.$value.': <strong>'.wptexturize($arr['bacs']->$key).'</strong>';
endif;
endforeach;
?><?php
}
[Please use the code buttons when posting code ]
Action removes, but then When I add my new customized action it does not trigger. Also it has problems with other payment gateways
Nearly a year later, and this problem still exists.
The templating system is still completely absurd. So it needs good documentaton.
But the documentation offered by woocommerce is still absolute rubbish.
Once I’ve done my current project, I’m never going near the pile of rubbish that is woocommerce again.
There is absolutely no reason for their templating system to be so difficult. I’d recommend developers stay away from this dreck.