Home Forums Basel – Premium Template How to change the product page template?

This topic contains 8 replies, has 2 voices, and was last updated by Artem Temos Artem Temos 8 months, 2 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8527

    ecb21
    Participant

    I would like to change the product template for the alternative product page layout.
    I have edited the look and feel a bit to represent what I want to do. I can achieve a lot with css but I need to shuffle some elements in php i believe.

    Can you point me in the right direction with template I need to adjust and what I need to move to get what I want? thanks!

    I have added a screenshot of what i want, and what it is now out of the box.

    the box with all meta information has been moved down underneath the wc-tabs in my screenshot.

    Private Content Hidden
    • This topic was modified 8 months, 3 weeks ago by  ecb21. Reason: maximum file size
    Attachments:
    You must be logged in to view attached files.
    #8531
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    You can find a source code for the single product page in a file basel/woocommerce/content-single-product.php if you want to make some changes in its sturcture.

    Regards
    Xtemos

    #8555

    ecb21
    Participant

    Thank you for the reply.
    I have checked in that template but do not see the add to cart hooks and pricing for example, they are commented out as for which i conclude they are not being used in this template. furthermore i only see info on the sticky and compact template in there. I am using the alternative template.

    ps. the notify me on follow up replies via e-mail does not work from this forum, I haven’t received anything.

    #8558
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    Both price and add to cart are hooked to this hook

    <?php
    	/**
    	 * woocommerce_single_product_summary hook
    	 *
    	 * @hooked woocommerce_template_single_title - 5
    	 * @hooked woocommerce_template_single_rating - 10
    	 * @hooked woocommerce_template_single_price - 10
    	 * @hooked woocommerce_template_single_excerpt - 20
    	 * @hooked woocommerce_template_single_add_to_cart - 30
    	 * @hooked woocommerce_template_single_meta - 40
    	 * @hooked woocommerce_template_single_sharing - 50
    	 */
    	do_action( 'woocommerce_single_product_summary' );
    ?>

    If you want to change their order you need to remove and add actions with different priorities. Here is an article that should help you https://wpthememakeover.com/2016/03/07/how-to-customize-the-woocommerce-single-product-page/

    Regards

    #8559
    Artem Temos
    Artem Temos
    Keymaster

    If you don’t get emails from this topic then click on “Subscribe” button in the topic header.

    #8560

    ecb21
    Participant

    Thank you, but i cannot move the single_meta to underneath the tabs through the hooks. I have done the following:

    -create a function.php in my child theme and added these lines.

    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40 );
    add_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_template_single_meta’, 14 );

    I noticed that is in another box (after_single_product_summary) and that the action does not work.

    #8561

    ecb21
    Participant

    Never mind, it has been fixed. forgot to update the php file to the server lol.

    Thank you!

    #8562

    ecb21
    Participant

    Guys, I have made some adjustments, but the hook for the “in stock” is nowhere to be found. I also checked online if i can find something about it but i haven’t found anything.

    i would like to get the in/out stock notification behind the price.

    Could you point me in the right direction? I am almost there!

    Private Content Hidden
    #8567
    Artem Temos
    Artem Temos
    Keymaster

    In/out of stock is connected to “Add to cart” hook and can’t be moved with actions. You can find its source code in add to cart templates located in wp-content/plugins/woocommerce/templates/single-product/add-to-cart

    Regards

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.