• Resolved pl.xrisa

    (@xrisa30)


    Hi,

    I want to add a hook in my product page, but as I can see you have change the summary..

    I want to add this hook…

    add_action(‘woocommerce_single_product_summary’,’my_custom_field’, 20);

    and the hook don’t respect my choise.

    I found at github that you have remove the hooks to add your summary hook..

    // Remove the single product summary content to add the sortable control
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_rating’, 10 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40 );
    add_action( ‘woocommerce_single_product_summary’, array( $this, ‘single_product_content’ ), 10 );

    So now my hook goes above or below your summary…

    How can I add my hook?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pl.xrisa

    (@xrisa30)

    UPDATE:

    I disabled all the elements from customize and I wrote in my functions:

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 20 );

    add_action(‘woocommerce_single_product_summary’,’MY_CUTSOM_FIELD’,30);

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 40);

    etc…

    I think is the only way to put something between the elements.

    One more question… is it posible to have the menu cart icon, seperate from the menu in mobiles?

    In mobiles, the cart icon must be on the right and menu on the left.

    I tried to use the shortcode [oceanwp_woo_cart], but with this shortcode I can’t have the off canvas cart on mobiles.

    Thank you.

    Theme Author oceanwp

    (@oceanwp)

    Hello, yes it is possible to do what you want but it will require custom work via your child theme.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hooks Problem’ is closed to new replies.